2018-01-07 13:15:05 +00:00
|
|
|
# Inplace operations (input and output buffer is the same)
|
|
|
|
try:
|
2022-08-18 07:57:45 +01:00
|
|
|
from cryptolib import aes
|
2018-01-07 13:15:05 +00: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)
|