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:
|
def _encrypt(plaintext: str, passphrase: str) -> bytes:
|
||||||
identity = pyrage.passphrase.Recipient(passphrase)
|
return pyrage.passphrase.encrypt(plaintext.encode(), passphrase)
|
||||||
return pyrage.encrypt(plaintext.encode(), [identity])
|
|
||||||
|
|
||||||
|
|
||||||
def _decrypt(ciphertext: bytes, passphrase: str) -> str:
|
def _decrypt(ciphertext: bytes, passphrase: str) -> str:
|
||||||
identity = pyrage.passphrase.Identity(passphrase)
|
return pyrage.passphrase.decrypt(ciphertext, passphrase).decode()
|
||||||
return pyrage.decrypt(ciphertext, [identity]).decode()
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user