Cryptography And Applications - Da Vinci Science Center

Transcription

Cryptography andApplicationsHanning Yan7th GradeMoravian Academy Middle School

Why did I choosethis project? https://www.britannica.com/topic/code-talkerI read Code Talker by Chester Nezand Judith Avila About Navajo Code Talkers Helped the U.S. and the Allieswin WWII by encrypting secretmessagesThe Code Book by Simon Singh History of cryptography

So, what iscryptography?By Merriam-Webster:cryptography: noun1.2.3.secret writingthe enciphering and deciphering ofmessages in secret code or cipherthe computerized encoding anddecoding of informationIn simpler terms: the practice and studyof secure and secret communication,especially in the presence of a third party.

The main topic: Cryptography is a big field. Deep, rich history Many ciphers andapplicationsI focused on basic ciphers andtheir applications.Then, I implemented one withJavaScript.

Terminology Plaintext: the message beforeencryptionCiphertext: the message afterencryptionEncryption: the process ofconverting plaintext intociphertextDecryption: taking ciphertext andusing the key to get plaintextKey: something that specifies thetransformation of plaintext intociphertext, and vice versa

ClassicCiphers: There are many classic ciphers.I chose to focus on three: The Shift Cipher The Affine Cipher The Vigenère Cipher

The Shift Cipher Shift ciphers work by shifting eachletter in the plaintext by a specifiedamount of positions, the key beingthe amount.Using a shift key of 3, which isspecified as the Caesar Shift Cipher,hello would be encrypted to KHOOR.

plaintextCIPHERTEXTCaesar Shift

Representation ofAlphabet The letters of the alphabet needmathematical representation. The integers 0-25 are used torepresent the letters a—zrespectively. The arithmetic operations aremodulo, or mod, 26 so that theresults are all letters.

x: a plaintext letter, y: a ciphertext letter, n: the key The encryption is:y e(x) (x n) mod 26 The decryption is:x d(y) (y - n) mod 26 Example: x 7 (h), n 3, y (7 3) mod 26 10 (K)Shift Cipher Formula

The Affine Cipher The Shift Cipher is like a shift. The Affine Cipher is like a linearfunction.

The encryption function is:y e(x) (ax b) mod 26, where (a, b) is the key and a and 26are co-prime. The decryption function is:x d(y) (a -1) (y - b) mod 26,where a -1 is the modular inverse of a. Example: a 3, so a -1 9, since 3 x 9 1 mod 26Affine Cipher Formula

Affine Cipher Example

The VigenèreCipher In the Affine Cipher, all l’s areencrypted to J.Same with the Shift Cipher: all l’s areencrypted to O.This makes these ciphers vulnerableto frequency analysis.In the Vigenère Cipher, mappingdepends on position of the plaintextletter in the message.

The VigenèreCipher: HistoryPhoto in public domain in U.S. Before the Vigenère Cipher, mostciphers were monoalphabetic: theyonly used one alphabet. Blaise de Vigenère was a Frenchdiplomat born in 1523, and he builton the ideas of others to create a newcipher using 27 alphabets and akeyword. The 1st alphabet is referred to as theplain alphabet, and the next 26 arealphabets with shifts of keysincreasing in increments of 1.

Vigenère Cipher Example

Implementation I picked the Shift Cipher, and usedJavaScript, a coding language, toimplement it.

Input: plaintext and keyOutput: ciphertextEX. Input: HELLO, 3Output: KHOOR

Private Key vs.Public Key Ciphers seen above are private key Two communicating parties knowand use one secret key.Private key cryptography:Public key cryptography: Uses two keys, one public and theother private.Public key is made public and usedto encrypt.Private key is known to recipientand used to decrypt.

So, Why PublicKey? You need a secure channel totransmit the private key.This becomes infeasible in manysituations. Sometimes there is no securechannel to transmit keyinformation. Other times, many peoplewant to communicate, and somany keys are hard to keeptrack of.In these instances, public key isused.

RSA: Rivest,Shamir, andAdlemanPhoto from https://www.usc.edu These three men are Ron Rivest,Adi Shamir, and LeonardAdleman. They invented RSA, one of thefirst and most well-knownforms of public keycryptography. RSA works by taking advantageof the immense difficulty offactoring large numbers. The public key, belonging to therecipient, is based on 2 largeprimes. The primes are the secret key.

What I Learned What Should I DoNext?I learned about:1. Different ciphers andapplications2. TerminologyI plan to expand my code toimplement other ciphers.

BibliographyWorks CitedKoblitz, Neal. A Course in Number Theory andCryptography. 2nd ed., New York, Springer-Verlag,2012.Menezes, A. J., et al. Handbook of Applied Cryptography.5th ed., Boca Ratón, CRC Press, 2001.Paterson, Maura B., and Douglas R. Stinson.Cryptography. 4th ed., Boca Raton, CRC Press, 2019.Singh, Simon. The Code Book. New York, Doubleday,1999.Nez, Chester, and Judith Schiess Avila. Code Talker. NewYork, Dutton Caliber, 2018.Stock Images from www.Pexels.com: photos from othersources have captions.

Thank you!Thank you to: My dad, for suggesting the topicand helping me understandconcepts.My advisor Mrs. Daniels: she putup with all my questions and gaveme good advice.

cryptography? By Merriam-Webster: cryptography: noun 1. secret writing 2. the enciphering and deciphering of messages in secret code or cipher 3. the computerized encoding and decoding of information In simpler terms: the practice and study of secure and secret communication, especially in the presence of a third party.