Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PROGRAM SHOULD BE IN JAVA 2. Write a program to implement a function f as follows. The inputs of the function are a bitstring B
PROGRAM SHOULD BE IN JAVA
2. Write a program to implement a function f as follows. The inputs of the function are a bitstring B (plaintext) of length 8 and a round key K which is a bitstring of length 12. First. B is expanded into 12 bits according to the following: 1 2 3 4 3 4 5 6 5 6 7 8 For example, 10110101 is expanded to 101111010101.) Then the expanded string is XORed with the round key K. The resulting 12-bit is split into two parts B, and B, 1 such that each part has 6 bits. Finally, B1 passes through S-box S1 and B2 passes through S2 (using a method similar to that in DES). The output off is a 8-bit string obtained from the output of two S-boxes. The S-boxes are as follows. 15 1 8 14 6 11 3 4 9 7 2 13 12 0 10 3 13 4 7 15 2 8 14 12 0 1 10 69 14 7 11 10 13 5 12 8 10 1 15 4 2 11 6 05 Si = 5 11 2 14 4 1 8 6 93 0 13 5 15 9 3 7 12 and 4 S2 = 7 13 14 3 0 6 13 8 11 5 6 15 10 6 90 12 11 3 15 0 6 10 1 9 10 1 2 8 5 11 0 3 4 7 2 12 1 7 13 15 13 14 5 13 8 9 4 5 11 12 12 10 2 7 14 8 2 15 9 4 14 2. Write a program to implement a function f as follows. The inputs of the function are a bitstring B (plaintext) of length 8 and a round key K which is a bitstring of length 12. First. B is expanded into 12 bits according to the following: 1 2 3 4 3 4 5 6 5 6 7 8 For example, 10110101 is expanded to 101111010101.) Then the expanded string is XORed with the round key K. The resulting 12-bit is split into two parts B, and B, 1 such that each part has 6 bits. Finally, B1 passes through S-box S1 and B2 passes through S2 (using a method similar to that in DES). The output off is a 8-bit string obtained from the output of two S-boxes. The S-boxes are as follows. 15 1 8 14 6 11 3 4 9 7 2 13 12 0 10 3 13 4 7 15 2 8 14 12 0 1 10 69 14 7 11 10 13 5 12 8 10 1 15 4 2 11 6 05 Si = 5 11 2 14 4 1 8 6 93 0 13 5 15 9 3 7 12 and 4 S2 = 7 13 14 3 0 6 13 8 11 5 6 15 10 6 90 12 11 3 15 0 6 10 1 9 10 1 2 8 5 11 0 3 4 7 2 12 1 7 13 15 13 14 5 13 8 9 4 5 11 12 12 10 2 7 14 8 2 15 9 4 14Step 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