Substitution Cipher is an old technique that substitutes one thing for another. For example, alphabet
messages can be ciphered by applying the following substitution.
plaintext: abcdefghijklmnopqrstuvwxyz
| |
V V
ciphertext: mnbvcxzasdfghjklpoiuytrewq
However, this type of ciphering produces patterns since the same plaintext strings produce the same
cipher text. Polyalphabetic Cipher, on the other hand mitigates this problem as plaintext characters
are not always replaced with the same cipher text character. The replacement of each character depends
on a key as well as on the position of the character in the text; for example, by using a formula such as:
for (int i=0; i < length of P; i++)
C[i] = P[i] + K + (i mod 3)
In essence, if the key, K, is choses as K=10, then 10 is added to characters in position 0, 3, 6, …; and
11 is added for those in positions 1, 4, 7; and 12 is added for those in 2, 5, 8. Consequently, given
K=1, a string such as THEMTHENTHEY will be encrypted as UJHNVKFPWIGB.
a) Pls write an
technique of Polyalphabetic Cipher, and returns the cipher text for a given plaintext input.
Determine the input and output of your algorithm.
b) Pls write an algorithm as a pseudo code that would implement the decryption
technique of Polyalphabetic Cipher, and returns the plain text for a given cipher text input.
Determine the input and output of your algorithm.
c) What is the time complexity of each of your algorithms, in terms of Big-O? What is the space complexity of each of your algorithms algorithm, in terms of Big-O?
Trending nowThis is a popular solution!
Step by stepSolved in 5 steps
- What will be the ciphered text corresponding to “ALGORITHM” if running key cipher is used for encryption with keyword as “DATASTRUCTURE”? a) LDJOZOBBK b) DLZOJBKBO c) ZOLDJBKBO d) OLZBJDKBOarrow_forwardPublic Key Authority is one such instance. The Public Key Authority must prepare a request for B's public key before delivering a message to A (E(PRauth[PUB || Request || Time 1]). It is debated if the letter A should be used to decipher the message.arrow_forwardSolving this problem in the Java languagearrow_forward
- Please explain in C++arrow_forwardWrite a program that uses a brute force technique to find the longest common substring. Use the Timing class to compare the brute force method with the dynamic programming method.arrow_forwardLab: Caesar Cipher implementation with Python letters='ABCDEFGHIGKLMNOPQRSTUVWXYZ" KEY=3 def caesar_encrypt(plain_text): plain_text=plain_text.upper() for I in plain_text: index = letters.find(1) index= (index + KEY) % len(letters) cipher_text cipher_text + letters[index] return cipher_text cipher_text=" def caesar_decrypt(cipher_text): plain_text = " for I in cipher_text: index = letters.find(1) index= (index - KEY) % len(letters) plain_text=plain_text + letters[index] return plain_text if name == '_____main__': message = 'Welcome to my Cryptography class' encrypted_message = caesar_encrypt(message) print(encrypted_message) print(caesar_decrypt(encrypted_message)) In the previous page, we define letters as 'ABCDEFGHIGKLMNOPQRSTUVWXYZ' to obtain the index of a character in encryption and decryption. The characters in the plain text and the cipher text have to be from ABCDEFGHIGKLMNOPQRSTUVWXYZ'. In this lab, try to modify the code in the previous page to allow your python code to…arrow_forward
- Consider the simple “Caesar” cipher C = (L + 3) mod 26 giving Letter: ABCDEFGHIJKLMNOPQRSTUVWXYZ (0 1 2 24 25) Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC (0 1 2 24 25) Encode the string “HELLO” What is the deciphering formula?arrow_forwardA cryptography student has accidentally used the same keystream to encrypt two different messages, M1M1 and M2M2. We know that the ciphertexts are C1=0x42e8ede51496d10cC1=0x42e8ede51496d10c and C2=0xa5ec5666da7419d0C2=0xa5ec5666da7419d0. We also happen to know that M1=0x713dc2f31c1e6c87M1=0x713dc2f31c1e6c87. a) What is M2M2 in hexadecimal? Please give your answer a leading 0x and use lowercase letters only. b) What is the keystream? Please give your answer a leading 0x and use lowercase letters only. Hint: These are all 8 byte numbers and will fit in an unsigned long type on most systems.arrow_forwarduse python pleasearrow_forward
- A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right. For example, we can shift the bits in the string 1011 two places to the left to produce the string 1110. Note that the leftmost two bits are wrapped around to the right side of the string in this operation. Define two scripts, shiftLeft.py and shiftRight.py, that expect a bit string as an input. • The script shiftLeft shifts the bits in its input one place to the left, wrapping the leftmost bit to the rightmost position. • The script shiftRight performs the inverse operation. • Each script prints the resulting string. An example of shiftLeft.py input and output is shown below: Enter a string of bits: Hello world! ello world!H An example of shiftRight,py input and output is shown below: Enter a string of bits: Hello world! !Hello worldarrow_forwardThe ciphertext AAAAFXGGFAFFGGFGXAFGADGGAXXXFX was encrypted using the ADFGX cipher with the 5×5 matrix in Section 2.6 and the keyword broken. Find plaintext. \begin{tabular}{c|ccccc} &A&D&F&G&X\\ \hlineA&p&g&c&e&n\\D&b&q&o&z&r\\F&s&l&a&f&t\\G&m&d&v&i&w\\X&k&u&y&x&h\end{tabular} Do I need to reorder the columns so that the column labels are in alphabetic order? Please give proper explanation and typed answer only.arrow_forwardDeduce a Java program for the concept of Mutual Exclusion by using the following options. ▪ Synchronized method. ▪ Synchronized block. ▪ Static Synchronizationarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education