Python - AES 양방향 암호화
·
Programming/Python
모듈 설치 $ pip install pycryptodome 예제 코드 import base64 from Crypto import Random from Crypto.Cipher import AES class AES256(): def __init__(self, key): self.bs = 128 self.key = key.encode('utf-8') self.key = AES256.str_to_bytes(key) @staticmethod def str_to_bytes(data): u_type = type(b''.decode('utf8')) if isinstance(data, u_type): return data.encode('utf8') return data def _pad(self, s): return s..