Skip to content

Commit

Permalink
Initial age encryption support #49
Browse files Browse the repository at this point in the history
  • Loading branch information
clach04 committed Nov 26, 2024
1 parent 20d69b5 commit 470a330
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions puren_tonbo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,15 @@ def read_from(self, file_object):
return plaintext

def write_to(self, file_object, byte_data):
# TODO catch exceptions and raise PurenTonboException()
# TODO AsciiArmoredInput()
password = self.key
if not isinstance(password, bytes):
password = password.decode("utf-8")

raise NotImplementedError
crypted_bytes = b'TODO'
file_object.write(crypted_bytes)
identities = [age.keys.password.PasswordKey(password)]
with age.file.Encryptor(identities, file_object) as encryptor:
encryptor.write(byte_data)

# TODO AE-2 (no CRC), otherwise the same as AE-1 - see https://github.com/clach04/puren_tonbo/wiki/zip-format
class ZipEncryptedFileBase(EncryptedFile):
Expand Down

0 comments on commit 470a330

Please sign in to comment.