I need help writing 2 programs in C++ that involve reading files and encryption
ID: 3532328 • Letter: I
Question
I need help writing 2 programs in C++ that involve reading files and encryption and decryption. My instructor really didn't go over the chapter in my textbook that covers it and everytime I try to read it I get confused. I have no idea how to set them up.Here are the assignments:
Encrypt directions:
Write a program that will encrypt and decrypt data. All the data is transmitted as 4 digit integers. Your application should read a four digit number entered by the user and encrypts it as follows:
Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the encrypted number.
Decrypt Directions:
Write another program that inputs the 4 digit encrypted number and decrypts (by reversing the encryption scheme) to form the original number.
Replace each digit with the result of adding 3 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the decrypted number.
Thanks in advance!!! I need help writing 2 programs in C++ that involve reading files and encryption and decryption. My instructor really didn't go over the chapter in my textbook that covers it and everytime I try to read it I get confused. I have no idea how to set them up.
Here are the assignments:
Encrypt directions:
Write a program that will encrypt and decrypt data. All the data is transmitted as 4 digit integers. Your application should read a four digit number entered by the user and encrypts it as follows:
Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the encrypted number.
Decrypt Directions:
Write another program that inputs the 4 digit encrypted number and decrypts (by reversing the encryption scheme) to form the original number.
Replace each digit with the result of adding 3 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the decrypted number.
Thanks in advance!!! Write another program that inputs the 4 digit encrypted number and decrypts (by reversing the encryption scheme) to form the original number.
Replace each digit with the result of adding 3 to the digit and getting the remainder after dividing the new value by 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then print the decrypted number.
Thanks in advance!!!
Explanation / Answer
A)