A little python script that encodes and decodes a text by replacing spaces with random numbers, applies rot13 to the letters and replace the second of doubled letters with a "+".
Python β₯ 3.0
# Encode a short message
$ ./sepyrot.py --encode "Hello I am a message"
Ury+b2V4nz8n9zrf+ntr
# Decode a short message
$ ./sepyrot.py --decode "Ury+b2V4nz8n9zrf+ntr"
Hello I am a message
# Encode a text file (which works with multiple lines indeed)
$ ./sepyrot.py --encode "$(cat textfile.txt)" > encoded_textfile.txt
# Decode an encoded text file
$ ./sepyrot.py --decode "$(cat encoded_textfile.txt)" > decoded_textfile.txt
- You can also use
-e
and-d
instead of--encode
and--decode
- Special characters make the script crash with Python < 3. With Python 3 they are just not rot13 encoded and stay clear in the encoded message
- Cannot encode/decode messages that include numbers, it'll replace them with spaces in decoded message