Write a "" C program "" ... Simple encryption and decryption application will work at a level of alphabets. The program can handle one of two methods ( substitution  or  transposition ) to encrypt or...


Write a "" C program "" ... Simple encryption and decryption application will work at a level of alphabets. The program can handle one of two methods (substitution ortransposition) to encrypt or decrypt a given message (array of chart) as follows:
substitution method:


The message given by the user is encrypted by substitute its characters to another characters based on an encryption dictionary (table) hard-coded in the project. Example of the encryption dictionary is illustrated in table 1.



Encryption Example:
Person 1 enters a message:HELLO
Encryption project will produce:ODIIY
Which could be sent over a communication media to the corresponding receiver Person 2. Person2 should have the same system with the same Encryption Dictionary to decrypt the message and get back the original message.


The decryption is the reverse operation of the encryption. It uses the same encryption dictionary, but starting from the Encryption Code towards the Original to re-build the original message.


2-Transposition Encryption Method: The transposition encryption is based on an encryption key that can be changed by the user or randomly by the program. The encryption key could have different order but with a fixed size (program specific) to encrypt and decrypt messages.
Encryption Example:
Suppose we have a key of 5 digits as ( 3 4 2 1 5 ) to encrypt a word “HELLO”. The key transforms the first letter from the original message to the third position, the second letter from the original message to the fourth position, the third letter from the original message to the second position and so on. Table 2 illustrates the transposition encryption to the message "HELLO" to " LLHEO".


The transposition decryption is the opposite operation to the encryption. It starts by the Encrypted message towards the original message following the path of the arrows in Table 2 we notice the decryption key is ( 4 3 1 2 5).


1- Your work should be constructed in modular way. So the main function will be simple and all the real work should be organized in functions.


2- Your work should show an instruction message explaining the purpose of the program


3- Your work should not stop automatically, it should have an option that allow the user to terminate the program.


4- The user will select what encryption method to use.


5- There should be two options to input a message to your program: a - Allow the user to type his original message and your program will produce the encrypted version (instance typing)


b- Allow the user to specify afilename1 containing the original message. The program will read that file and uses the encryption method selected by the user to encrypt the message. The output will be in another file namedfilename1
_encrypt.


6- The user can select eitherencryption or decryption to the messages!


Due date - 21 april (((a C program please not C++ .))


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here