Question: Write a Python script that will encrypt and decrypt a plaintext message using the Caesar cipher. 2 . The following ciphertext splsoeib Is a permutation
Write a Python script that will encrypt and decrypt a plaintext message using the Caesar
cipher.
The following ciphertext
splsoeib
Is a permutation of a plaintext word.
a Try to guess the word
b Write a Python program that will determine the original plaintext from the ciphertext.
The following code can be used to start the exhaustive search process:
import itertools
from nltkcorpus import words
# Ensure you have the 'words' corpus from nltk
import nltk
nltkdownloadwords
permutedtext 'splsoeib' #the ciphertext
# Load the list of valid English words from nltk corpus
englishwords setwordswords
# Generate all possible permutations of the length of the permutedtext
allpermutations itertools.permutationsrangelenpermutedtext
c What happens to your program if the ciphertext is of length characters? Explain your
observation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
