10
2
Today your goal is to decrypt a secret message using AES. Given a ciphertext and key you will decrypt and print the message.
Your program may be in any language. It will be run with input on stdin, and its output on stdout will be checked for correctness.
The first line of input on stdin will be the 16 byte key, encoded in hexadecimal. The second line of input on stdin will be the 16 byte ciphertext, encoded in hexadecimal.
The output of the program must be the 16 byte message after decrypting the ciphertext using AES-128 with the given key. You must output the result interpreted as ASCII octets. You may assume that any result is valid ASCII after decrypting.
You may not use any library/built-in features that implement AES. You may use such features to convert between hex/binary/ASCII encodings.
Shortest code in bytes wins.
Example input and output:
bd8ab53f10b3d38576a1b9a15cf03834
02c0ee126cae50ba938a8b16f0e04d23
Attack tomorrow.
And another:
f4af804ad097ba832906db0deb7569e3
38794338dafcb09d6b32b04357f64d4d
Congratulations.
5...What is AES? – Alex A. – 2015-03-21T19:03:23.843
1
@AlexA. Advanced Encryption Standard.
– orlp – 2015-03-21T19:13:31.6003Related – Peter Taylor – 2015-03-21T19:44:41.073