Question: L05_ Question 12 LOS-12) Create your own encryption function (myEncrypt) which simply calls the transposition2RailEncrypt (we wrote it in class as the scramble2Encrypt function) algorithm
LOS-12) Create your own encryption function (myEncrypt) which simply calls the transposition2RailEncrypt (we wrote it in class as the scramble2Encrypt function) algorithm 3 times, and returns the 3x encrypted string: >>> myEncrypt("Hello Bob!") oge! Blib 1 I def transposition2RailEncrypt (plainText): #2 rail trans. encryption evenChars - oddChara for 1 in range (len (plainText)): if i 8 2 - 0: evenChars - evenChars + plaintext(i) else: oddChara oddChara + plainText[i]. cipherText - oddChars + evenChara return cipherText def trans 2 RailDecrypt (cipherText): halflength Len(cipherText)7/2 oddCharn - cipherText ihal Length evenChars - cipherText(halfLength:) could be > oddChara plainText - for i in range (halfLength: #oz zange (len (oddChars) ) plainText - plaintext + evenCharnfil + oddChara (6) if len (oddChars)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
