# Difference between revisions of "153: Cryptography"

 Cryptography Title text: If you got a big keyspace, let me search it.

## Explanation

This comic, as the name implies, is relevant to the study of cryptography. At the podium, Cueball is describing a proposed crypto system (a computer program that turns a very large number, called the "key", and a message into an encrypted form that can only be read by using the same key), based on the model of a Feistel cipher. Part of any Feistel cipher is the "round function", which determines how the key is applied to the original message; this is applied multiple times with a variety of tricks and techniques to insure the process can eventually be reversed. One common component of round functions is the S-box, a simple table that converts input bytes into output bytes, preferably in a way that doesn't correspond to any mathematical rules.

Here, the S-box would be implemented by doing the following (with the computer operation actually shown in the diagrams indicated in parentheses):

1. Take the bitstring down (roll right by 1)
2. Flip it (take its binary NOT)
3. Reverse it (run the bits in the opposite order)

This would be run on each round of the cipher to further scramble the message for the next round. As the caption implies, the steps are based on a line from the Missy Elliott song Work It: "I put my thing down, flip it and reverse it."

The keyspace for a cryptographic algorithm is the number of possible keys the algorithm can possibly accept. For example, AES-256 has a keyspace of 2256 (roughly 1.1579209e+77) possible keys, simply because the algorithm specifies that each key is 256 bits wide. The title text is referring to "searching a keyspace", which is to say, simply trying every key until you find one that works. (For reference, a computer would require roughly the energy of a billion billion supernovas to even count to 2256, let alone actually try each one.) The precise wording "If you got a big keyspace, let me search it" is, of course, another reference to the same song: "If you got a big **** let me search ya." (The **** in the song is apparently the sound of an elephant, but it is heavily implied from context to be "penis".)

## Transcript

[Cueball at a podium]
Cueball: My cryptosystem is like any Feistel cipher, except in the S-Boxes we simply take the bitstring down, flip it, and reverse it.
I've been barred from speaking at any major cryptography conferences ever since it became clear that all my algorithms were just thinly disguised Missy Elliot songs.

# Discussion

I think that executing that S-box twice would get you back where you started. gijobarts (talk) 05:28, 30 July 2013 (UTC)

Actually that's not true. Regardless of the bit in position 1 to begin with, you will always have a 1 in position 8 in the result. When you shift, you're adding a 0 in position 1 (assuming a 0 shift in), then the inverse is 1, and flipping would put the 1 in position 8. Jarod997 (talk) 14:06, 5 March 2014 (UTC)
I was expecting the last bit to wrap around to the front. It could go either way. gijobarts (talk) 05:57, 6 March 2014 (UTC)
I think it would actually take a few rounds, but yes will eventually get back to the same as the input. Remember that you aren't just doing this operation, you are doing it to one half of the block and then XORing with the other half of the block. But yes I think after a few rounds the XOR's would combine to the identity. (assuming that it wraps, which makes sense to me). Also it is not shown at all how the key would be incorporated into this... so maybe that would help? (or you just add a round key in after doing this operation?) 108.162.218.142 16:32, 18 November 2015 (UTC)

" and so is the author Randall Munroe at PyCon"

I think that post is a joke.
• It links to 541: TED Talk.
• It says "Registration volunteers have been instructed to refuse admission to Randall Munroe personally, and in fact, to any stick figures who may attempt to register"
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}