Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with this first question (in the first picture ).. Attached in the second, third, and fourth pictures are an example code that I've

Please help with this first question (in the first picture ).. Attached in the second, third, and fourth pictures are an example code that I've learned, id like you to follow it exactly for these questions and use it as a guide. Please only follow the code I've attached with no outside material.

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribed

Question 1 In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence. The encryption step performed by a Caesar cipher is often incorporated as part of more complex schemes, such as the Vigenre cipher, and still has modern application. As with all single alphabet substitution ciphers, the Caesar cipher is easily broken and in modern practice offers essentially no communication security. Generally speaking, it is a great exercise to understand crypto, and for our purposes, it deals with various concepts for learning a new programming language. The Caesar Cipher, the Multiplication Cipher and the Linear Cipher have one property in common. They all fall in the category of Monoalphabetic Ciphers: "Same plain letters are encoded to the same cipher letter." I.e. in the Caesar Cipher each "a" turned into "d", each "b" turned into "e", etc. The following holds true for each of the above Ciphers: Although letters are changed the underlying letter frequencies are not! If the plain letter "a" occurs 10 times its cipher letter will do so 10 times. Therefore, ANY Monoalphabetic Cipher can be broken with the aid of letter frequency analysis. To compute the relative frequencies of each letter in a cipher text simply count the occurrences of the letter in the text. Afterwards compare the letter frequencies with those of the English language (assuming that the cipher text stems from an English plain text). Remember that: a) The most frequent letter of the English language is "e" (with about 12%) followed by tio,an,sr which is very helpful to break the cipher text. b) The longer the cipher text the better do the counted letter frequencies converge to the actual English plain letter frequencies. http://en.wikipedia.org/wiki/Caesar cipher The Problem We received the following ciphertext which was encoded with a shift cipher: xultpaajcxititixaarpjhtiwtexktghidhipxciwtvgtpilpitghlxiwiwtxeqadds 1. Perform an attack against the cipher based on a letter frequency count: How many letters do you have to identify through a frequency count to recover the key? What is the cleartext? 2. Who wrote this message? - Hint: Please print the occurrences of each letter and then the different plaintext outputs based on different keys. Try to do it with the frequencies - it will work in this case. #include #include #include #include #include using namespace std; char *ct = "xultpaajcxitltlxaarpihtiwtgxktghidhipxciwtvgtpilpitghlxiwiwtxgqadds" ; char *ct2 ="lrvmnir bpr sumybwvr jx bpr lmiwv vjeryrkbi jx qmbm wi" "bpr xjvni mkd ymibrut jx irhx wi bpr riirkvr jx" "ymbinlmtmipw utn qmumbr dj w ipmhh but by rhnvwdmbr bor" "Yjeryrkbi jx bpr qmbm mvvjudwko bj yt wkbrusurbmbwjk" "Imird jk xjubt trmui jx ibndt" "wb wi kjb mk rmit bmiq bj rashmwk rmvp vjeryrkb mkd wbi" "iwokwxwvmkvr mkd ijyr ynib urymwk nkrashmwkrd bj ower m" "vjyshrbr rashmkmbwjk jkr cjnhd pmer bj lr fnmhwxwrd mkd" "wkiswurd bj invp mk rabrkb bpmb pr vjnhd urmvp bpr ibmbr" "jx rxhwopbrkrd ywkd vmsmehr jx urvjokwgwko ijnkdhrii" "ijnkd mkd ipmsrhrii ipmsr w dj kjb drry ytirhx bpr xwkmh" "mnbp juwbt Inb yt rasruwrkvr cwbp qmbm pmi hrxb kj djnlb" "bomb bpr xjhhjcwko wi bpr sujsru msshwvmbwjk mkd" "wkbrusurbmbwjk w jxxru yt bprjuwri wk bpr pjsr bpmb bpr" "riirkvr jx jqwkmcmk qmumor Cwhh urymwk wkbmvb": template T**AllocateDynamicArray( int nRows, int nCols) T**dynamicArray; dynamicArray = new T*[nRows); for(int i = 0; i void FreeDynamicArray(T** dArray) delete [] *dArray; delete [] dArray; Forward void mysort(int **arr, int row, int scol){ int templ, temp2; for (int j=0; j(s.length(),s.length()); for (int i=0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

3. Provide two explanations for the effects of mass media

Answered: 1 week ago