Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The rail fence cipher is instead of breaking things into evens and odds as we did in exercise 18, they are broken up by threes,

The rail fence cipher is instead of breaking things into evens and odds as we did in exercise 18, they are broken up by threes, fours or something larger. For instance, in the case of threes, the string secret message would be broken into three groups. The first group is sr sg, the characters at indices 0, 3, 6, 9 and 12. The second group is eemse, the characters at indices 1, 4, 7, 10, and 13. The last group is ctea, the characters at indices 2, 5, 8, and 11. The encrypted message is sr sgeemsectea.

a. Write a program the asks the user for a string and uses the rail fence cipher in the threes case to encrypt the string.

b. Write a decryption program for the threes case.

c. Write a program that asks the user for a string, and an integer determining whether to break things up by threes, fours, or whatever. Encrypt the string using the rail-fence cipher.

d. Write a decryption program for the general case.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

5. Describe the relationship between history and identity.

Answered: 1 week ago