Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. def AESCBC(plainText, IV, key):
  2. >>> key = bytes([57, 226, 240, 61, 125, 240, 75, 68, 22, 35, 124, 205, 144, 27, 118, 220])
  3. >>> iv = bytes([241, 147, 66, 129, 194, 34, 37, 51, 236, 69, 188, 205, 64, 140, 244, 204])
  4. >>> decrypt_aes(bytes([255, 18, 67, 115, 172, 117, 242, 233, 246, 69, 81, 156, 52, 154, 123, 171]),key,iv)
  5. b'hello world 1234'
  6. >>> decrypt_aes(bytes([171, 218, 160, 96, 193, 134, 73, 81, 221, 149, 19, 180, 31, 247, 106, 64]),key,iv)
  7. b'lovecryptography'
  8. cipher = AES.new(key, AES.MODE_CBC, iv = IV)
  9. cipherText, tag = cipher.encrypt_and_digest(plainText)
  10. return cipherText
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement