I have a string that is user input that is sent from one server to another using python. This string is then put through 'sed' to input it into a file.
This input cannot contain all sorts of characters such as:
Use Base64. It converts any data into an ASCII string.
Online encoder/decoder: base64decode.org
This is a string --> VGhpcyBpcyBhIHN0cmluZw== StackOverflow --> U3RhY2tPdmVyZmxvdw== foobar --> Zm9vYmFy
Note that the encoded data will be about 4/3 the size of the original data.
(Base85/Acii85 is the same thing but a little bit more compact)