Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago