Scenario 2 – encode + Python = merry hell
Having covered the basics, now we move onto something a bit more interesting and complicated. String manipulation can be an interesting way to create unique encoding methods. A simple way of doing this is using the string
library to perform simple transforms on the text.
This is not cryptographically secure, but it does teach good decoding skills and can be easily edited to create new substitution ciphers. Please don't ever use this method to make legitimate solutions. This is, by far, one of the worst ways of doing things. It's a prime example of security through obscurity and therefore flawed in every aspect.
Setup
The script that we're going to use is really basic and can be found in the next snippet. It doesn't require any extra downloads or modules, but it is designed to work in Python 2.7 as the maketrans
method has been replaced in 3.x. Don't copy and paste the script from the book. That will result in errors...