





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Cryptography for science olympiad high school or middle school
Typology: Cheat Sheet
1 / 9
This page cannot be seen from the preview
Don't miss anything!






On special offer
Codebusters: Similarly for codebusters, we will not cover Hill cipher or Xenocrypt, and the students should expect questions potentially from Atbash, Caesars, Morse, Vigenere (Morbit/Pollux), Monoalphabetic substitutions (but there will no bonus time question), Railfence, affine and Baconian ciphers.
1. Atbash Cipher: The Atbash Cipher is a variant of the affine cipher (see above) in which both a and b equal 25. This results in the alphabet essentially becoming a mirror (A corresponds to Z, B corresponds to Y, C corresponds to X, etc.). Atbash Cipher Original Alphabet
Ciphertex t Alphabet
Following the affine cipher, the encryption formula would be: �(�)=(25�+25)mod However, observing the mirror like alphabet yields a much simpler equation of: �(�)=�(�)=25−� Since the alphabet is like a mirror, encryption is the same as decryption. Encryption Example Encode "encrypt" with the Atbash Cipher. Plaintext E N C R Y P T Numeric Component
Ciphertext V M X I B K G The cipher text is "vmxibkg."
Decryption Example Decode "zmhdvi" with the Atbash Cipher. Ciphertext Z M H D V I Numeric Component
Plaintext A N S W E R The plaintext is "answer." Efficiency Tip: Replace each given letter with the letter directly above/below it in the Atbash table. The Atbash table should be given on the Reference Sheet.
2. Caesar Cipher:
4. Monoalphabetic substitutions: Monoalphabetic cipher is a substitution cipher in which for a given key, the cipher alphabet for each plain alphabet is fixed throughout the encryption process. For example, if ‘A’ is encrypted as ‘D’, for any number of occurrence in that plaintext, ‘A’ will always get encrypted to ‘D’. 5. Rail fence:
6. Affine: https://scioly.org/wiki/index.php/Codebusters#Affine_Cipher_and_Modular_Arithm etic The Affine cipher uses an alphabet of size � with keys � and � such that �,� are integers, and � and � are coprime (there is no positive divisor for both of them besides 1). Assuming the alphabet is of size 26, � can be 1, 3, 5, 7, 9, 11 ,15, 17, 19, 21, 23 and
The encryption formula for an Affine cipher is: �(�)=(��+�)mod�. In the formula, � is the corresponding number of plaintext. For example, if encrypting N, � would be 13. Essentially, numbers are plugged into the formula and the resulting number corresponds to the encrypted letter. For this example, we encode the message CODEBUSTERS using �=9 and �=42. To slightly speed up the process, use the fact from modular arithmetic that the function ��+� does not change if we also take �,� modulo 26: the function 9 �+42 is equivalent to the function 9 �+16 or 9 �−10. Affine Cipher Encryption Plaintext C O D E B U S T E R S � 2 14 3 4 1 20 18 19 4 17 18 9 �+42 60 168 69 78
(9�+42)mod 6
Ciphertext I M R A Z O W F A N W The encrypted message is IMRAZOWFANW. To decrypt the message given the key, use the decryption formula: �(�)=�−1(�−�)mod In this case, �− 1 is the multiplicative inverse of � modulo � (��−1mod�=1). Because there are only 26 values, one can brute force it to find the value of � where ��mod�=1. � represents �−1. Brute Force Table � 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2
12 �+4�mod26= Subtract the equations. �mod26= Take the mod of the right side. �mod26= Compute the modulus values to see which works. In this case, 8 works. Now, substitute � into the equation and repeat the process. �⋅3+8mod26= �⋅3mod26= �= Alternatively, you can also solve by cancelling out the b's. 4 �+�=2(mod26) 3 �+�=23(mod26) Subtract the two equations and eliminate the b. �=−21(mod26) Now add 26 (or 0 mod 26): �= To solve for b, plug it back into one of the equation: 5⋅4+�=2(mod26) 20+�=2(mod26) �=−18(mod26) �=
7. Baconian: The Baconian cipher replaces each letter of the plaintext with a 5 letter combination of 'A' and 'B'. This replacement is a binary form of encoding, in which 'A' may be considered as 0 and 'B' as 1. One variant of the Baconian Cipher uses a 24 letter alphabet with the letters 'I' and 'J' having the same code, as well as 'U' and 'V'. Baconian Alphabet (24-Letter Variant) L et te r
C a a a a a a a a a a a a a a a a a b b b b b b b b b
o d e a a a a a a a b a a b a a a b b a b a a a b a b a b b a a b b b b a a a b a a a b a a b b a b a b a b b b b a a b b a b b b b a b b b b a a a a a a a b a a b a a a b b a a b b a b a a a b a b a b b a a b b b B in a r y
Another variant of this cipher uses a unique code for each letter (26 letter alphabet). However, in a rule clarification, only the 24 letter variation is to be used on Codebusters tests for the 2019 season. Baconian Alphabet (26-Letter Variant) L et te r
o d e a a a a a a a a a b a a a b a a a a b b a a b a a a a b a b a a b b a a a b b b a b a a a a b a a b a b a b a a b a b b a b b a a a b b a b a b b b a a b b b b b a a a a b a a a b b a a b a b a a b b b a b a a b a b a b b a b b a b a b b b b b a a a b b a a b B in a r y
Standard numbering systems use a base 10 method of counting (ones place, tens place, hundreds place, etc). What this means is that normally for example 24 = (210 + 41). The Baconian Cipher uses a base 2 system. The following is an example of base 2 converted to standard base 10: 01001 (base 2) = (016 + 18 + 04 + 02 + 11) = (18 + 1*1) = 9 (base 10). As seen in the chart above, 01001 corresponds to J, which is the 9th letter in the alphabet (assuming A = 0). When the first variant is shown, the numbering system will be off by 1 from J to U and off by 2 from V to Z. For example, 10100 = W, even though 10100 = 20 (base 10) which corresponds to U on the alphabet chart when A = 0. When solving a question encoded with the Baconian Cipher, it is very likely that they won't explicitly give you "A" and "B" to use to find the corresponding letters. Most of the time, they'll have certain symbols or letters that are meant to represent "A" and "B". One example of this would be using all of of the even letters in the alphabet to represent "A" while all the odd letters represent "B". There are many different variants of this, including symbols on a keyboard and vowel/consonants. To solve a Baconian, try to group the different symbols/letters into two groups based on their properties, and assign one group "A" and the other group "B". If it doesn't work the first time, then switch the groups so that the previous "A" group is now the "B" group. If even then it doesn't seem to be working, then start over again and find a different characteristic to base the groups off of. For this reason, the Baconian Cipher can take longer than some of the other ciphers.