Skip to content

C#

Firas Niroukh

Asked Jul 27, 2014, 5:26 AM EDT1 answer
Share
LinkedInX
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.

 please i need just simple solution no complex and irelative ,

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    If I understand the algorithm, you want to swap the first digit with the third, and swap the second digit with the fourth.

    What i dont understand is 
    Replace each digit by (the sum of that digit plus 7) modulus 10?

    @sumitjolly
    0