University of Southern Queensland CSC8419 Assignment 1: Cryptography

Verified

Added on  2022/09/09

|5
|815
|17
Homework Assignment
AI Summary
This document presents solutions to a cryptography assignment focusing on fundamental concepts. The assignment covers three key problems: the conversion of decimal numbers to octal and binary, the creation and execution of a bash script, and the evaluation of a key expansion algorithm. The solution to the first problem demonstrates binary and octal conversions. The second problem involves a provided bash script. The third problem requires the application of the AES key expansion algorithm, including the use of RotWord, SubWord, and XOR operations to derive expanded keys. The solution details the step-by-step calculations and the application of the cipher key and the Rcon values to determine the values of W[4], W[5], W[6] and W[7]. This assignment aims to assess the understanding of cryptography basics and the application of cryptographic algorithms.
Document Page
Problem 1
Below are the steps –
12 – 1100 = 1*8 + 1*4 + 0*2 + 0*1
7 – 0111 = 0*8 + 1*4 + 1*2 + 1*1
2 – 0010 = 0*8 + 0*4 + 1*2 + 0*1
Problem 2
Below is the bash script –
** I have enclosed the bash script file as well.
Problem 3
Given:
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Cipher Key: 2b7e151628aed2a6abf7158809cf4f3c
NK = 4
w[0] = 2b7e1516
w[1] = 28aed2a6
w[2] = abf771588
w[3] = 09cf4f3c
Pseudo Code of Key Expansion Algorithm shown in figure, shows
//The key expansion function that takes cipher key and Nk as input
KeyExpansion (byte key[4*Nk], wordw[Nb* (Nr+1)], Nk)
begin
word temp //The key is assigned to a temporary variable
i = 0
while (i < Nk)
w[i] = word(key[4*i], key[4*i+1], key[4*i+2], key[4*i+3]) // The results w[0], w[1], w[2], w[3] are
obtained
i=i+1
end while
i = Nk
while ( i<Nb * (Nr+1))
temp = w[i-1]
if ( i mod Nk = 0)
temp = SubWord (RotWord (temp) XOR Rcon[i/Nk])
else if (Nk > 6 and i mod Nk = 4)
temp = SubWord (temp)
end if
w[i] = w[i-Nk] XOR temp
Document Page
i = i+1
end while
end
According to above algorithm, W[4] can be evaluated as follow
here, i = 4
temp = w[i-1] = w[3] = 09cf4f3c
After RotWord(), RotWord() transformation has done a shift upwards by 1 on the word, 09 cf 4f 3c, will
change to
cf 4f 3c 09
After SubWord(), SubWord() uses SuBytes transformation using following table
0 1 2 3 4 5 6 7 8 9 a b c d e f
0
6
3
7
c
7
7
7
b
f
2
6
b
6
f
c
5
3
0
0
1
6
7
2
b
f
e
d
7
a
b
7
6
1
c
a
8
2
c
9
7
d
f
a
5
9
4
7
f
0
a
d
d
4
a
2
a
f
9
c
a
4
7
2
c
0
2
b
7
f
d
9
3
2
6
3
6
3
f
f
7
c
c
3
4
a
5
e
5
f
1
7
1
d
8
3
1
1
5
3
0
4
c
7
2
3
c
3
1
8
9
6
0
5
9
a
0
7
1
2
8
0
e
2
e
b
2
7
b
2
7
5
4
0
9
8
3
2
c
1
a
1
b
6
e
5
a
a
0
5
2
3
b
d
6
b
3
2
9
e
3
2
f
8
4
5
5
3
d
1
0
0
e
d
2
0 fc
b
1
5
b
6
a
c
b
b
e
3
9
4
a
4
c
5
8 cf
6
d
0
e
f
a
a
f
b
4
3
4
d
3
3
8
5
4
5
f
9
0
2
7
f
5
0
3
c
9
f
a
8
7
5
1
a
3
4
0
8
f
9
2
9
d
3
8
f
5
b
c
b
6
d
a
2
1
1
0 ff
f
3
d
2
8
c
d
0
c
1
3
e
c
5
f
9
7
4
4
1
7
c
4
a
7
7
e
3
d
6
4
5
d
1
9
7
3
Document Page
9
6
0
8
1
4
f
d
c
2
2
2
a
9
0
8
8
4
6
e
e
b
8
1
4
d
e
5
e
0
b
d
b
a
e
0
3
2
3
a
0
a
4
9
0
6
2
4
5
c
c
2
d
3
a
c
6
2
9
1
9
5
e
4
7
9
b
e
7
e
8
3
7
6
d
8
d
d
5
4
e
a
9
6
c
5
6
f
4
e
a
6
5
7
a
a
e
0
8
c
b
a
7
8
2
5
2
e
1
c
a
6
b
4
c
6
e
8
d
d
7
4
1
f
4
b
b
d
8
b
8
a
d
7
0
3
e
b
5
6
6
4
8
0
3
f
6
0
e
6
1
3
5
5
7
b
9
8
6
c
1
1
d
9
e
e
e
1
f
8
9
8
1
1
6
9
d
9
8
e
9
4
9
b
1
e
8
7
e
9
c
e
5
5
2
8
d
f
f
8
c
a
1
8
9
0
d
b
f
e
6
4
2
6
8
4
1
9
9
2
d
0
f
b
0
5
4
b
b
1
6
The above SubBox can be computed using the following algorithm:
After SubWord(), 8a84eb01,
for Rcon, i=4, 01000000
After XOR with Rcon,
temp = 8a84eb01 01000000 = 8b84eb01
W[0] = 2b7e1516
now, W[4] = temp XOR w[i-Nk] = temp XOR w[0] = a0fafe17
Similarly, W[5], W[6], W[7] can be calculated using Rcon 02000000, 04000000, 08000000,
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
as,
W[5] = 88542cb1
w[6] = 23a33939
w[7] = 2a6c7605
References
As this is a technical calculation assignment, so references are not required.
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]