Skip to content

Instantly share code, notes, and snippets.

@PaburoTC
Last active April 23, 2020 08:37
Show Gist options
  • Save PaburoTC/3acab6ba7a7001a7852f79de274f28ea to your computer and use it in GitHub Desktop.
Save PaburoTC/3acab6ba7a7001a7852f79de274f28ea to your computer and use it in GitHub Desktop.
def decrypt(self, encrypted_text):
encrypted_text = b64decode(encrypted_text)
iv = encrypted_text[:self.block_size]
cipher = AES.new(self.key, AES.MODE_CBC, iv)
plain_text = cipher.decrypt(encrypted_text[self.block_size:]).decode("utf-8")
return self.__unpad(plain_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment