Skip to content

Commit

Permalink
ack
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdoupe committed Oct 30, 2023
1 parent 5d2b9a7 commit 7e3c047
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions cryptography/run
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,13 @@ def level5():
key = get_random_bytes(16)
cipher = AES.new(key=key, mode=AES.MODE_ECB)

print(f"{pad(flag, cipher.block_size)}")
ciphertext = cipher.encrypt(pad(flag, cipher.block_size))
show_b64("secret ciphertext", ciphertext)
show_hex_block("secret ciphertext", ciphertext)

while True:
plaintext_prefix = input_b64("plaintext prefix")
ciphertext = cipher.encrypt(pad(plaintext_prefix + flag, cipher.block_size))
print(f"{pad(plaintext_prefix + flag, cipher.block_size)}")
show_b64("ciphertext", ciphertext)
show_hex_block("ciphertext", ciphertext)

Expand Down

0 comments on commit 7e3c047

Please sign in to comment.