Programming/Python
2020. 4. 25.
[Python] 단일 치환 암호
단일 치환 암호는 알파벳을 일대일 대응하여 암호를 만드는 알고리즘이다. 단점은 암호문과 평문에서 문자의 빈도가 동일하다는 것이다. 예를들어 A->C , B->D 로 치환된 AABBABA의 암호문은 CCDDCDC이다. 빈도분석으로 추측 해독이 가능하다. 그래서 암호화만 만들었다. ##mono_sub_cipher from random import shuffle def Encryption(plain_text): substitution = list(range(65,91)) shuffle (substitution) plain_text = plain_text.upper() cipher_text = [] for i in plain_text: cipher_text.append(chr(substitution[ord(i)..