This shows you the differences between two versions of the page.
isc:labs:02 [2024/03/03 12:58] vlad_iulius.nastase [03 [15p] Is this even OTP?] |
isc:labs:02 [2024/03/03 13:03] (current) vlad_iulius.nastase [05 [20p] We want Jokes instead of Nukes] |
||
---|---|---|---|
Line 153: | Line 153: | ||
{{:isc:labs:isc-lab02-secret.zip|This file (compressed as .zip)}} was encrypted using the following code. Can you decrypt it? | {{:isc:labs:isc-lab02-secret.zip|This file (compressed as .zip)}} was encrypted using the following code. Can you decrypt it? | ||
- | <code> | + | <code python> |
from Crypto.Cipher import AES | from Crypto.Cipher import AES | ||
from Crypto import Random | from Crypto import Random | ||
Line 190: | Line 190: | ||
<solution -hidden> | <solution -hidden> | ||
- | <code> | + | <code python> |
from Crypto.Cipher import AES | from Crypto.Cipher import AES | ||
Line 230: | Line 230: | ||
</code> | </code> | ||
* **Note**: the result is a decimal number, you need to convert it to an ASCII text using the snippet below: | * **Note**: the result is a decimal number, you need to convert it to an ASCII text using the snippet below: | ||
- | <code> | + | <code python> |
print(hex(message)[2:].decode("hex")) # python 2 | print(hex(message)[2:].decode("hex")) # python 2 | ||
print(bytearray.fromhex(hex(message)[2:])) # python 3 | print(bytearray.fromhex(hex(message)[2:])) # python 3 | ||
Line 239: | Line 239: | ||
<solution -hidden> | <solution -hidden> | ||
- | <code> | + | <code python> |
import gmpy2 | import gmpy2 | ||
Line 265: | Line 265: | ||
<solution -hidden> | <solution -hidden> | ||
- | <code> | + | <code python> |
# Key = 1e: i_guess_it_kinda_is_otp | # Key = 1e: i_guess_it_kinda_is_otp | ||
Line 307: | Line 307: | ||
<solution -hidden> | <solution -hidden> | ||
- | <code> | + | <code python> |
original_iv = bytes.fromhex('7ec00bc6fd663984c1b6c6fd95ceeef1') | original_iv = bytes.fromhex('7ec00bc6fd663984c1b6c6fd95ceeef1') |