2018-01-07 08:15:05 -05:00
|
|
|
# Inplace operations (input and output buffer is the same)
|
|
|
|
try:
|
2022-08-18 02:57:45 -04:00
|
|
|
from cryptolib import aes
|
2018-01-07 08:15:05 -05:00
|
|
|
except ImportError:
|
|
|
|
print("SKIP")
|
|
|
|
raise SystemExit
|
|
|
|
|
|
|
|
crypto = aes(b"1234" * 4, 1)
|
|
|
|
buf = bytearray(bytes(range(32)))
|
|
|
|
crypto.encrypt(buf, buf)
|
|
|
|
print(buf)
|
|
|
|
|
|
|
|
crypto = aes(b"1234" * 4, 1)
|
|
|
|
crypto.decrypt(buf, buf)
|
|
|
|
print(buf)
|