adds key to ROT ex
This commit is contained in:
parent
7a4af42cc1
commit
548c7bba7b
|
@ -1469,6 +1469,12 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
To make things more interesting you can add a decode function.
|
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, ...).
|
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
|
# List comprehension
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue