Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
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