mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-12-18 01:00:15 +00:00
14bcb580d5
* Initial fix for mypy errors in some cipher algorithms * fix(mypy): Update type hints * fix(mypy): Update type hints for enigma_machine2.py * Update as per the suggestion Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com>
14 lines
351 B
Python
14 lines
351 B
Python
import base64
|
|
|
|
|
|
def main() -> None:
|
|
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)
|
|
print(base64.a85decode(a85encoded).decode("utf-8")) # decoded it
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|