Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 4: 10 Marks A company wants to transmit data over the telephone, but they are concerned that their phones may be tapped. All of
Question 4: 10 Marks A company wants to transmit data over the telephone, but they are concerned that their phones may be tapped. All of their data are transmitted as four-digit integers. Create a structure that store the transmit data. The structure consists of two strings i.e. "send_from", "Sent_to" and an integer "four-digit integer". They have asked you to write a program that encrypts their data so that it can be transmitted more securely. Your program should consist of a function called 'encryption that take argument, pass by reference a four-digit integer and encrypt it as follows: Replace each digit by (the sum of that digit plus 7) modulus 10. Then, swap the first digit with the third, swap the second digit with the fourth. At last return the encrypted integer to main (). Write another function called 'decryption that takes an encrypted four-digit integer as parameter and decrypts it to form the original number and return the original no to main function. At last print, send_from, sent_to, encrypted and decrypted integer. Note: Use only C_Type string in whole program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started