ROT13 is an easy substitution cryptosystem based on the Caesar cipher but with 13 as the key. This key has the advantage that the encryption function is the same as the decryption function for the Latin alphabet with 26 letters. This also exists for the 10 digits and is called ROT5.
The Caesar cipher is a shift cipher, meaning the letters are shifted by a certain number (the key). For example, with k=1, you encrypt A as B, B as C and so on until Z will be encrypted as A.
The bash command alias allows you to create shorter names for common commands. The structure is: alias "alias_name"="lang_common_command"
tr is the translate command. It allows you to replace or delete characters. It is used in UNIX pipes (find out more see [Bandit Level 6]https://mayadevbe.me/posts/overthewire/bandit/level6/). The structure for replacing characters is the following: tr '"initial_chars"' 'replacement_chars'. For example echo 'A' | tr 'A' 'a' would return a.
The Caesar Cipher is a shift cipher, meaning the letters are shifted by a certain number (the key). For example, with k=1, you encrypt A as B, B as C and so on until Z will be encrypted as A. Calculating the encryption key is easy, when knowing just one letter pair of the message (original) and cipher text (encrypted). Taking the example from above: ‘A’ to ‘B’ is ‘1 -> 2’. The key is just the difference ‘1+x=2’ (as long as it does not wrap around). To calculate the decryption key from the encryption key, you can do the following: amount of characters - encryption_key = decryption_key. So the example would be ‘26-1=25’. Meaning, you need to shift ‘B’ by 25 to get ‘A’ again. (2+25= 27 mod 26 = 1). Here ‘mod’ is revering to the modulo operation that is the remainder of a division. It is needed because the number needs to be between 1 and 26 to be mapped to a letter of the alphabet.
The problem with using one key repeatedly on a block of letters is that there will be a pattern. The more text will be encrypted with the same key the easier it is to find the pattern. Meaning, for different languages we can guess the key based on looking at the character with the biggest amount and assuming it is the character that is used most often in the English language. Quick googling will tell us that is the letter ’e’. This is based on the letter frequency and its entropy. It is used to do Frequency analysis. This is a method to break classical ciphers. Basically, you just count all letters (sometimes also combinations of letters) and based on how often they appear you assign them in order of the most frequent letters of the language.
The task explanation gives a short explanation of what a Vigenère Cipher is. The Caesar cipher is a simplification of the Vigenère Cipher. Instead of one number that is used to encrypt the whole text, the Vigenère Cipher uses a secret key. This key is used to encrypt blocks of the length of the key. It is generally a word, however, for encryption the letters will be exchanged with their position in the alphabet. Therefore if the key would be length one, it would be the Caesar cipher.
The Kasiski examination is an attack on polyalphabetic cipher that makes it possible to guess the key length. The method looks for repeated sequences and their offsets/distances. The greatest common divisor of the offsets would most likely be the key length.
This level introduces the notion of repeating keys as insecure, as Frequency Analysis can be used to quickly determine the key, and we've been using block ciphers. We're now moving on to the world of stream ciphers which are another type of symmetric cipher.
These ciphers create random keys, which are then used to encrypt one character at a time, typically using an XOR function, combining the output with the keystream. In this level, we're introduced to the notion of Linear-Feedback Shift Registers. These take taps off the binary data and XOR them together to get a result. The result of this function is then pushed onto the end of the binary blob, where the digit on the other end is dropped off. Computerphile has a great video that explains it further here.