Creates a key. Generates to lists. Creates an area for the key. Randomizes the random system. Loops 265 times doing the following: Creates two different indexs valid for list_one and list_two. Creates a tuple of two different and unique numbers. Deletes the t
()
| 104 | print 'Please enter a different filename.' |
| 105 | |
| 106 | def create_key_data(): |
| 107 | '''Creates a key. |
| 108 | |
| 109 | Generates to lists. |
| 110 | Creates an area for the key. |
| 111 | Randomizes the random system. |
| 112 | Loops 265 times doing the following: |
| 113 | Creates two different indexs valid for list_one and list_two. |
| 114 | Creates a tuple of two different and unique numbers. |
| 115 | Deletes the two number from the two lists. |
| 116 | Returns the key.''' |
| 117 | list_one = range(256) |
| 118 | list_two = range(256) |
| 119 | key = [] |
| 120 | seed(time()) |
| 121 | for index in range(256): |
| 122 | index_one = randint(0, 255 - index) |
| 123 | index_two = randint(0, 255 - index) |
| 124 | key.append((list_one[index_one], list_two[index_two])) |
| 125 | del list_one[index_one], list_two[index_two] |
| 126 | return key |
| 127 | |
| 128 | def encode_file(): |
| 129 | '''Executes decoding subsection. |
no test coverage detected