Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

9
Computer Security coursework 3 (part 1) Dr Alexei Vernitski

Transcript of Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

Page 1: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

Computer Securitycoursework 3

(part 1)

Dr Alexei Vernitski

Page 2: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

Aims of the coursework

• Learn more about: – Checksums– Luhn checksum as an example of an error

detection algorithm– Birthday attacks

Page 3: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

Assignment (slide 1)

• Implement Luhn checksum in Python. Do not write your own code; find a working code on the web.

• Luhn checksum was not intended to be a cryptographic checksum; this is why it will be a convenient object for us to use as a target of an attack.

Page 4: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

Assignment (slide 2)

• Use a birthday attack to find one even number and one odd number having the same Luhn checksum, as follows– Produce 4 random even numbers in the range between 10

and 99– Produce 4 random odd two-digit numbers in the range

between 10 and 99– Calculate Luhn checksums of these 8 numbers– With a high probability, you will have one even number and

one odd number which have the same checksum. Find these two numbers and print these numbers and their checksum

– If you have not found a checksum match, repeat the experiment

Page 5: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

What to submit?

• Submit a ZIP file containing two files:1. A Python file for Part 1 of Coursework 32. A Python file for Part 2 of Coursework 3 • Please submit one file, and please submit a ZIP

file , it makes opening your assignment easier for me

• Please include your name and registration number as a comment in your Python code, it makes entering marks easier for me

Page 6: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

How shall I mark your code?

• Your code should do the following:– Generate four random even numbers (in the range

between 10 and 99)– Generate four random odd numbers (in the range

between 10 and 99)– Find their Luhn checksums and compare them– Print one pair (or all pairs) of an even number and

an odd number having the same value of Luhn checksum. Also print the value of the checksum.

– You should have a loop in your code to repeat the experiment if a matching pair has not been found.

Page 7: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

Programming

• I attempted the coursework and wrote my solution in Python– My complete code (in addition to the

implementation of Luhn checksum, which I took from the web) contains 9 lines

– It took me approximately 20 minutes to write it– You may need up to 1 hour to complete the

assignment if you need to learn how to generate random numbers in Python, how to work with lists in Python, etc.

Page 8: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

Labs

• Before the submission date of each piece of coursework, we shall have a lab on Monday

• 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

Page 9: Computer Security coursework 3 (part 1) Dr Alexei Vernitski.

No collaboration

• This is an individual assignment• I shall look for signs of collaboration and

plagiarism