CSE 232 Fall 2017 Programming Project 05 This assignment is worth 40 points (4.0
ID: 3589880 • Letter: C
Question
CSE 232 Fall 2017 Programming Project 05 This assignment is worth 40 points (4.0% of the course grade) and must be completed and turned in before11:59pm on Monday, October 16 Tuesday, Oct 3nd in the evenin 2017. That's two weeks because of the midterm on 1281 ANH Caesar cipher The Caesar cipher is named after Julius Cacsar who used this type of encryption to keep his military communications secret There are a couple of ways to think about how this works, but one is the idea of a string rotation. A single left rotation of a string moves all the letters down (to the left) one index, and the letter at the front is moved to the end of the string. A rotation of 3 does this three times. For example: left rotation left rotation left rotation abcdefg bedefga edefgab defgabe A Caesar cipher left rotates the alphabet being used by some number, say a rotation of 3, and aligns the rotated alphabet with the original alphabet. The number of rotations is a fixed number is called the key. The plain-text is your original message; the eipher-text is the encrypted message. We create a rotation of the original alphabet, below a left-3-rotation, and align the letters of the original alphabet and the rotated alphabet Here is the complete mapping for a left rotation of three: Original alphabet: left rotation 3 alphabet: defghijklmnopqrstuvwxyzabo abcdefghijklmnopgrstuvwxyz To encrypt a message simply substitute the plain-text letters with the corresponding rotated letters. For example, here is an encryption using our three-rot cipher (case is ignored and spaces are preserved, not the case for the project!!) of the quick brown fox x jumps over the lazy dog Plaintext: the quick brown fox jumps over the lazy dog Ciphertext: wkh txlfn eurzq ira mxpsv ryhu wkh odbc grj To decrypt the message simply reverse the process. Beaufort and Vigenère cipher It turns out the Cacsar cypher can be cracked pretty casily. Two improved versions of a CacsarExplanation / Answer
1. One other improved method you can use is Vignere Cipher
It uses different shifts for each positions in the message.
For Eg: The first character could be shifted by 10, the next character by 12 positions and this can be made alternate.
Consider the string: NAME
Let the key be [5, 10]
Meaning shift N and M by 5 characters and A and E by 10 characters alphabetically
N,O,P,Q,R,S... So S will be substituted for N and J for A and so on. Hence NAME becomes SJRO.
The key can be longer as well. Reverse the operation to decrypt.
2. Second improved method
To convert alphabets to integers using a length of 26^2 letter alphabet(base 26)
Eg: MY
M alphabet location is 13
And Y location is 25
Hence MY= 13*26+25*1=363
Decrypt:
Divide 363 by 26
Quotient is 13= M
Remainder is 25= Y
Hence letter is MY