Python/ciphers/base64_cipher.py

12 lines
334 B
Python
Raw Normal View History

2018-10-28 21:36:51 +00:00
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()