Skip to content

Instantly share code, notes, and snippets.

import hashlib
from Crypto import Random
from Crypto.Cipher import AES
from base64 import b64encode, b64decode
class AESCipher(object):
def __init__(self, key):
self.block_size = AES.block_size
self.key = hashlib.sha256(key.encode()).digest()