One popular cryptographic method for encoding a message issubstituting a letter
ID: 3616118 • Letter: O
Question
One popular cryptographic method for encoding a message issubstituting a letter for each letter of the alphabet. For example,the substitution
Plaintextletter - abcdefghijklmnopqrstuvwxyz
Ciphertextletter - HETJWOPSQYAZIVMBDUKNRGLCXF
Turns the plaintext “omnia Gallia est divisa in partiestrees” into the ciphertext “MIVQH PHZZQH WKN QV BHUNWKNUWK”. Note that the substitution is a permutation of the 26letters of the alphabet, so we can uniquely decipher a ciphertextby reading the substitution backwards; that is ciphertext“A” is plaintext “k”, “B” is“p” and so on.
Write a program that takes as an input a plaintext, generates arandom substitution, and then encrypts the plaintext using thatsubstitution. All substitutions should occur with the sameprobability. (in java)
Plaintextletter - abcdefghijklmnopqrstuvwxyz
Ciphertextletter - HETJWOPSQYAZIVMBDUKNRGLCXF