two_time_pad

two_time_pad - Help with the two-time pad This web page has...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Help with the two-time pad This web page has information about the two-time pad example. To make things somewhat easier for you, we have created a worked example and a decryption program for the two-time pad. In this example, we are given two files, demo1.bin and demo2.bin. Both of these files were encrypted with the one-time pad demo.key. We have provided a C++ program called one-time-pad-vrfy.cc. You may or may not find it useful in doing Problem 2-1 on the homework. This program can be compiled on a Unix computer with this command: % g++ -o one-time-pad-vrfy one-time-pad-vrfy.cc Once you have compiled it, you can run it on both examples: demo1.bin Output (128 bytes): In some situations it is acceptable for the same identifier to be used by different people; other applications require unique id Output in hex: 49 6e 20 73 6f 6d 65 20 73 69 74 75 61 74 69 6f 6e 73 20 69 74 20 69 73 20 61 63 63 65 70 74 61 62 6c 65 20 66 6f 72 20 74 68 65 20 73 61 6d 65 20 69 64 65 6e 74 69 66 69 65 72 20 74 6f 20 62 65 20 75 73 65 64 20 62 79 20 64 69 66 66 65 72 65 6e 74 20 70 65 6f 70 6c 65 3b 20 6f 74 68 65 72 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 72 65 71 75 69 72 65 20 75 6e 69 71 75 65 20 69 64 Many people find octal easier than hex. Here is the output in octal: 111 156 040 163 157 155 145 040 163 151 164 165 141 164 151 157 156 163 040 151 164 040 151 163 040 141 143 143 145 160 164 141 142 154 145 040 146 157 162 040 164 150 145 040 163 141 155 145 040 151 144 145 156 164 151 146 151 145 162 040 164 157 040 142 145 040 165 163 145 144 040 142 171 040 144 151 146 146 145 162 145 156 164 040 160 145 157 160 154 145 073 040 157 164 150 145 162 040 141 160 160 154 151 143 141 164 151 157 156 163 040 162 145 161 165 151 162 145 040 165
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
156 151 161 165 145 040 151 144 Here is how the results were obtained: Bytes 0 . . 9 file demo1.bin 176 124 325 316 253 273 254 275 065 116 ~T. ..... 5N file demo.key 067 072 365 275 304 326 311 235 106 047 7:. ..... F' ================== ======================================== file1 XOR file2 111 156 040 163 157 155 145 040 163 151 In some si Bytes 10 . . 19 file demo1.bin 316 166 054 323 055 165 226 134 104 133 .v,.-u.\D[ file demo.key 272 003 115 247 104 032 370 057 144 062 ..M.D. ./d2 ================== ======================================== file1 XOR file2 164 165 141 164 151 157 156 163 040 151 tuations i Bytes 20 . . 29 file demo1.bin 136 035 107 377 323 320 152 012 121 220 ^.G. ..j.Q. file demo.key
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

two_time_pad - Help with the two-time pad This web page has...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online