Documents

Amin Maggang CSE5NSW

Description
CSE5NSW Name: AMIN MAGGANG Student id: 17619732 Answer Q1. Figure 1 in the questions The missing step between F and Final Permutation (FP) in Figure 1 of the question is a swap. The swap after last round in encryption process is required in symmetric cipher block such as Feistel cipher structure to prepare an input for decryption process. If there is no swap before FP, the cipher text will be wrong decrypted in decryption process. This happens because both encryption and decryption have the sa
Categories
Published
of 9
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  CSE5NSW Name: AMIN MAGGANG Student id: 17619732 Answer Q1. Figure 1 in the questions The missing step between F and Final Permutation (FP) in Figure 1 of the question is a swap. The swap after last round in encryption process is required in symmetric cipher block such as Feistel cipher structure to prepare an input for decryption process. If there is no swap before FP, the cipher text will be wrong decrypted in decryption process. This happens because both encryption and decryption have the same process. The only different is that the use of sub keys are in different order. It starts from Kn, Kn-1, Kn-2 and so on until the last rounds.  After the last round of encryption process L16 and R16 should be swapped before go to final  permutation so that L16 (in encryption part) will become R16 (in decryption part) and R16 (in encryption part) will become L16 (in decryption part). In the first round of decryption process, R16 (in decryption part) which is L16 (in encryption part) comeback to be L15 (similar as in encryption part) whereas L16 (in decryption part) which is R16 (in encryption part) comeback to be R15 (similar as in encryption part). This will be repeated until obtain the plain text. Answer Q2. R  0  = Half Right Block L 0  = Half Left Block F = function block Pseudocode of DES encryption based on Figure 1 of the question (assume sub keys K have been put into F-function as there is no sub Key in the picture). Answer Q3. Algorithm for IP and FP In initial and final permutation, P-boxes table is used to permute the 64-bit input according to the  predetermined rule and that generate 64-bit at the output as well. Based on the initial and final  permutation steps below we can see that the the bit input 58 th  is switched to 1 th  output of initial  permutation and input bit 1 th is switched to bit 40 th . Encrypt (64 bit plaintext, F-function) { Initial_Permute(64 bit plaintext, initial permutation table) Split (64 bit plaintext to 32-bit R0 and 32-bit L0) For (round = 1 to 16) { Scramble(32 bit of R0, F-function) XOR(32 bit L0, 32 bit combination of R0 and F-function) If (round != 16) swap(L0, R0) } swap(L0, R0) Combine(32-bit R0, 32-bit L0 to be 64 bits) Final_Permute(64 bits combination, final permutation table) } Return (Output 64 bits CipherText)   Figure 2 initial and final permutation steps There are two tables, one for initial permutation and another for final permutation. Both tables  perform reversed process. Basically the values in the table are the output ports. If we have a 64-input bit feeds into initial permutation box, the output will follow the ports number in the p-box table. The following table follows the steps above. Table 1. initial and final permutation table IP Algorithm Input: Plaintext = 64 bits, R = predetermined rules table Algorithm: -   X = R(plaintext), -   applying permutation on plaintext based on the predefined rules input bit 58 th  switch to output bit 1 th , input bit 50 th  switch to output bit 2 nd  and so on.. -   Returning output 64 bits permutation FP Algorithm Input: Plaintext = 64 bits, R  ’  = reversed  predetermined rules table Algorithm: -   X = R  ’ (plaintext), -   applying permutation on plaintext based on the reversed predefined rules input bit 58 th  switch back to output bit 1 th , input bit 50 th  switch back to output bit 2 nd  and so on.. Returning output 64 bits of cipher text  Answer Q4 . Algorithm of F routine in Pseudocode Answer Q5. E-Table: Table 2. E table The E table basically is used to expand the halves 32-bits of RI-1 to 48-bit before performing XOR operation with a 48-bit sub key. The 6 columns of the table is the output port of the expansion box where every 4-bit input that derived from 32-bit input is feed in. the 8 rows are the 8 6-bit output. The table basically performs the expansion permutation from 32 bit input to 48 bit output by mapping all the 4-input bit to 2, 3, 4 and 5 of output bit respectively. Also input bit 4 from previous session is placed to bit 1 output and input bit 1 from the next session goes to output bit 6. Based on the table we can see that there are 48 output ports provided where the 48 bit output will come out. However, there are only 1 to 32 value range as the input. This shows that the expansion  box puts some of the inputs into more than one output. K = 48-bit sub keys F_routine(32 bit left_Block, 48 bit subKey) { XOR(32 bit left Block, 48 bit sub Key, Output Block 48 bits) Split(48 bits outpuBlock, an 8 6-bit chunks, 4 row by 16 column table) For (s-boxes 1 to 8) { Substitute(4 row, 16 column, Output Block 32 bits with 4 bits per  box) } Permute(32 bit s-boxes, fixed Permutation) Return(32 bit fixed permutation) }
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks