Question: In this exercise, you will apply a much more complex cypher. Ask the user to enter a long value of 16 digits. You will use

In this exercise, you will apply a much more complex cypher. Ask the user to enter a long value of 16 digits. You will use block cypher technique with the addition of Caesar cypher. The block size will be entered by the user and valid values could be 2, 4, 8, or 16. Ask the user to enter k value as well. Here is how the algorithm will work:Example: Block size: 4k value: 5The 16-digit number will be considered in n blocks each of which will consist of 4 digits. In this case, we can have 4 blocks of 4-digit values. If the number is 2395856810034426, then the blocks are: 2395

8568

1003

4426

For each block apply the Caesar cypher with the given k value 5:

2395 -> 7840

8568 -> 3013

1003 -> 6558

4426 -> 9971

Then swap the first half of each block with the second half. For example: 7840 becomes 4078, 3013 becomes 1330, 6558 becomes 5865, and 9971 becomes 7199As a final result, the encrypted integer becomes 4078133058657199.Only if k and block size areknown, it can be decrypted.Apply the same steps for the encrypt.cpp and decrypt.cpp files. This time ask the user to enter a number, a k value and a block size value.

Sample output for encrypt.cpp

Enter a 16-digit integer to encrypt: 2395856810034426Enter a block size (possible values: 2, 4, 8, 16): 4

Enter k value: 5Encrypted number is 4078133058657199.

Sample output for encrypt.cpp

Enter a 16-digit integer to decrypt: 4078133058657199Enter a block size (possible values: 2, 4, 8, 16): 4

Enter k value:

Decrypted number is 2395856810034426.

Its a C++ file!! will leave a like!!! thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!