(plaintext, key)
| 5 | import hashlib |
| 6 | |
| 7 | def AESencrypt(plaintext, key): |
| 8 | k = hashlib.sha256(KEY).digest() |
| 9 | iv = 16 * b'\x00' |
| 10 | plaintext = pad(plaintext, AES.block_size) |
| 11 | cipher = AES.new(k, AES.MODE_CBC, iv) |
| 12 | ciphertext = cipher.encrypt(plaintext) |
| 13 | return ciphertext,key |
| 14 | |
| 15 | |
| 16 | def printResult(key, ciphertext): |