Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Security coursework 3 Dr Alexei Vernitski.

Similar presentations


Presentation on theme: "Computer Security coursework 3 Dr Alexei Vernitski."— Presentation transcript:

1 Computer Security coursework 3 Dr Alexei Vernitski

2 Aims of the coursework Learn more about: – Block ciphers and the techniques used in modern ciphers, especially AES – Working with bits, bytes and ASCII codes This is useful not only for understanding computer security, but for any career in information technology

3 A simple cipher based on AES A block is 8 bits (or one byte, or one ASCII character) A key is 8 bits (or one byte)

4 Nibbles

5 Elements of the cipher Bitwise XOR of the block and the key Replacing each nibble in a block by another nibble according to a substitution table (sometimes called an S-box) Swapping the last two nibbles of the block Adding the last two nibbles to the first two nibbles

6 Bitwise XOR This is simply a bitwise XOR of the block and the key

7 S-box When encrypting, substitute the value of each nibble of the block as follows: 0 becomes 1, 1 becomes 3, 2 becomes 0, 3 becomes 2. When decrypting, substitute the value of each nibble of the block in the opposite direction, as follows: 0 becomes 2, 1 becomes 0, 2 becomes 3, 3 becomes 1.

8 Swapping two nibbles

9 Adding nibbles

10 Encryption algorithm Bitwise XOR of the block and the key Use the S-box substitution on each nibble of the block Swap the last two nibbles of the block Add the last two nibbles to the first two Bitwise XOR of the block and the key Use the S-box substitution on each nibble of the block Swap the last two nibbles of the block Bitwise XOR of the block and the key

11 Decryption algorithm Bitwise XOR of the block and the key Swap the last two nibbles of the block Use the S-box substitution on each nibble of the block Bitwise XOR of the block and the key Subtract the last two nibbles from the first two Swap the last two nibbles of the block Use the S-box substitution on each nibble of the block Bitwise XOR of the block and the key

12 A cipher The following list of numbers is a text encrypted with the cipher: [132, 201, 141, 74, 140, 94, 141, 140, 141, 15, 31, 164, 90, 229, 201, 141, 78, 114, 241, 217, 141, 217, 140, 180, 141, 164, 51, 141, 188, 221, 31, 164, 241, 177, 141, 140, 51, 217, 141, 201, 229, 152, 141, 78, 241, 114, 78, 102, 94, 141, 74, 152, 31, 152, 141, 94, 201, 31, 164, 102, 164, 51, 90, 141, 201, 229, 164, 31, 201, 152, 152, 51, 115] The key used for encryption is 84

13 Your task Implement the decryption algorithm in Python and decrypt the cipher on the previous slide.

14 What to submit? Submit just one Python file with your code which decrypts the cipher and outputs the decrypted plaintext.

15 How shall I mark? If your decryption is correct, you get 100%. If not everything is correct, I shall look at your code and allocate some partial marks according to how many parts of the decryption algorithms you have implemented correctly.

16 Programming I attempted the coursework and wrote my solution in Python – My code (for both encryption and decryption) is approximately 70 lines long – It took me approximately 1 hour to write it – You may need up to 3 hours to complete the assignment if you need to learn how to use bitwise operations in Python and how to work with modular arithmetic

17 Labs Before the submission date of each piece of coursework, we shall have a lab on Thursday The purpose of the lab is: – to help you to write your code, in case you have any difficulties – to give you an opportunity to demonstrate your code to me

18 No collaboration This is an individual assignment I shall look for signs of collaboration and plagiarism


Download ppt "Computer Security coursework 3 Dr Alexei Vernitski."

Similar presentations


Ads by Google