subject

9.12 LAB: The Caesar cipher In cryptography, Caesar's cipher is one of the simplest and most widely known encryption techniques. The method is named after Julius Caesar, who used it in his private communication. 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. We wish to implement Caesar's encryption scheme by substituting each alphabet in the string with another alphabet that occurs three shifts to its left. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. Note that that the code wraps around in that A would be replaced by X, B would be replaced by Y, and C would be replaced by Z. Write a function called encrypt that takes two input arguments: the plaintext and the number of left shifts to use when constructing the cipher, and returns the encrypted string. For example, if the user enters plaintext = "I CAME I SAW I CONQUERED" and shift = 3, then cipher = encrypt(plaintext, shift) should return F ZXJB F PXT F ZLKNRBOBA as the cipher. Also, note that white spaces in the plaintext occur as themselves in the cipher as well. Finally, your code must work correctly for lower case letters as well as a mix of upper and lower case letters. For example, if plaintext = "I came I saw I conquered" and shift = 3, then cipher = encrypt(plaintext, shift) should return F zxjb F pxt F zlknrboba as the cipher.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
2. fluorine and chlorine molecules are blamed fora trapping the sun's energyob forming acid rainoc producing smogod destroying ozone molecules
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
@josethesolis i need can anyone text me and follow me
Answers: 1
You know the right answer?
9.12 LAB: The Caesar cipher In cryptography, Caesar's cipher is one of the simplest and most widely...
Questions
question
Mathematics, 10.03.2021 09:20
question
Mathematics, 10.03.2021 09:20
question
Mathematics, 10.03.2021 09:20
question
Mathematics, 10.03.2021 09:20
question
Biology, 10.03.2021 09:20
question
Mathematics, 10.03.2021 09:20