Python/ciphers/base32.py

14 lines
343 B
Python
Raw Normal View History

import base64
2019-10-05 05:14:13 +00:00
def main():
2019-10-05 05:14:13 +00:00
inp = input("->")
encoded = inp.encode("utf-8") # encoded the input (we need a bytes like object)
b32encoded = base64.b32encode(encoded) # b32encoded the encoded string
print(b32encoded)
2019-10-05 05:14:13 +00:00
print(base64.b32decode(b32encoded).decode("utf-8")) # decoded it
2019-10-05 05:14:13 +00:00
if __name__ == "__main__":
main()