diff --git a/learning_python3.md b/learning_python3.md index a4bbc54..80245b3 100644 --- a/learning_python3.md +++ b/learning_python3.md @@ -1469,6 +1469,12 @@ if __name__ == "__main__": To make things more interesting you can add a decode function. Plus you could add a prompt that asks how big the shift should be (ROT13, ROT16, ...). +You can make the cypher a **lot** harder to break if you use a word (or phrase as a key). +For example, if the key is `abc` and the message is `hello world` the first letter will be offset by a ROT0 (will remain `h`). +The second letter, `e` will be offset by a ROT1 so will become `f`. +The third letter by ROT2 so will become `n`. +Now, the fourth letter will be offset again by `a` so ROT0 and will become `l`. +And so on... # List comprehension