Advertisement
thanhhang54833

Lap_1_quan_li_thong_tin

Nov 20th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.49 KB | None | 0 0
  1. DES is a fairly weak encryption technique that uses 56-bit keys. It uses the same key to encrypt as to decrypt. There is only the private key, which both sender and receiver must know. A personal computer could crack DES-encoded message within a year; a group of them could do it proportionately faster. This is one reason why DES is considered less secure than other encryption methods, and why it has evolved into the Advanced Encryption Standard (AES). The advantage DES has over public key encryption is that it is much faster to compute.
  2.  
  3. Lab Procedure:
  4. First of all:
  5. Organise yourselves into groups of two or three. You will exchange files and keys with the other person(s).
  6. Change the settings on Windows to make file extensions viewable.
  7. Launch Windows Explorer, Tools menu, select Folder Options and then the View tab. Then uncheck Hide extensions for known file types.
  8. This is not essential, but makes it easier to see what’s going on.
  9. Encrypting:
  10. Create a new text file with some plaintext as its body e.g “My name is Mary”. Save this file in the folder you created.
  11. When saving this file select All Types as the “Save as file type” and give your file name the extension “.open” e.g. jbloggsfile.open.
  12. Run CrypTool.
  13. Generate a key. Take a note of this key so that it can be used to decrypt the ciphertext
  14. Browse and select the jbloggsfile.open file that is to be encrypted, and press Encrypt
  15. An jbloggsfile.close file will automatically be generated in the default folder you are working from. View its contents to see what the ciphertext looks like!
  16. Sharing key & encrypted file:
  17. Give your encrypted file (jbloggsfile.close) to the other member(s) of your group, either by email or on a disk.
  18. Write down your (hexadecimal) key and share it with them.
  19.  
  20. Decrypting:
  21. Receive a key and file from each other member(s) of your group. This should have a .close extension.
  22. Try to open their file with Notepad to see if it makes any sense (it shouldn’t!)
  23. Enter their key.
  24. Browse and select the their file, and press Decrypt (this is so that the ciphertext generated from the Encryption part above is put through the same algorithm)
  25. A new file with a .open extension is created in the folder which should have the original plaintext he/she first entered in as its content body in step 3 above.
  26. Exercise Question:
  27. Create a new file, this time with a lot of text (say 1MB in total). Call it bigfile.open. Encrypt it to give bigfile.close. Use WinZip to compress both of them. Which resulting zip file is bigger? Why is this the case?
  28.  
  29. Public Key (Asymmetric) Encryption
  30. Background to RSA
  31. The acronym stands for Rivest, Shamir, and Adleman, the inventors of the technique. RSA is a very powerful encryption algorithm that is based on the public key encryption method. Public key encryption means that you have two pairs of keys, public and private. You give the public key to everyone and keep the private key to yourself. Then, people can encrypt data using the public key and send it to you. Only you can decrypt the message as only you have the private key; the message cannot be decrypted using the public key.
  32. Implementing RSA
  33. Two really big prime numbers are needed on order to implement RSA. Prime numbers are numbers that do not divide into anything else other themselves or 1 e.g. 7, 13, 29, 101. Next, we find the product of the two big prime numbers, so let N = First prime number * Second Prime number. This is one part of the public key. To find the second number we must understand what relatively prime numbers are. Relatively prime numbers are numbers that share no factors at all e.g. 7 and 13 are relatively prime, 15 and 5 are not. Now we have to check whether N and p*q are relatively prime i.e. p = the first prime number – 1 and q = the second prime number – 1. To do this, we have to find a number E in which gcd2(E, p-1*q-1) = 1.
  34. N and E together are the public key pair.
  35. Next, we have to find the private key pair. The private key is such: D = E-1 mod ((p-1)(q -1))
  36. Mod (modulus) is the remainder after division. So, D is the remainder left after E-1 is divided by the product of the first prime number and the second prime number.
  37. D and E are our private key pair
  38. This means that:
  39. (N and E) is the public key pair and (D and E) is our private key pair.
  40. So, to encrypt a letter A, having S as the ciphertext, it would be done like this –
  41. S = AE mod N
  42. To decrypt the alphabet and obtain the original text –
  43. A = SD mod N
  44. Lab Procedure
  45. Run CrypTool.
  46. Generate key pair using RSA (512, 1024, 2018 ...)
  47. Browse the file to be encrypted, then encrypt it.
  48. Experiment with changing the size of the prime number to see the variation in the ciphertext and the difference in the degree of difficulty that would occur when trying to decipher the two.
  49.  
  50. Performance Testing
  51. As you will have seen, encryption and decryption take time, especially on slow computers. In this section, you will benchmark the performance of the applications chosen.
  52.  
  53. Lab Procedure
  54. DES Performance
  55. Create 4 or 5 test files of varying sizes, from a few bytes to about 500KB.
  56. For each file, record how much time it takes to (a) encrypt and (b) decrypt using DES.
  57. Tabulate and graph your results in your report.
  58. On average, how much time can this encryptor process on your machine? Comment.
  59.  
  60. RSA Performance
  61. Run 4 or 5 times, varying the size of the prime numbers used (number of bits) and record how much time it takes.
  62. Tabulate and graph your results in your report.
  63. Comment.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement