Question: 1 Description This assignment is an exercise in the El Gamal and RSA ciphers. 2 Challenge 1 In this challenge you should produce two Sage

1 Description This assignment is an exercise in the El Gamal and RSA ciphers.

2 Challenge 1 In this challenge you should produce two Sage worksheets, one for El Gamal, and one for RSA. In each worksheet, you should use the built-in Sage functions to walk through the important parts of using the corresponding cipher, such as 1. Generating parameters (p,g and gx for El Gamal, n and e for RSA) 2. Encrypting a message 3. Decrypting a message This1 shows the kind of thing I mean (though of course yours can be less wordy). Your work can take the form of a dialog between Alice and Bob. It should be clearly indicated who is doing what. You should also make clear that you know which information is public and which information is secret! Sage functions that will be useful for this assignment include the following: next_prime(), power_mod(), inverse_mod(), randint() and others. Sage has two nice features that make this a little easier: 1. Tab completion 2. Doc dumping I invented that last term. What I mean is, if you type a function up to the rst open parenthesis and then press TAB, Sage will show the documentation for that function, including what kinds of parameters it takes, how many, etc.. If you prefer not to work with plain old integer types, Sage has special types for certain groups. For instance try this: 1http://nbviewer.ipython.org/gist/hujohnson/fe56214c6676ccb3ee92 1 p = next_prime(1000) G = Zmod(p) Enter the cell by pressing SHIFT-ENTER. Then in the next cell, type G. (including the period!) and press TAB (without entering the cell). You will see all of the functions that go along with the group (actually eld) object corresponding to Z/p. Some of these are very useful such as random_element() and multiplicative_generator(). Try entering G.random_element() and see what pops up. If you have a group element (say g) that you want to translate back into a regular integer, you can do it with this command: g = G.random_element() # g is a group element g = ZZ(g) #g is an integer The advantage to using group elements is that they automatically mod themselves, for instance G = Zmod(101) g = G(22) # g is 22 mod p=101 g**10009 # exponentiation produces the output 20 (rather than whatever huge number 2210009 is). As you produce your document(s), you have the option of using a cool markup language called Markdown for your annotations. Its a form of lazy HTML, combined with support for math typesetting. A Sage cell can be either a math cell or a Markdown cell (it can be other things too, actually). To make a markdown cell, you need to enter this at the top of the cell: %md Here2 is a brief but useful tutorial on using Markdown. As an experiment try entering this: %md #Hey ##there $\int x^2\, dx$ 1. I 2. Like 3. _it_ and execute the cell with SHIFT-ENTER. 2http://daringfireball.net/projects/markdown/syntax 2 3 Challenge 2: Openssl RSA In this challenge you will learn to use the openssl implementation of RSA to encrypt messages and sign documents. The rst thing you have to do is generate a key.3 You can generate a key like this: $ openssl genrsa -out private_key.pem 4096 Generating RSA private key, 4096 bit long modulus .............................++++++ ................................................................++++++ e is 65537 (0x10001) This will produce a private key which will look something like the following. -----BEGIN RSA PRIVATE KEY----MIIJKAIBAAKCAgEArtD6BWDi0VHwOfyKMpSgu69eqZK14XfY/yhe3w4fH3gSlMc9 5dhbaoBXS5r0J73+QtUzzmZ2HQCCavS9epf7ulagPo9w8PTXJKAAwET2JRmFD5SA cPBa0d0ruR6MTlS8lV6iNVgv3U0vl/HiWKzRi31/FTn3tKX4AHCNiQvbBEMbenbu lebhq4BPIX9g482jPrwKjpzw+G06GbaWqMPjlULNPeQuAFKV++2e6aDSd6671NRy c+631lWNeLAWPLaiLD5kK18W8g/Jj9j4H6va15ttYwXV/iiE49VaHF9Nl1XgMcLi JPTO1xOtBPD865kwWYVjuooHQr10zxdO1x8nhcHvIrPZASLshwblchDqAEJkZ5V5 Qo8hZto3Bw0hWg++gHKR7oy47VJvKCc76VKIwKesOCOqW9lJOkiu7skRKHgRCkWx wK3HTa55KLK0RwvxOUJrtcu36XnFcwlOqMHSe+nsoCKuE1E5grhX2bfUgOcbr5Ac bUlPm/ofhxc/jhLgdyLOBEmoL7JdxSXvif+CTD/fQh6g3ep4eEUtozdvOiy3Eazj +wWSsGb27HXxoyCvAlGh5dEYSygE0VMiqZ+45uZ+woxSBJ9cZVT8S3Lf/lSkyJA/ M8aVkVwlcYDMQD5EMPDiEZerrvUy+dJCYMmgTM70Jpa1rF/8ZAbliPVfM50CAwEA AQKCAgBlVWOoXHn+BfYvVrExErB9OvGvcAiYEqWpelhMCd6Gmk6DCV9a7WhIOu7f N4oRw3MwgG+QVBphQ1tV7lorRxA2+mHXAcThF7viUhE9YnwgE0PrPRSa4uhyQDdJ DmkcOsg5+Woja+QK7uQIusCO0FaC+hMBVeG9S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wOynaV4szyRKDsd1ydp9lFGCdrlKq3yNW3tjmY36V90GmCGyVcZxF1 IBJse1+A/KTgfZD94rhqYpuNPwJO5eXZ9sFqQZlfsYQOGIzuBddRt6/9k3PXXan+ 6dA/AkSPVJmyMvsrrp9u0uWE89itIBbTTy1UWwsxi3h6VAk53Nop8w2oWA8= -----END RSA PRIVATE KEY---- From the private key you need to generate a public key: openssl rsa -pubout -in private_key.pem -out public_key.pem This produces something like the following: ~/RSAOPENSSL$ cat public_key.pem -----BEGIN PUBLIC KEY----MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEArtD6BWDi0VHwOfyKMpSg u69eqZK14XfY/yhe3w4fH3gSlMc95dhbaoBXS5r0J73+QtUzzmZ2HQCCavS9epf7 ulagPo9w8PTXJKAAwET2JRmFD5SAcPBa0d0ruR6MTlS8lV6iNVgv3U0vl/HiWKzR i31/FTn3tKX4AHCNiQvbBEMbenbulebhq4BPIX9g482jPrwKjpzw+G06GbaWqMPj lULNPeQuAFKV++2e6aDSd6671NRyc+631lWNeLAWPLaiLD5kK18W8g/Jj9j4H6va 15ttYwXV/iiE49VaHF9Nl1XgMcLiJPTO1xOtBPD865kwWYVjuooHQr10zxdO1x8n hcHvIrPZASLshwblchDqAEJkZ5V5Qo8hZto3Bw0hWg++gHKR7oy47VJvKCc76VKI wKesOCOqW9lJOkiu7skRKHgRCkWxwK3HTa55KLK0RwvxOUJrtcu36XnFcwlOqMHS e+nsoCKuE1E5grhX2bfUgOcbr5AcbUlPm/ofhxc/jhLgdyLOBEmoL7JdxSXvif+C TD/fQh6g3ep4eEUtozdvOiy3Eazj+wWSsGb27HXxoyCvAlGh5dEYSygE0VMiqZ+4 5uZ+woxSBJ9cZVT8S3Lf/lSkyJA/M8aVkVwlcYDMQD5EMPDiEZerrvUy+dJCYMmg TM70Jpa1rF/8ZAbliPVfM50CAwEAAQ== -----END PUBLIC KEY---- If you want to know what your actual parameters are (n, p,q, e and d) then you can do this: openssl rsa -text -in private_key.pem This produces something like the following: 4 Private-Key: (4096 bit) modulus: 00:ae:d0:fa:05:60:e2:d1:51:f0:39:fc:8a:32:94: a0:bb:af:5e:a9:92:b5:e1:77:d8:ff:28:5e:df:0e: 1f:1f:78:12:94:c7:3d:e5:d8:5b:6a:80:57:4b:9a: f4:27:bd:fe:42:d5:33:ce:66:76:1d:00:82:6a:f4: bd:7a:97:fb:ba:56:a0:3e:8f:70:f0:f4:d7:24:a0: 00:c0:44:f6:25:19:85:0f:94:80:70:f0:5a:d1:dd: 2b:b9:1e:8c:4e:54:bc:95:5e:a2:35:58:2f:dd:4d: 2f:97:f1:e2:58:ac:d1:8b:7d:7f:15:39:f7:b4:a5: f8:00:70:8d:89:0b:db:04:43:1b:7a:76:ee:95:e6: e1:ab:80:4f:21:7f:60:e3:cd:a3:3e:bc:0a:8e:9c: f0:f8:6d:3a:19:b6:96:a8:c3:e3:95:42:cd:3d:e4: 2e:00:52:95:fb:ed:9e:e9:a0:d2:77:ae:bb:d4:d4: 72:73:ee:b7:d6:55:8d:78:b0:16:3c:b6:a2:2c:3e: 64:2b:5f:16:f2:0f:c9:8f:d8:f8:1f:ab:da:d7:9b: 6d:63:05:d5:fe:28:84:e3:d5:5a:1c:5f:4d:97:55: e0:31:c2:e2:24:f4:ce:d7:13:ad:04:f0:fc:eb:99: 30:59:85:63:ba:8a:07:42:bd:74:cf:17:4e:d7:1f: 27:85:c1:ef:22:b3:d9:01:22:ec:87:06:e5:72:10: ea:00:42:64:67:95:79:42:8f:21:66:da:37:07:0d: 21:5a:0f:be:80:72:91:ee:8c:b8:ed:52:6f:28:27: 3b:e9:52:88:c0:a7:ac:38:23:aa:5b:d9:49:3a:48: ae:ee:c9:11:28:78:11:0a:45:b1:c0:ad:c7:4d:ae: 79:28:b2:b4:47:0b:f1:39:42:6b:b5:cb:b7:e9:79: c5:73:09:4e:a8:c1:d2:7b:e9:ec:a0:22:ae:13:51: 39:82:b8:57:d9:b7:d4:80:e7:1b:af:90:1c:6d:49: 4f:9b:fa:1f:87:17:3f:8e:12:e0:77:22:ce:04:49: a8:2f:b2:5d:c5:25:ef:89:ff:82:4c:3f:df:42:1e: a0:dd:ea:78:78:45:2d:a3:37:6f:3a:2c:b7:11:ac: e3:fb:05:92:b0:66:f6:ec:75:f1:a3:20:af:02:51: a1:e5:d1:18:4b:28:04:d1:53:22:a9:9f:b8:e6:e6: 7e:c2:8c:52:04:9f:5c:65:54:fc:4b:72:df:fe:54: a4:c8:90:3f:33:c6:95:91:5c:25:71:80:cc:40:3e: 44:30:f0:e2:11:97:ab:ae:f5:32:f9:d2:42:60:c9: a0:4c:ce:f4:26:96:b5:ac:5f:fc:64:06:e5:88:f5: 5f:33:9d publicExponent: 65537 (0x10001) privateExponent: 65:55:63:a8:5c:79:fe:05:f6:2f:56:b1:31:12:b0: 7d:3a:f1:af:70:08:98:12:a5:a9:7a:58:4c:09:de: 86:9a:4e:83:09:5f:5a:ed:68:48:3a:ee:df:37:8a: 11:c3:73:30:80:6f:90:54:1a:61:43:5b:55:ee:5a: 2b:47:10:36:fa:61:d7:01:c4:e1:17:bb:e2:52:11: 3d:62:7c:20:13:43:eb:3d:14:9a:e2:e8:72:40:37: 49:0e:69:1c:3a:c8:39:f9:6a:23:6b:e4:0a:ee:e4: 08:ba:c0:8e:d0:56:82:fa:13:01:55:e1:bd:48:7b: 5 92:9d:ab:9d:66:4e:e5:90:94:cc:0f:46:cb:83:d3: 0a:5b:cd:02:c8:d8:7c:14:46:6d:66:08:e4:94:1a: a6:96:82:18:47:9b:db:65:f9:75:1b:0c:e7:b4:6d: e9:e7:f5:62:dc:61:c2:61:63:be:d6:7d:b0:a8:19: 54:14:6b:62:05:a3:84:f2:e5:60:fa:28:d5:66:b1: 1f:e6:f5:e1:08:bf:b8:ef:77:1c:bc:bc:95:40:56: 4f:11:21:f3:3a:bf:95:65:a5:df:4e:6b:26:af:33: cf:04:7d:9c:18:80:11:72:29:57:f4:ed:57:10:2c: 53:a8:1b:a0:14:c4:92:ae:49:98:85:95:40:e3:a1: 3f:54:e1:6d:0b:88:55:1a:29:8a:31:8f:de:a6:93: 4f:c9:51:3d:15:2f:d6:10:70:d6:07:c0:ed:63:1d: c6:62:8d:46:fc:af:d6:4a:cb:31:27:6b:ec:98:60: ae:2a:77:45:1f:af:63:c6:76:6b:7f:e7:b4:a6:df: 16:ba:11:ae:fc:92:36:97:8d:15:b4:f9:ed:0b:4b: cd:25:3d:71:b1:5f:e4:94:bc:c9:45:01:1e:ca:7a: 63:98:a7:dc:f3:7a:cd:4f:47:65:77:bc:e2:42:16: 03:82:58:84:c4:84:36:ef:4c:b2:73:42:72:b9:a4: 15:69:90:78:07:6f:99:fc:e0:08:e8:f8:2c:a4:57: 72:37:da:91:8e:e1:c8:be:d4:4d:6d:40:ed:e9:b4: c3:72:a1:92:98:28:8c:87:f4:e6:af:de:27:38:2b: 94:be:84:96:83:91:b1:b3:cc:75:1b:17:e0:d3:cb: e5:95:7e:9a:de:c8:f6:6f:5c:91:30:e3:ae:f1:8e: 30:bf:08:bb:61:41:cd:b3:4a:87:75:4f:51:64:d7: 5d:87:9e:96:13:e9:71:81:3c:47:d8:3f:7e:6b:62: f6:63:08:90:2e:cb:84:ec:3b:f6:76:40:e9:d3:69: c0:57:31:24:0d:99:24:89:71:e3:3f:ae:0c:e7:76: 77:6d prime1: 00:e1:95:7e:63:0d:24:29:d0:45:de:77:90:cc:e5: 55:14:bd:de:75:de:25:52:2f:c2:bc:2b:9d:72:5b: 2c:4a:f1:4c:74:49:58:37:a1:dc:39:69:a2:fe:98: 0c:7b:24:a8:5a:04:1a:94:f3:ba:ed:a7:50:65:53: f0:43:74:43:7f:9d:f0:d1:25:3c:9e:95:be:54:d4: 97:9f:2c:a4:c1:a7:b5:52:6a:fd:e4:6e:74:5f:07: a6:ea:04:c4:5c:8e:62:db:8e:d3:10:d2:af:fe:61: 37:ca:ed:4f:07:96:5d:d3:e3:0f:76:06:0c:41:fa: aa:15:59:26:49:fe:14:fd:b8:86:b6:19:03:55:89: ed:ee:1d:f0:2b:f9:a0:14:ef:ad:82:f6:a9:3e:ef: 7f:32:e9:9a:1f:5a:38:22:7a:47:0f:4c:96:a0:5d: 15:5c:24:64:8f:85:44:f6:d6:89:af:0d:d5:d6:1e: ed:7b:12:5b:ea:32:c5:c5:bd:48:29:ee:1c:e9:9c: 1a:cc:9f:b7:92:10:5d:ae:9d:63:21:c0:7e:be:fe: fa:c8:75:56:f0:4d:1e:2c:6e:d5:03:c0:24:58:a6: 59:a9:4f:75:32:e4:5d:93:b8:9d:36:88:6a:5c:6c: 56:0b:cc:3b:00:3a:52:04:4b:ff:78:a6:6b:c1:3c: 56:4f prime2: 6 00:c6:63:21:6d:a6:39:05:8b:bd:1c:4f:fc:37:c6: 2b:b0:89:b6:0c:51:ed:e1:f8:8b:90:60:0e:bb:4e: d4:d5:af:3d:21:9f:7a:35:07:c8:97:47:70:5c:5d: 7e:16:12:82:d9:c7:9a:4c:de:09:8d:2e:1f:ba:27: fd:b2:df:e4:20:5e:6e:32:7a:2a:15:23:c2:3f:2c: 84:d4:e5:3f:ec:dd:03:ae:39:14:e3:01:53:a7:e2: 5a:d4:4f:4a:e7:5d:e6:f2:27:2f:52:08:ed:c3:fc: c5:c2:7b:af:39:d7:9d:e1:1e:e9:6f:09:8e:21:7a: c8:69:79:dc:a4:26:cf:bb:ca:f0:43:4b:ed:a8:2d: 9a:a6:35:90:e4:2f:6c:d3:a2:31:12:e4:a7:62:87: 58:88:ee:a6:c5:29:e4:7f:7e:86:47:39:78:05:62: 9a:41:0b:71:d7:2f:bd:85:b5:73:bb:b5:90:dd:9f: a0:a9:64:ed:c8:84:fa:93:3b:57:23:d4:3c:e8:db: 55:bc:77:23:69:bb:55:b6:1f:de:26:2d:9f:f8:5a: 36:58:ab:fa:67:4c:5e:7e:63:e2:a4:79:44:24:4e: 13:4b:98:99:a9:7b:8a:c5:1e:58:78:1f:72:c3:07: f6:15:03:fb:0a:a8:45:d9:1a:12:96:7f:e2:27:a7: 48:53 exponent1: 00:af:47:23:1e:ff:94:fb:d0:52:99:9b:39:ad:9a: fb:d2:d3:fc:c8:84:c5:66:e8:a9:5c:e0:5e:c3:fe: 47:9a:2b:87:86:4b:7e:fa:2b:10:1c:a4:11:fb:d4: 54:ce:52:1b:65:66:0e:e9:71:bf:ea:ec:b8:31:23: 59:6a:70:2a:0a:3c:c4:63:1d:95:ce:7a:f7:9a:9e: 5c:f9:57:0c:e5:53:d4:35:a7:e0:82:df:b8:18:26: af:f0:e1:a7:59:6b:61:30:cb:f6:ff:f9:54:ba:48: fb:ba:f7:4d:12:ce:29:35:7c:16:05:54:89:ad:b2: 80:f9:79:7d:a0:bc:85:be:e6:e3:f5:15:d6:5b:5e: 82:bb:24:13:fb:77:48:85:3b:fe:0b:e6:70:76:f0: 4c:5b:58:db:62:45:0d:9c:ec:79:ce:4f:6a:32:4c: 61:4e:69:10:a1:db:a1:4c:52:42:44:fc:71:0c:a0: 97:51:ab:60:33:c7:23:98:93:8c:40:d8:3d:2a:df: 1a:8b:a8:06:50:bd:da:ac:d4:a9:b4:0e:07:ed:8b: dd:7c:68:80:16:d3:35:00:bd:55:52:46:b7:77:12: 3a:54:ad:e2:98:9a:8c:83:3d:4d:1a:94:40:60:73: e5:1f:e1:9e:6e:7c:e2:41:68:73:a6:61:59:14:9a: 37:4d exponent2: 00:86:10:77:86:a1:cd:e6:f1:87:da:9a:32:d7:7e: 14:08:39:07:cd:4b:90:76:24:80:2c:10:bd:e3:d6: 61:fe:05:6e:4a:4a:7b:4b:5a:f7:33:44:13:aa:57: 83:dd:66:a5:06:86:dc:bf:15:4d:5f:1a:cc:56:00: b0:71:30:db:f9:03:d7:74:45:1a:2b:2e:ff:15:b2: 00:11:de:da:54:37:07:45:b5:4d:68:1a:7d:6d:f6: 89:6a:f0:2a:ae:2f:c6:e1:dd:99:1c:d6:eb:d6:85: fb:1e:72:76:f7:9f:be:11:63:d2:5c:37:18:d5:87: 23:e8:23:71:f7:7c:42:e5:a5:3e:b8:3b:97:5f:0f: 7 72:72:df:c0:0a:74:02:17:02:84:27:40:5d:dd:37: 99:9c:ef:a9:c3:93:8b:d6:9c:aa:21:77:b4:a3:ee: fe:4e:f6:6c:f7:fe:4b:15:10:8a:25:4f:8d:96:37: 49:5b:2f:d9:80:a8:5c:ad:22:6c:c0:c9:ac:5f:af: d9:40:83:42:6b:31:2d:ba:e5:ce:39:fe:9b:1c:39: da:80:11:b8:26:16:75:c4:f3:bb:35:6a:bd:a1:cb: 21:3e:f4:e0:e2:a7:9a:1f:9b:62:2d:cb:12:c2:b9: 9e:92:95:1e:11:15:a6:1e:10:80:7f:33:ec:a0:df: 6b coefficient: 78:60:62:d9:f3:49:d4:a0:7a:48:a4:aa:1e:ef:c2: 6f:58:1f:25:0e:f0:0e:e2:90:da:35:96:e1:2d:c4: 70:1e:26:63:a2:f7:9d:dc:02:4f:f8:a8:1f:cb:b4: cd:41:a6:31:33:25:34:1e:1b:3d:00:34:e3:8e:fe: c2:98:47:cf:5d:dc:4e:11:2b:c5:86:d5:e1:c6:6f: 11:33:b0:cf:56:53:6e:33:67:d7:a7:12:39:41:b5: 2c:3f:a1:e2:6d:7e:37:0d:22:35:8f:0e:49:3f:46: 4c:f3:1d:10:e9:6f:79:76:09:41:49:74:1a:92:50: b8:74:f7:8c:0e:ca:76:95:e2:cc:f2:44:a0:ec:77: 5c:9d:a7:d9:45:18:27:6b:94:aa:b7:c8:d5:b7:b6: 39:98:df:a5:7d:d0:69:82:1b:25:5c:67:11:75:20: 12:6c:7b:5f:80:fc:a4:e0:7d:90:fd:e2:b8:6a:62: 9b:8d:3f:02:4e:e5:e5:d9:f6:c1:6a:41:99:5f:b1: 84:0e:18:8c:ee:05:d7:51:b7:af:fd:93:73:d7:5d: a9:fe:e9:d0:3f:02:44:8f:54:99:b2:32:fb:2b:ae: 9f:6e:d2:e5:84:f3:d8:ad:20:16:d3:4f:2d:54:5b: 0b:31:8b:78:7a:54:09:39:dc:da:29:f3:0d:a8:58: 0f -----BEGIN RSA PRIVATE KEY----MIIJKAIBAAKCAgEArtD6BWDi0VHwOfyKMpSgu69eqZK14XfY/yhe3w4fH3gSlMc9 etc -----END RSA PRIVATE KEY---- You may wonder what exponent1, exponent2 and coefficient are. These are numbers relating to the Chinese Remainder Theorem that speed up the exponentiation in RSA. They are explained on this4 website, where they are the numbers dP, dQ and qInv, respectively. What about encrypting messages? Try this: ~/RSAOPENSSL$ echo "hello world" > hi.txt ~/RSAOPENSSL$ openssl rsautl -encrypt -inkey public_key.pem -pubin -in hi.txt -out hi.crypto Now to decrypt: ~/RSAOPENSSL$ openssl rsautl -decrypt -inkey private_key.pem -in hi.crypto -out decrypted.txt ~/RSAOPENSSL$ diff decrypted.txt hi.txt 4http://www.di-mgt.com.au/crt_rsa.html 8 4 Actual Task Find a friend in the class and exchange public RSA keys over email. Each person should send a message to the other, encrypted using the appropriate public key. Use base64 to send the messages in ASCII as in the Die Hellman assignment. Please leave a transcript of your email exchange named exchange.txt in this folder, along with your Sage worksheets!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!