1try: 2 from ucryptolib import aes 3except ImportError: 4 print("SKIP") 5 raise SystemExit 6 7 8def _new(k, ctr_initial): 9 return aes(k, 6, ctr_initial) 10 11 12try: 13 _new(b"x" * 16, b"x" * 16) 14except ValueError as e: 15 # is CTR support disabled? 16 if e.args[0] == "mode": 17 print("SKIP") 18 raise SystemExit 19 raise e 20 21crypto = _new(b"1234" * 4, b"5678" * 4) 22enc = crypto.encrypt(b"a") 23print(enc) 24enc += crypto.encrypt(b"b" * 1000) 25print(enc) 26 27crypto = _new(b"1234" * 4, b"5678" * 4) 28print(crypto.decrypt(enc)) 29