Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60190977
gen.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Apr 28, 04:34
Size
543 B
Mime Type
text/x-python
Expires
Tue, Apr 30, 04:34 (2 d)
Engine
blob
Format
Raw Data
Handle
17315336
Attached To
R10848 The Area-Latency Symbiosis
gen.py
View Options
# AES 256 encryption/decryption using pycrypto library
import
binascii
from
Crypto.Cipher
import
AES
import
random
def
hex
(
abc
):
b
=
binascii
.
hexlify
(
abc
)
b
=
str
(
b
,
"UTF-8"
)
return
b
def
unhex
(
hx
):
return
binascii
.
unhexlify
(
hx
)
return
str
(
b
,
"UTF-8"
)
BLOCK_SIZE
=
16
k
=
"603DEB1015CA71BE2B73AEF0857D7781"
pt
=
"6BC1BEE22E409F96E93D7E117393172A"
for
j
in
range
(
100
):
cipher
=
AES
.
new
(
unhex
(
k
))
ct
=
hex
(
cipher
.
encrypt
(
unhex
(
pt
)))
print
(
pt
)
print
(
k
)
print
(
ct
)
tmp
=
k
k
=
ct
pt
=
tmp
Event Timeline
Log In to Comment