Question: Create a class named ShiftRows.java. The code will perform 1 step of the AES ( Advanced Encryption Standard ) round function. Background The Rijndael Algorithm
Create a class named ShiftRows.java. The code will perform step of the AES Advanced
Encryption Standard round function.
Background
The Rijndael Algorithm was selected in as the Advanced Encryption Standard in the United
States See FIPS It won a competition against more than other competing encryption
algorithms.
The algorithm is involved performing several different operations each 'round' iteration to
scramble data. One of the simpler steps in each round is an operation called ShiftRows. The block
being encrypted is bytes long and it is organized in a dimensional xx matrix. Each row has a
'circular shift' performed on it by some number of bytes.
The first row is shifted rotated by bytes it is not shifted at all The second row is shifted by
byte to the left. The third row is shifted by bytes and the fourth is shifted by
As an illustration, if the block contained the following before the operation:
After 'ShiftRows', it would be:
You must write a method to implement the ShiftRows operation. It should take a dimensional
array. It will step through and modify the matrix passed to in place so the calling method will see the
modifications after your shift rows method returns.
Here is the prototype
public static void shiftRowschar block;
Note very carefully the element type of the matrix. Since the algorithm works with a block of
bit bytes at a time, we want to make sure the values in the elements do not exceed Actually, we
would want to use a byte since that type is bits but Java forces it to be signed so the value range is
through not through The next best choice is char which is bits. This leaves the
problem that values passed in may exceed So before doing the shift operations, check each of
the values in the matrix and, if any is less than or greater than print an error message
and exit shiftRows without changing the matrix content. Also, have the shiftRows method
verify the size of the rows and columns is correct. Otherwise, have it print an error and return
without changing the matrix.
In addition to writing this method, write a method that will print out the dimensional block in the
form shown above rows of columns.
Write a main method that passes in at least two test blocks with different values. Print the block
before and after the call to verify that the code did the right thing.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
