ahmed sami

ahmed sami

  • NA
  • 64
  • 200.7k

A company wants to transmit data over the telephone

Nov 3 2012 8:57 AM
A company wants to transmit data over the telephone, but they are concerned that their phones may be tapped. All their data are transmitted as four-digit integers. They have asked you to write a program that will encrypt their data so that it may be transmitted more securely. Your application should read a four-digit integer entered by the user in an input dialog 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, and swap the second digit with the fourth. Print the encrypted integer. Write a separate application that inputs an encrypted four-digit integer and decrypts it to form the original number. 

Answers (1)