Python/ciphers/base85.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)
a85encoded = base64.a85encode(encoded) # a85encoded the encoded string
print(a85encoded)
2019-10-05 05:14:13 +00:00
print(base64.a85decode(a85encoded).decode("utf-8")) # decoded it
2019-10-05 05:14:13 +00:00
if __name__ == "__main__":
main()