Python3 AES 암호화, 복호화
1. pycrypto 설치필요 pip install pycrypto 2. 암호화, 복호화 클래스 import base64 import hashlib from Crypto.Cipher import AES BS = 16 pad = (lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS).encode()) unpad = (lambda s: s[:-ord(s[len(s)-1:])]) class AESCipher(object): def __init__(self, key): self.key = hashlib.sha256(key.encode()).digest() def encrypt(self, message): message = message.encode() raw = ..
Devolopment/Python
2022. 6. 20. 11:46
반응형
최근에 달린 댓글