Exemplo n.º 1
0
import sys
import aes
import pad

key = open('chal_13_key', 'rb').read()

c = aes.encrypt_ecb(pad.pkcs7(b'hello', 16), key)
c = bytearray(c)
#c[0] = 4
c = bytes(c)
print(c)

p = aes.decrypt_ecb(c, key)

print(p)
Exemplo n.º 2
0
def load():
    with open('25.txt', 'r') as f:
        ct = base64.b64decode(''.join(f.read().split()))
    return aes.decrypt_ecb(ct, 'YELLOW SUBMARINE')
Exemplo n.º 3
0
import aes
import base64

with open('7.txt', 'r') as f:
    ct = base64.b64decode(''.join(f.read().split()))

key = "YELLOW SUBMARINE"

print aes.decrypt_ecb(ct, key)
Exemplo n.º 4
0
def unoracle(cipher):
    key = open('chal_13_key', 'rb').read()
    plain = aes.decrypt_ecb(cipher, key).decode('ascii')
    return parse(plain)
Exemplo n.º 5
0
def is_admin(encrypted_profile):
    profile = parse_query_string(aes.decrypt_ecb(encrypted_profile, key))
    return 'admin' in profile['role']