From fde422e217d353c623e03cf7fb1a88db8e861e51 Mon Sep 17 00:00:00 2001 From: gerroo Date: Sun, 28 Oct 2018 13:36:51 -0800 Subject: [PATCH] base64 added b64 --- ciphers/base64_cipher.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ciphers/base64_cipher.py diff --git a/ciphers/base64_cipher.py b/ciphers/base64_cipher.py new file mode 100644 index 000000000..975f24d6b --- /dev/null +++ b/ciphers/base64_cipher.py @@ -0,0 +1,11 @@ +import base64 + +def main(): + inp = input('->') + encoded = inp.encode('utf-8') #encoded the input (we need a bytes like object) + b64encoded = base64.b64encode(encoded) #b64encoded the encoded string + print(b64encoded) + print(base64.b64decode(b64encoded).decode('utf-8'))#decoded it + +if __name__ == '__main__': + main()