Generate and return a random encryption key.
()
| 117 | |
| 118 | |
| 119 | def generateRandomKey(): |
| 120 | """Generate and return a random encryption key.""" |
| 121 | key = list(LETTERS) # Get a list from the LETTERS string. |
| 122 | random.shuffle(key) # Randomly shuffle the list. |
| 123 | return ''.join(key) # Get a string from the list. |
| 124 | |
| 125 | |
| 126 | # If this program was run (instead of imported), run the program: |