Question: Cryptography Do not use #include Will like immediately if code works correctly Q2 (20 pts). Write a C++ function named s3Box that accepts an unsigned

Cryptography

Do not use #include

Will like immediately if code works correctly

Cryptography Do not use #include Will like immediately if code works correctly

Q2 (20 pts). Write a C++ function named s3Box that accepts an unsigned char (8 bit) as input and returns an unsigned char (8 bit) using the S3-box of f-function of DES. Here, the input of sbox must be 6-bit and the output must be 4-bit. Therefore, if the parameter is greater than 63, the function should print an error message and return 0 . If the parameter is between 0 and 63 , the function should return a number from 0 to 15 as explained in the slides/textbook by finding the correct row and column in the given S-box: For instance, s3Box(37) should return 13. Note that, the function will return a character. You may need to convert the result to an integer to see numeric output. E.g. cout (int) sinox(37)

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!