Question: Crypto lab assaignmen, please help Lab (DES Cipher) Convert the following pseudocode for DES cipher into a java or python code: Cipher (plainBlock[64], RoundKeys[16, 48],

Crypto lab assaignmen, please help

Lab (DES Cipher)

Convert the following pseudocode for DES cipher into a java or python code:

Cipher (plainBlock[64], RoundKeys[16, 48], cipherBlock[64])

{

permute (64, 64, plainBlock, inBlock, InitialPermutationTable)

split (64, 32, inBlock, leftBlock, rightBlock)

for (round = 1 to 16)

{

mixer (leftBlock, rightBlock, RoundKeys[round])

if (round!=16) swapper (leftBlock, rightBlock)

}

combine (32, 64, leftBlock, rightBlock, outBlock)

permute (64, 64, outBlock, cipherBlock, FinalPermutationTable)

}

mixer (leftBlock[32], rightBlock[32], RoundKey[48])

{

copy (32, rightBlock, T1)

function (T1, RoundKey, T2)

exclusiveOr (32, leftBlock, T2, T3)

copy (32, T3, rightBlock)

}

swapper (leftBlock[32], rigthBlock[32])

{

copy (32, leftBlock, T)

copy (32, rightBlock, leftBlock)

copy (32, T, rightBlock)

}

function (inBlock[32], RoundKey[48], outBlock[32])

{

permute (32, 48, inBlock, T1, ExpansionPermutationTable)

exclusiveOr (48, T1, RoundKey, T2)

substitute (T2, T3, SubstituteTables)

permute (32, 32, T3, outBlock, StraightPermutationTable)

}

substitute (inBlock[32], outBlock[48], SubstitutionTables[8, 4, 16])

{

for (i = 1 to 8)

{

row 2 inBlock[i 6 + 1] + inBlock [i 6 + 6]

col 8 inBlock[i 6 + 2] + 4 inBlock[i 6 + 3] +

2 inBlock[i 6 + 4] + inBlock[i 6 + 5]

value = SubstitutionTables [i][row][col]

outBlock[[i 4 + 1] value / 8; value value mod 8

outBlock[[i 4 + 2] value / 4; value value mod 4

outBlock[[i 4 + 3] value / 2; value value mod 2

outBlock[[i 4 + 4] value

}

}

Convert the following pseudocode for DES round-keys generation into a java or python code:

Key_Generator (keyWithParities[64], RoundKeys[16, 48], ShiftTable[16])

{

permute (64, 56, keyWithParities, cipherKey, ParityDropTable)

split (56, 28, cipherKey, leftKey, rightKey)

for (round = 1 to 16)

{

shiftLeft (leftKey, ShiftTable[round])

shiftLeft (rightKey, ShiftTable[round])

combine (28, 56, leftKey, rightKey, preRoundKey)

permute (56, 48, preRoundKey, RoundKeys[round], KeyCompressionTable)

}

}

shiftLeft (block[28], numOfShifts)

{

for (i = 1 to numOfShifts)

{

T block[1]

for (j = 2 to 28){

block [j1] block [j]

}

block[28] T

}

}

Crypto lab assaignmen, please help Lab (DES Cipher) Convert the following pseudocode

Cryptography Convert the following pseudocode for DES round-keys generation into a java or python Lab (DES Cipher) code: Key_Geneneratar (cexWithtarities [64], Roundkeve[16, 48], Shiftable[16]) Convert the following pseudocode for DES cipher into a java or python code: \}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!