def atbash_decode(self): """Decode Atbash ciper Returns: Chepy: The Chepy oject. Examples: >>> Chepy("hvxivg").atbash_decode().o "SECRET" """ self.state = pycipher.Atbash().decipher(self._convert_to_str(), keep_punct=True) return self
def atbash_encode(self): """Encode with Atbash ciper Returns: Chepy: The Chepy oject. Examples: >>> Chepy("secret").atbash_encode().o "HVXIVG" """ self.state = pycipher.Atbash().encipher(self._convert_to_str(), keep_punct=True) return self
def doatbash(cleartext): print pycipher.Atbash().encipher(cleartext, keep_punct=True)
def atbashDecode(string): try: return pycipher.Atbash().decipher(string) except Exception as e: return f"Exception: {e}"
def atbash(ciphertext): output=pycipher.Atbash().decipher(ciphertext, keep_punct=True) print("Atbash output: " + output ) f=open('atbash.txt', 'w') f.write(output) f.close()