Question: Write a script in octave to decrypt a given word / phrase using Affine Cipher . It is an example of a Monoalphabetic substitution cipher.
Write a script in octave to decrypt a given wordphrase using Affine Cipher It is an example of a Monoalphabetic substitution cipher. The decryption process is done by using the following formula:
P ainv C b mod
where ab are two integers representing the key selected randomly, gcda must be
ainv a mod
C is the ciphertext value, and P is the plaintext value.
C and P integers with values between and
Use the following variable names:
ciphertext for the ciphered text to be decrypted
a where a and are coprime
b any number between to
Your code should display the following:
the plaintext
Requirements:
Max code statements
Hints & tips:
CodeRunner will test your script using different values of ab and ciphertext
Your output may include the variable name you have used CodeRunner will just ignore it
An example showing the expected output CodeRunner formatting for the values specified is given below.
For example:
TestResult
ciphertext 'UZIZWUZWSU'; a ; b ;
Plaintext: STATISTICS
ciphertext 'OHNQRYUJOQH JEMFHQPQWC'; a ; b ;
Plaintext: INFORMATION TECHNOLOGY
ciphertext 'YEAGELRW'; a ; b ;
Plaintext: GEOMETRY
ciphertextNQVRQSD; a ; b ;
No modular inverse Decryption not possible.
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
