Bootstrap FreeKB - Python (Scripting) - Base64 encoding and decoding
Python (Scripting) - Base64 encoding and decoding

Updated:   |  Python (Scripting) articles

The base64 module can be used for base64 encoding.

#!/usr/bin/python
import base64
print(base64.b64encode("Hello World"))

 

Which should return the following.

SGVsbG8gV29ybGQ=

 

Or for decoding.

#!/usr/bin/python
import base64
print(base64.b64decode("SGVsbG8gV29ybGQ="))

 

Which should return the following.

Hello World



Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 0f15a2 in the box below so that we can be sure you are a human.