# Assignment | Computer Science homework help

## Understanding the History of Encryption

Few facts –

Encryption has been around for a very long time.  Instead of explaining the History of Cryptography, I am going to recommend a very good book by David Khan called “The Code Breakers” , published in 1996.

Instead of starting with early encryption algorithm, I am going to used two interesting encryption algorithms that will capture manu of the concepts that Khan outline in his book. The first algorithm is Character Substitution. Remember, the problem we are trying to solve is “how do we secure communications?”. An example is – Suppose Alice and Bob wants to communicate securely using Eve is an attacker that wants to eavesdrop on the conversation. In order to communicate securely, Alice and Bob are going to share a secret key, which we are going to call K. Eve does not know anything about the key K.

Alice, Bob and even Eve know the algorithm (say character substitution). We all have played the substitution game in School.  A is map to C and B is map to X and C is map to W and so on and so forth. So, if EVE gets the mapping and the ciphered text, she will be able to decipher the secret. Let supposed Eve gets the ciphered text but not the mapping (key). It will be difficult to figure the key out.

Assuming we have 26 letters, how many possibilities are there –> guess?

1. 26

2. 26X26

3. 26! (factorial)

4. 2^26

The answer is 26! which is about 2^88 if I remember correctly, which is a very large sample space. I hope you understand where I got the 26!.  Think of one mapping and now think of another mapping and so on.

What is factorial?  1! = 1, 2! = 1X2 = 2, 3! = 1X2X3 = 6 and so on.

When I said 2^88, it is a good key since it is using 88 bits. Note that I am not saying it is great.

What I want you to do is to think about how you would break a substitution cipher? It is not hard but it needs some imagination.

## Breaking The Substitution Cipher

One way to break a substitution cipher is to use frequency analysis. Let’s focus on the English language for now but the process works the same way for other languages.  The character “e” occurs 12.7% in the Eglish language and the letter “t” occurs 9.35% and the letter “a” is 8.2% of the time.  So, you can count each character in the ciphered text, compute its frequency and start replacing it.  After you complete the first say 4 characters, you may want to change your strategy.  Can you explain why you want to stop after the first 4 characters? The two-character “of” is about 4.16% and “to” is about 2%.  Now try three characters frequency.

After a period of time, you will be able to decipher most of the text.  I am going to ask you to do your first significant homework using frequency analysis.

One possibility for the substitution cipher:

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

V

J

Z

B

G

N

F

E

P

L

I

T

M

X

D

W

K

Q

U

C

R

Y

A

H

S

O

Note that we can have 25 factorial of these possibilities (remember 2^88 – 28-bit key)

Here is your homework – A character sub was used. Can you decipher as much of this text as you can? Submit your results in the drop box below (Frequency Analysis). You may use Python to code the solution.

ztrfqvdjrzqt
rci wzyabi wdmwrzrdrzqt jzacif zw g jzacif rcgr cgw miit zt dwi hqf ygtx cdtvfivw qh xigfw (gt iojibbitr czwrqfx zw lzsit zt wzyqt wztlcw ‘rci jqvi mqqk’). zr mgwzjgbbx jqtwzwrw qh wdmwrzrdrztl isifx abgztrior jcgfgjrif hqf g vzhhifitr jzacifrior jcgfgjrif. zr vzhhifw hfqy rci jgiwgf jzacif zt rcgr rci jzacif gbacgmir zw tqr wzyabx rci gbacgmir wczhriv, zr zw jqyabiribx udymbiv.

rci wzyabi wdmwrzrdrzqt jzacif qhhifw sifx bzrrbi jqyydtzjgrzqt wijdfzrx, gtv zr pzbb mi wcqpt rcgr zr jgt mi igwzbx mfqkit isit mx cgtv, iwaijzgbbx gw rci yiwwgliw mijqyi bqtlif (yqfi rcgt wisifgb cdtvfiv jzacifrior jcgfgjrifw).

## Vignere Cipher

Our follow on topic is Vignere Cipher which is an interesting algorithm developed by French Cryptographer Vignere.  I will post more about the Vignere Cipher tomorrow and ways to hack the Vigenere cipher.

(You will run into different spelling of Vignere)

Vignere Cipher is a primitive Cipher and is not practical for the computing today but it uses an interesting substitution.  There is something called Vignere table:

The Vignere cipher requires a key of fixed length. For our example we are going to use the word CRYPTO. Please do not worry about upper case and lower case.

The clear text we are going to encrypt is:

IT IS A GREAT DAY AT MARYMOUNT

What we do next is to paste the key below the clear text with all spaces removed.

ITISAGREATDAYATMARYMOUNT <————— Clear Text

CRYPTOCRYPTOCRYPTOCRYPT <————– Key

To encrypt the letter “I” in the message, you would look at row “I” and column “C” – the “C” in CRYPTO since they lined up. The result is “K”. Next, we move to the next character, which is a “T” for the row and an column “R”. I will let you complete the rest.

ITISAGREATDAYATMARYMOUNT <————— Clear Text

CRYPTOCRYPTOCRYPTOCRYPT <————– Key

KK                                                     <————– CIPHERED TEXT

Assume you know the length of the key, how would you break this encryption? Think about this question and come up with ideas and we’ll use next week discussion to post your findings

Calculate the price
Pages (550 words)
\$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Australia Assessments
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Music
Fav writer
Customer 454223, June 15th, 2020
Thank you very much! Efficient and professional! I was literally "blocked" since 3 days
Customer 462519, February 3rd, 2022
Good work.
Customer 458115, June 9th, 2022
Entertainment & Gaming
Great work.
Customer 452441, April 29th, 2022
Military
Excellent work.
Customer 456821, November 3rd, 2022
Good work.
Customer 458115, April 27th, 2022
SEO
A job well done
Customer 463679, April 28th, 2023
Automotive
Keep it up
Customer 452441, April 26th, 2022
Great effort.
Customer 452615, May 19th, 2022
Finance/Acc Related
Customer 460073, April 29th, 2022
Education
Great work. Keep it up
Customer 463647, December 22nd, 2022
We crafted. Thanks
Customer 463647, November 29th, 2022
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend