Merge pull request #2 from TySP-Dev/claude/create-data-directories-1ktvx
Initialise data directories, fix pyrage API, and add .gitignore
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*.pyo
|
||||
*.pyd
|
||||
.Python
|
||||
|
||||
# Virtual environments
|
||||
.venv/
|
||||
venv/
|
||||
env/
|
||||
|
||||
# Data directory (runtime files, not source)
|
||||
data/
|
||||
|
||||
# Distribution / packaging
|
||||
*.egg-info/
|
||||
dist/
|
||||
build/
|
||||
+2
-4
@@ -48,13 +48,11 @@ class ConfigError(Exception):
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def _encrypt(plaintext: str, passphrase: str) -> bytes:
|
||||
identity = pyrage.passphrase.Recipient(passphrase)
|
||||
return pyrage.encrypt(plaintext.encode(), [identity])
|
||||
return pyrage.passphrase.encrypt(plaintext.encode(), passphrase)
|
||||
|
||||
|
||||
def _decrypt(ciphertext: bytes, passphrase: str) -> str:
|
||||
identity = pyrage.passphrase.Identity(passphrase)
|
||||
return pyrage.decrypt(ciphertext, [identity]).decode()
|
||||
return pyrage.passphrase.decrypt(ciphertext, passphrase).decode()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user