COMP3260 Data Security<br><br>Assignment 2<br><br><br><br><br><br>Note:<br><br>In this assignment, you will implement DES encryption and decryption of a single plaintext block. Your program will take as input a 64-bit plaintext block and a 64-bit key block (note that only 56 bits of those will be selected by PC-1) and produce as output a 64-bit ciphertext block. You will use your implementation to explore the Avalanche effect of the original DES denoted as DES0, as well as DES1, DES2, and DES3, where in each version an operation is missing in each round as follows:<br>0. DES0 – the original version of DES<br>1. DES1 β XOR with a round key is missing from F function in all rounds<br>2. DES2 β S-boxes are missing from F function in all rounds; instead, inverse πΈπΈβ1 of the Expansion Permutation E is used for contraction from 48 bits down to 32 bits<br>3. DES3 β Permutation P is missing from F function in all rounds<br><br>For additional clarity, the encryption algorithm for the four versions of DES is given in the picture bellow.<br><br><br><br>DES0 DES1 DES2 DES3 In addition to the original plaintext block ππ and the key πΎπΎ, your program should use another plaintext blocks ππβ², such that ππβ² differs from ππ only in (any of) one bit and another πΎπΎβ² differs from πΎπΎ only in (any of) one bit, and use them to explore the Avalanche effect in DES as follows.<br><br>The program will encrypt plaintext ππ under key πΎπΎ. Then it will encrypt plaintext ππβ² under key πΎπΎ and it will find the number of different bits after each of the 16 rounds between ππ under πΎπΎ, and ππβ² under πΎπΎ.<br><br>Similarly, your program will encrypt plaintext ππ under key πΎπΎβ² and it will find the number of different bits after each of the 16 rounds between ππ under πΎπΎ, and ππ under πΎπΎβ².<br><br>Your program MUST be well commented, include a header stating the authors and purpose of the program, and be easy to understand. You MUST NOT use any available DES code or a portion of it.<br><br>Encryption<br>INPUT FILE<br>The following is an example of an input file, where<br>β’ the first row is the plaintext ππ<br>β’ the second row is the plaintext ππβ²<br>β’ the third row is key πΎπΎ<br>β’ the last row is key πΎπΎβ²<br>000β¦0<br>010β¦0<br>111β¦0<br>110β¦0<br>OUTPUT FILE<br>The following is a format of an output file (note that the numbers provided are sample values and not necessarily what you will obtain for different inputs):<br>Avalanche Demonstration<br>Plaintext P: 000β¦0<br>Plaintext Pβ: 010β¦0<br>Key K: 111β¦0<br>Key Kβ: 110β¦0<br>Total running time: XXX (second)<br><br>P and Pβ under K<br>Ciphertext C: 010β¦0<br>Ciphertext Cβ: 101β¦1<br>Round DES0 DES1 DES2 DES3<br>0 1 1 1 1<br>1 5 etc<br><br>2 20<br>3 30<br>4 31<br>5 34<br>6 32<br>7 29<br>8 36<br>9 41<br>10 38<br>11 29<br>12 33<br>13 39<br>14 36<br>15 40<br>16 37<br><br>P under K and Kβ<br>Ciphertext C: 110β¦1<br>Ciphertext Cβ: 001β¦0<br>Round DES0 DES1 DES2 DES3<br>0 0 etc<br>1 2<br>2 18<br>3 27<br>4 33<br>5 41<br>6 30<br>7 34<br>8 37<br>9 29<br>10 33<br>11 40<br>12 37<br>13 43<br>14 38<br>15 29<br>16 35<br>In the above, βRound 0β refers to the plain text before the beginning of the encryption. The column DESi contains the number of bits that differ between the original plaintext ππ (resp. the original key K), and the intermediate result in each round of the encryption performed by DESi defined above.<br><br>Decryption<br>For decryption, the INPUT FILE should contain the ciphertext and the key, and the OUTPUT FILE should contain the ciphertext, the key and the plaintext.<br>The following is an example of an input file, where<br>β’ the first row is the ciphertext πΆπΆ<br>β’ the second row is the original key πΎπΎ<br>000β¦0<br>111β¦0<br>The following is a format of an output file (note that the numbers provided are sample values and not necessarily what you will obtain for different inputs):<br>DECRYPTION<br>Ciphertext C: 000β¦0<br>Key K: 111β¦0<br>Plaintext P: 010β¦0<br><br>Program Requirements<br><br>Submission<br>All assignments must be submitted via Canvas. If you submit more than once, then only the latest will be graded. Your submission should be one ZIP file containing:<br>β’ A PDF file that contains outputs of your program<br>β’ All source code files<br>β’ A text README file that contains instructions to execute your code<br><br><br>Assessment criteria<br>1 DES encryption and decryption β working and correct 60<br>2 Avalanche analysis, correct 30<br>3 Comments throughout the program 10<br>TOTAL 100<br>If your DES encryption and decryption are not working correctly you can score at most 40 marks in total.<br>
[SOLVED] COMP3260 Assignment 2
39.99 $
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
Securely Powered by:





