ACIL FM
Dark
Refresh
Current DIR:
/usr/share/doc/python3-cryptography/docs/development/custom-vectors/seed
/
usr
share
doc
python3-cryptography
docs
development
custom-vectors
seed
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
generate_seed.py
1.79 MB
chmod
View
DL
Edit
Rename
Delete
verify_seed.py
885 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/share/doc/python3-cryptography/docs/development/custom-vectors/seed/verify_seed.py
import binascii import botan from tests.utils import load_nist_vectors def encrypt(mode, key, iv, plaintext): encryptor = botan.Cipher( "SEED/{0}/NoPadding".format(mode), "encrypt", binascii.unhexlify(key) ) cipher_text = encryptor.cipher( binascii.unhexlify(plaintext), binascii.unhexlify(iv) ) return binascii.hexlify(cipher_text) def verify_vectors(mode, filename): with open(filename, "r") as f: vector_file = f.read().splitlines() vectors = load_nist_vectors(vector_file) for vector in vectors: ct = encrypt(mode, vector["key"], vector["iv"], vector["plaintext"]) assert ct == vector["ciphertext"] ofb_path = "vectors/cryptography_vectors/ciphers/SEED/seed-ofb.txt" verify_vectors("OFB", ofb_path) cfb_path = "vectors/cryptography_vectors/ciphers/SEED/seed-cfb.txt" verify_vectors("CFB", cfb_path)
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply