Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add legacy flag.

  • Loading branch information...
commit b6886d1b3ab2226ef02dff3d21166d2e66ef18e8 1 parent 041f3a2
@nvie authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 SimpleAES/__init__.py
View
7 SimpleAES/__init__.py
@@ -83,10 +83,13 @@ def base64_encrypt(self, string):
ciphertext = base64.b64encode(cipherbytes)
return ciphertext
- def base64_decrypt(self, ciphertext):
+ def base64_decrypt(self, ciphertext, legacy=False):
"""Decrypts base64-encoded ciphertext using AES-256."""
cipherbytes = base64.b64decode(ciphertext)
- plaintext = self.decrypt(cipherbytes)
+ if legacy:
+ plaintext = self.decrypt_compat(cipherbytes)
+ else:
+ plaintext = self.decrypt(cipherbytes)
return plaintext
def convert(self, cipherbytes):
Please sign in to comment.
Something went wrong with that request. Please try again.