def __init__(self, key=None, blocklen=16):
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
key = key or urandom(blocklen)
iv = b' ' * blocklen
self.blocklen = blocklen
self.cipher = Cipher(algorithms.AES(key), modes.CTR(iv), backend=default_backend())
评论列表
文章目录