ucryptolib_aes128_ecb_enc.py 416 B

12345678910111213141516
  1. # This tests minimal configuration of ucrypto module, which is
  2. # AES128 encryption (anything else, including AES128 decryption,
  3. # is optional).
  4. try:
  5. from Crypto.Cipher import AES
  6. aes = AES.new
  7. except ImportError:
  8. try:
  9. from ucryptolib import aes
  10. except ImportError:
  11. print("SKIP")
  12. raise SystemExit
  13. crypto = aes(b"1234" * 4, 1)
  14. enc = crypto.encrypt(bytes(range(32)))
  15. print(enc)