Problem A
M0: Implement Speck
This is the $1$st of $4$ steps in the Rover problem. The complete problem specification is on the NSA Cyber Challenge website.
Encoding
Binary data for the keys, plaintext, and ciphertext will be encoded as a string using the “hexlify” method (named for the way Python implements it in the binascii module). The binary $32$-bit unsigned integer represented in hexadecimal as 0xDEADBEEF would simply be converted into an ASCII string “deadbeef” (always use lower-case letters). The most significant bytes come first.
Input
The input will have a key on one line and the plaintext block on the next. The keys are $32$ bytes so they will be represented by $64$ characters. The plaintext blocks are $16$ bytes so they will be represented by $32$ characters. Continue reading the input until you read the word “end” on a line by itself.
Output
Output one line of ciphertext (using the encoding method described above) from your Speck encryption algorithm per key, plaintext pair.
Sample Input 1 | Sample Output 1 |
---|---|
1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100 65736f6874206e49202e72656e6f6f70 000102030405060708090a0b0c0d0e0ff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff 437261636b2054686520436f64652121 end |
4109010405c0f53e4eeeb48d9c188f43 18c9a0533a6579aaf777b7de13c77b24 |