Question: This program is to be written in C programming language. Cryptography is the science of making messages secure, of transforming readable messages into unreadable messages
This program is to be written in C programming language. Cryptography is the science of making messages secure, of transforming readable messages into unreadable messages and back again. Messages that are unreadable are called ciphertext. The process of turning plaintext into ciphertext is called encryption. The reverse process of turning ciphertext into plaintext is called decryption. One of the easiest ways to encrypt a message is to scramble the letters. For example the word "apple" could be randomly transformed to "lapep." In fact, there are 120 different possible arrangements of the word "apple." However, if the encryption algorithm randomly scrambles the letters, the task of the decryption algorithm is hard. Encryption and decryption algorithms must work together in some agreed upon way, with the encryption algorithm scrambling letters and the decryption algorithm unscrambling them. A transposition cipher is one way to scramble the letters of a message. The cipher separates the message into two groups of characters: the first group composed of the even-numbered characters and the second group composed of the odd-numbered characters. To produce the ciphertext, the cipher puts together both groups; placing the group of the even-numbered characters first, followed by the group of odd-numbered characters. This encryption results in a string with the characters shuffled to new positions.
Ask the user to enter a string. Write a function that takes the string as a parameter, encrypt the message as described above and return the ciphertext. Then ask the user if he/she wants to continue or not. Finally print all the original messages in alphabetically ascending order.
Example:
Please enter a message: How are ya doing
The encrypted message is: o r adigHwaey on
Do you want to continue(Y/N)? Y
Please enter a message: very well
The encrypted message is: eywlvr el
The original messages in alphabetical order are:
How are ya doing
very well
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
