filanti 1.0.0__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {filanti-1.0.0 → filanti-1.1.0}/PKG-INFO +161 -51
- {filanti-1.0.0 → filanti-1.1.0}/README.md +160 -50
- {filanti-1.0.0 → filanti-1.1.0}/filanti/__init__.py +1 -1
- {filanti-1.0.0 → filanti-1.1.0}/filanti/api/sdk.py +115 -14
- {filanti-1.0.0 → filanti-1.1.0}/filanti/cli/main.py +426 -73
- {filanti-1.0.0 → filanti-1.1.0}/filanti/core/file_manager.py +83 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/core/secrets.py +183 -33
- {filanti-1.0.0 → filanti-1.1.0}/filanti/crypto/asymmetric.py +195 -10
- {filanti-1.0.0 → filanti-1.1.0}/filanti/crypto/decryption.py +0 -1
- {filanti-1.0.0 → filanti-1.1.0}/filanti/crypto/encryption.py +210 -4
- {filanti-1.0.0 → filanti-1.1.0}/filanti/integrity/mac.py +64 -8
- {filanti-1.0.0 → filanti-1.1.0}/pyproject.toml +1 -1
- {filanti-1.0.0 → filanti-1.1.0}/LICENSE +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/__main__.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/api/__init__.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/cli/__init__.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/core/__init__.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/core/errors.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/core/metadata.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/core/plugins.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/core/secure_memory.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/crypto/__init__.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/crypto/kdf.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/crypto/key_management.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/crypto/streaming.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/hashing/__init__.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/hashing/crypto_hash.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/integrity/__init__.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/integrity/checksum.py +0 -0
- {filanti-1.0.0 → filanti-1.1.0}/filanti/integrity/signature.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: filanti
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: A modular, security-focused file framework for encryption, hashing, and integrity verification
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -48,7 +48,7 @@ Description-Content-Type: text/markdown
|
|
|
48
48
|
|
|
49
49
|
## Overview
|
|
50
50
|
|
|
51
|
-
**Filanti** is a
|
|
51
|
+
**Filanti** is a Python framework providing secure-by-default primitives for:
|
|
52
52
|
|
|
53
53
|
- **File Encryption** - AES-256-GCM, ChaCha20-Poly1305 with password-based encryption
|
|
54
54
|
- **Asymmetric Encryption** - Hybrid encryption with X25519, RSA-OAEP for multi-recipient file exchange
|
|
@@ -359,6 +359,15 @@ with SecureString("my-password") as pwd:
|
|
|
359
359
|
|
|
360
360
|
Secure secret injection for automation and CI/CD workflows. Avoid hardcoding passwords in scripts or command lines.
|
|
361
361
|
|
|
362
|
+
**Supported Patterns:**
|
|
363
|
+
|
|
364
|
+
| Pattern | Description | Example |
|
|
365
|
+
|---------|-------------|---------|
|
|
366
|
+
| `ENV:VAR` | Unix-style (original) | `ENV:MY_PASSWORD` |
|
|
367
|
+
| `$env:VAR` | PowerShell-style | `$env:MY_PASSWORD` |
|
|
368
|
+
| `${VAR}` | Shell variable expansion | `${MY_PASSWORD}` |
|
|
369
|
+
| `env.VAR` | Dot notation (cross-platform) | `env.MY_PASSWORD` |
|
|
370
|
+
|
|
362
371
|
```python
|
|
363
372
|
import os
|
|
364
373
|
from filanti.api import Filanti
|
|
@@ -366,12 +375,23 @@ from filanti.api import Filanti
|
|
|
366
375
|
# Set secret in environment (done by CI/CD, Docker, etc.)
|
|
367
376
|
os.environ["ENCRYPT_PASSWORD"] = "my-secure-password"
|
|
368
377
|
|
|
369
|
-
#
|
|
370
|
-
Filanti.encrypt("secret.txt", password="ENV:ENCRYPT_PASSWORD")
|
|
371
|
-
Filanti.
|
|
378
|
+
# All patterns are supported
|
|
379
|
+
Filanti.encrypt("secret.txt", password="ENV:ENCRYPT_PASSWORD") # Unix-style
|
|
380
|
+
Filanti.encrypt("secret.txt", password="$env:ENCRYPT_PASSWORD") # PowerShell
|
|
381
|
+
Filanti.encrypt("secret.txt", password="${ENCRYPT_PASSWORD}") # Shell-style
|
|
382
|
+
Filanti.encrypt("secret.txt", password="env.ENCRYPT_PASSWORD") # Dot notation
|
|
383
|
+
|
|
384
|
+
# Load secrets from .env file
|
|
385
|
+
Filanti.load_dotenv(".env")
|
|
386
|
+
Filanti.encrypt("secret.txt", password="ENV:SECRET_FROM_DOTENV")
|
|
387
|
+
|
|
388
|
+
# Or load during encryption
|
|
389
|
+
Filanti.encrypt("secret.txt", password="ENV:MY_KEY", dotenv_path=".env")
|
|
372
390
|
|
|
373
391
|
# Check if value is an ENV reference
|
|
374
|
-
Filanti.is_env_reference("ENV:MY_SECRET")
|
|
392
|
+
Filanti.is_env_reference("ENV:MY_SECRET") # True
|
|
393
|
+
Filanti.is_env_reference("$env:MY_SECRET") # True
|
|
394
|
+
Filanti.is_env_reference("${MY_SECRET}") # True
|
|
375
395
|
|
|
376
396
|
# Resolve secret manually
|
|
377
397
|
password = Filanti.resolve_secret("ENV:ENCRYPT_PASSWORD")
|
|
@@ -392,11 +412,25 @@ safe = Filanti.safe_json_output(data, secret_keys=["password"])
|
|
|
392
412
|
# Set environment variable
|
|
393
413
|
export ENCRYPT_PASSWORD="my-secure-password"
|
|
394
414
|
|
|
395
|
-
#
|
|
415
|
+
# All pattern formats work in --password
|
|
396
416
|
filanti encrypt secret.txt --password ENV:ENCRYPT_PASSWORD
|
|
397
|
-
filanti
|
|
398
|
-
filanti
|
|
399
|
-
filanti
|
|
417
|
+
filanti encrypt secret.txt --password '$env:ENCRYPT_PASSWORD' # PowerShell
|
|
418
|
+
filanti encrypt secret.txt --password '${ENCRYPT_PASSWORD}' # Shell-style
|
|
419
|
+
filanti encrypt secret.txt --password env.ENCRYPT_PASSWORD # Dot notation
|
|
420
|
+
|
|
421
|
+
# PowerShell-friendly --env option (no special characters)
|
|
422
|
+
filanti encrypt secret.txt --env ENCRYPT_PASSWORD
|
|
423
|
+
filanti decrypt secret.txt.enc --env ENCRYPT_PASSWORD
|
|
424
|
+
|
|
425
|
+
# Load from .env file
|
|
426
|
+
filanti encrypt secret.txt --dotenv .env --env-key MY_PASSWORD
|
|
427
|
+
filanti mac file.txt --dotenv secrets.env --env-key HMAC_KEY
|
|
428
|
+
|
|
429
|
+
# All secret-accepting commands support these options:
|
|
430
|
+
# --password Literal or ENV pattern
|
|
431
|
+
# --env Variable name (PowerShell-friendly)
|
|
432
|
+
# --dotenv Path to .env file
|
|
433
|
+
# --env-key Variable name from .env file
|
|
400
434
|
```
|
|
401
435
|
|
|
402
436
|
**Benefits:**
|
|
@@ -404,6 +438,43 @@ filanti sign document.pdf --key mykey --password ENV:KEY_PASSWORD
|
|
|
404
438
|
- Works with CI/CD (GitHub Actions, GitLab CI, Jenkins)
|
|
405
439
|
- Compatible with Docker/Kubernetes secrets
|
|
406
440
|
- 12-factor app compliance
|
|
441
|
+
- PowerShell-native syntax support
|
|
442
|
+
- Cross-platform .env file loading
|
|
443
|
+
|
|
444
|
+
### Secure File Deletion
|
|
445
|
+
|
|
446
|
+
Delete original files securely after encryption/decryption operations.
|
|
447
|
+
|
|
448
|
+
```python
|
|
449
|
+
from filanti.api import Filanti
|
|
450
|
+
|
|
451
|
+
# Encrypt and securely delete original
|
|
452
|
+
Filanti.encrypt("secret.txt", password="my-pass", remove_source=True)
|
|
453
|
+
# Original file is securely overwritten before deletion
|
|
454
|
+
|
|
455
|
+
# Decrypt and remove encrypted file
|
|
456
|
+
Filanti.decrypt("secret.txt.enc", password="my-pass", remove_source=True)
|
|
457
|
+
# Encrypted file is securely deleted after decryption
|
|
458
|
+
|
|
459
|
+
# Use faster (non-secure) deletion
|
|
460
|
+
Filanti.encrypt("secret.txt", password="my-pass",
|
|
461
|
+
remove_source=True, secure_delete=False)
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
**CLI Support:**
|
|
465
|
+
|
|
466
|
+
```bash
|
|
467
|
+
# Encrypt and securely delete original
|
|
468
|
+
filanti encrypt secret.txt --password mypass --remove-source
|
|
469
|
+
|
|
470
|
+
# Decrypt and remove encrypted file
|
|
471
|
+
filanti decrypt secret.txt.enc --password mypass --remove-source
|
|
472
|
+
|
|
473
|
+
# Use faster (non-secure) deletion
|
|
474
|
+
filanti encrypt secret.txt --password mypass --remove-source --no-secure-delete
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
> ⚠️ **Note:** Secure deletion provides defense-in-depth but has limitations on SSDs with wear-leveling, journaling filesystems, and cloud-synced folders. For maximum security, use full-disk encryption.
|
|
407
478
|
|
|
408
479
|
### Asymmetric / Hybrid Encryption
|
|
409
480
|
|
|
@@ -834,40 +905,72 @@ safe_output = redact_secret("Password is secret123", "secret123")
|
|
|
834
905
|
|
|
835
906
|
---
|
|
836
907
|
|
|
837
|
-
## Architecture
|
|
908
|
+
[//]: # (## Architecture)
|
|
838
909
|
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
│ ├──
|
|
847
|
-
|
|
848
|
-
│
|
|
849
|
-
|
|
850
|
-
│ ├──
|
|
851
|
-
|
|
852
|
-
│ ├──
|
|
853
|
-
|
|
854
|
-
│ ├──
|
|
855
|
-
|
|
856
|
-
│
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
├──
|
|
861
|
-
|
|
862
|
-
│ ├──
|
|
863
|
-
|
|
864
|
-
│
|
|
865
|
-
|
|
866
|
-
│
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
910
|
+
[//]: # ()
|
|
911
|
+
[//]: # (```)
|
|
912
|
+
|
|
913
|
+
[//]: # (filanti/)
|
|
914
|
+
|
|
915
|
+
[//]: # (├── core/ )
|
|
916
|
+
|
|
917
|
+
[//]: # (│ ├── errors.py )
|
|
918
|
+
|
|
919
|
+
[//]: # (│ ├── file_manager.py )
|
|
920
|
+
|
|
921
|
+
[//]: # (│ ├── metadata.py )
|
|
922
|
+
|
|
923
|
+
[//]: # (│ ├── plugins.py )
|
|
924
|
+
|
|
925
|
+
[//]: # (│ ├── secrets.py )
|
|
926
|
+
|
|
927
|
+
[//]: # (│ └── secure_memory.py )
|
|
928
|
+
|
|
929
|
+
[//]: # (│)
|
|
930
|
+
|
|
931
|
+
[//]: # (├── crypto/ )
|
|
932
|
+
|
|
933
|
+
[//]: # (│ ├── encryption.py )
|
|
934
|
+
|
|
935
|
+
[//]: # (│ ├── decryption.py )
|
|
936
|
+
|
|
937
|
+
[//]: # (│ ├── key_management.py )
|
|
938
|
+
|
|
939
|
+
[//]: # (│ ├── kdf.py )
|
|
940
|
+
|
|
941
|
+
[//]: # (│ ├── streaming.py )
|
|
942
|
+
|
|
943
|
+
[//]: # (│ └── asymmetric.py )
|
|
944
|
+
|
|
945
|
+
[//]: # (│)
|
|
946
|
+
|
|
947
|
+
[//]: # (├── hashing/ )
|
|
948
|
+
|
|
949
|
+
[//]: # (│ └── crypto_hash.py )
|
|
950
|
+
|
|
951
|
+
[//]: # (│)
|
|
952
|
+
|
|
953
|
+
[//]: # (├── integrity/ )
|
|
954
|
+
|
|
955
|
+
[//]: # (│ ├── checksum.py )
|
|
956
|
+
|
|
957
|
+
[//]: # (│ ├── mac.py )
|
|
958
|
+
|
|
959
|
+
[//]: # (│ └── signature.py )
|
|
960
|
+
|
|
961
|
+
[//]: # (│)
|
|
962
|
+
|
|
963
|
+
[//]: # (├── cli/ )
|
|
964
|
+
|
|
965
|
+
[//]: # (│ └── main.py )
|
|
966
|
+
|
|
967
|
+
[//]: # (│)
|
|
968
|
+
|
|
969
|
+
[//]: # (└── api/ )
|
|
970
|
+
|
|
971
|
+
[//]: # ( └── sdk.py )
|
|
972
|
+
|
|
973
|
+
[//]: # (```)
|
|
871
974
|
|
|
872
975
|
### Module Dependencies
|
|
873
976
|
|
|
@@ -1128,7 +1231,8 @@ encrypt_stream_file(input_path, output_path, key, chunk_size=16*1024) # 16 KB
|
|
|
1128
1231
|
|
|
1129
1232
|
---
|
|
1130
1233
|
|
|
1131
|
-
##
|
|
1234
|
+
## Contributors || Acknowledgements
|
|
1235
|
+
[@stephenlb](https://github.com/stephenlb) Thanks for the inspiration and guidance on encryption and security best practices.
|
|
1132
1236
|
|
|
1133
1237
|
### Development Setup
|
|
1134
1238
|
|
|
@@ -1159,15 +1263,21 @@ pip install -e ".[dev]"
|
|
|
1159
1263
|
|
|
1160
1264
|
[//]: # (```)
|
|
1161
1265
|
|
|
1162
|
-
### Pull Request Guidelines
|
|
1266
|
+
[//]: # (### Pull Request Guidelines)
|
|
1163
1267
|
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
3. Follow existing code style
|
|
1167
|
-
4. Add type hints
|
|
1168
|
-
5. Run full test suite before submitting
|
|
1268
|
+
[//]: # ()
|
|
1269
|
+
[//]: # (1. Write tests for new features)
|
|
1169
1270
|
|
|
1170
|
-
|
|
1271
|
+
[//]: # (2. Update documentation)
|
|
1272
|
+
|
|
1273
|
+
[//]: # (3. Follow existing code style)
|
|
1274
|
+
|
|
1275
|
+
[//]: # (4. Add type hints)
|
|
1276
|
+
|
|
1277
|
+
[//]: # (5. Run full test suite before submitting)
|
|
1278
|
+
|
|
1279
|
+
[//]: # ()
|
|
1280
|
+
[//]: # (---)
|
|
1171
1281
|
|
|
1172
1282
|
## Changelog
|
|
1173
1283
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
## Overview
|
|
20
20
|
|
|
21
|
-
**Filanti** is a
|
|
21
|
+
**Filanti** is a Python framework providing secure-by-default primitives for:
|
|
22
22
|
|
|
23
23
|
- **File Encryption** - AES-256-GCM, ChaCha20-Poly1305 with password-based encryption
|
|
24
24
|
- **Asymmetric Encryption** - Hybrid encryption with X25519, RSA-OAEP for multi-recipient file exchange
|
|
@@ -329,6 +329,15 @@ with SecureString("my-password") as pwd:
|
|
|
329
329
|
|
|
330
330
|
Secure secret injection for automation and CI/CD workflows. Avoid hardcoding passwords in scripts or command lines.
|
|
331
331
|
|
|
332
|
+
**Supported Patterns:**
|
|
333
|
+
|
|
334
|
+
| Pattern | Description | Example |
|
|
335
|
+
|---------|-------------|---------|
|
|
336
|
+
| `ENV:VAR` | Unix-style (original) | `ENV:MY_PASSWORD` |
|
|
337
|
+
| `$env:VAR` | PowerShell-style | `$env:MY_PASSWORD` |
|
|
338
|
+
| `${VAR}` | Shell variable expansion | `${MY_PASSWORD}` |
|
|
339
|
+
| `env.VAR` | Dot notation (cross-platform) | `env.MY_PASSWORD` |
|
|
340
|
+
|
|
332
341
|
```python
|
|
333
342
|
import os
|
|
334
343
|
from filanti.api import Filanti
|
|
@@ -336,12 +345,23 @@ from filanti.api import Filanti
|
|
|
336
345
|
# Set secret in environment (done by CI/CD, Docker, etc.)
|
|
337
346
|
os.environ["ENCRYPT_PASSWORD"] = "my-secure-password"
|
|
338
347
|
|
|
339
|
-
#
|
|
340
|
-
Filanti.encrypt("secret.txt", password="ENV:ENCRYPT_PASSWORD")
|
|
341
|
-
Filanti.
|
|
348
|
+
# All patterns are supported
|
|
349
|
+
Filanti.encrypt("secret.txt", password="ENV:ENCRYPT_PASSWORD") # Unix-style
|
|
350
|
+
Filanti.encrypt("secret.txt", password="$env:ENCRYPT_PASSWORD") # PowerShell
|
|
351
|
+
Filanti.encrypt("secret.txt", password="${ENCRYPT_PASSWORD}") # Shell-style
|
|
352
|
+
Filanti.encrypt("secret.txt", password="env.ENCRYPT_PASSWORD") # Dot notation
|
|
353
|
+
|
|
354
|
+
# Load secrets from .env file
|
|
355
|
+
Filanti.load_dotenv(".env")
|
|
356
|
+
Filanti.encrypt("secret.txt", password="ENV:SECRET_FROM_DOTENV")
|
|
357
|
+
|
|
358
|
+
# Or load during encryption
|
|
359
|
+
Filanti.encrypt("secret.txt", password="ENV:MY_KEY", dotenv_path=".env")
|
|
342
360
|
|
|
343
361
|
# Check if value is an ENV reference
|
|
344
|
-
Filanti.is_env_reference("ENV:MY_SECRET")
|
|
362
|
+
Filanti.is_env_reference("ENV:MY_SECRET") # True
|
|
363
|
+
Filanti.is_env_reference("$env:MY_SECRET") # True
|
|
364
|
+
Filanti.is_env_reference("${MY_SECRET}") # True
|
|
345
365
|
|
|
346
366
|
# Resolve secret manually
|
|
347
367
|
password = Filanti.resolve_secret("ENV:ENCRYPT_PASSWORD")
|
|
@@ -362,11 +382,25 @@ safe = Filanti.safe_json_output(data, secret_keys=["password"])
|
|
|
362
382
|
# Set environment variable
|
|
363
383
|
export ENCRYPT_PASSWORD="my-secure-password"
|
|
364
384
|
|
|
365
|
-
#
|
|
385
|
+
# All pattern formats work in --password
|
|
366
386
|
filanti encrypt secret.txt --password ENV:ENCRYPT_PASSWORD
|
|
367
|
-
filanti
|
|
368
|
-
filanti
|
|
369
|
-
filanti
|
|
387
|
+
filanti encrypt secret.txt --password '$env:ENCRYPT_PASSWORD' # PowerShell
|
|
388
|
+
filanti encrypt secret.txt --password '${ENCRYPT_PASSWORD}' # Shell-style
|
|
389
|
+
filanti encrypt secret.txt --password env.ENCRYPT_PASSWORD # Dot notation
|
|
390
|
+
|
|
391
|
+
# PowerShell-friendly --env option (no special characters)
|
|
392
|
+
filanti encrypt secret.txt --env ENCRYPT_PASSWORD
|
|
393
|
+
filanti decrypt secret.txt.enc --env ENCRYPT_PASSWORD
|
|
394
|
+
|
|
395
|
+
# Load from .env file
|
|
396
|
+
filanti encrypt secret.txt --dotenv .env --env-key MY_PASSWORD
|
|
397
|
+
filanti mac file.txt --dotenv secrets.env --env-key HMAC_KEY
|
|
398
|
+
|
|
399
|
+
# All secret-accepting commands support these options:
|
|
400
|
+
# --password Literal or ENV pattern
|
|
401
|
+
# --env Variable name (PowerShell-friendly)
|
|
402
|
+
# --dotenv Path to .env file
|
|
403
|
+
# --env-key Variable name from .env file
|
|
370
404
|
```
|
|
371
405
|
|
|
372
406
|
**Benefits:**
|
|
@@ -374,6 +408,43 @@ filanti sign document.pdf --key mykey --password ENV:KEY_PASSWORD
|
|
|
374
408
|
- Works with CI/CD (GitHub Actions, GitLab CI, Jenkins)
|
|
375
409
|
- Compatible with Docker/Kubernetes secrets
|
|
376
410
|
- 12-factor app compliance
|
|
411
|
+
- PowerShell-native syntax support
|
|
412
|
+
- Cross-platform .env file loading
|
|
413
|
+
|
|
414
|
+
### Secure File Deletion
|
|
415
|
+
|
|
416
|
+
Delete original files securely after encryption/decryption operations.
|
|
417
|
+
|
|
418
|
+
```python
|
|
419
|
+
from filanti.api import Filanti
|
|
420
|
+
|
|
421
|
+
# Encrypt and securely delete original
|
|
422
|
+
Filanti.encrypt("secret.txt", password="my-pass", remove_source=True)
|
|
423
|
+
# Original file is securely overwritten before deletion
|
|
424
|
+
|
|
425
|
+
# Decrypt and remove encrypted file
|
|
426
|
+
Filanti.decrypt("secret.txt.enc", password="my-pass", remove_source=True)
|
|
427
|
+
# Encrypted file is securely deleted after decryption
|
|
428
|
+
|
|
429
|
+
# Use faster (non-secure) deletion
|
|
430
|
+
Filanti.encrypt("secret.txt", password="my-pass",
|
|
431
|
+
remove_source=True, secure_delete=False)
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
**CLI Support:**
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
# Encrypt and securely delete original
|
|
438
|
+
filanti encrypt secret.txt --password mypass --remove-source
|
|
439
|
+
|
|
440
|
+
# Decrypt and remove encrypted file
|
|
441
|
+
filanti decrypt secret.txt.enc --password mypass --remove-source
|
|
442
|
+
|
|
443
|
+
# Use faster (non-secure) deletion
|
|
444
|
+
filanti encrypt secret.txt --password mypass --remove-source --no-secure-delete
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
> ⚠️ **Note:** Secure deletion provides defense-in-depth but has limitations on SSDs with wear-leveling, journaling filesystems, and cloud-synced folders. For maximum security, use full-disk encryption.
|
|
377
448
|
|
|
378
449
|
### Asymmetric / Hybrid Encryption
|
|
379
450
|
|
|
@@ -804,40 +875,72 @@ safe_output = redact_secret("Password is secret123", "secret123")
|
|
|
804
875
|
|
|
805
876
|
---
|
|
806
877
|
|
|
807
|
-
## Architecture
|
|
878
|
+
[//]: # (## Architecture)
|
|
808
879
|
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
│ ├──
|
|
817
|
-
|
|
818
|
-
│
|
|
819
|
-
|
|
820
|
-
│ ├──
|
|
821
|
-
|
|
822
|
-
│ ├──
|
|
823
|
-
|
|
824
|
-
│ ├──
|
|
825
|
-
|
|
826
|
-
│
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
├──
|
|
831
|
-
|
|
832
|
-
│ ├──
|
|
833
|
-
|
|
834
|
-
│
|
|
835
|
-
|
|
836
|
-
│
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
880
|
+
[//]: # ()
|
|
881
|
+
[//]: # (```)
|
|
882
|
+
|
|
883
|
+
[//]: # (filanti/)
|
|
884
|
+
|
|
885
|
+
[//]: # (├── core/ )
|
|
886
|
+
|
|
887
|
+
[//]: # (│ ├── errors.py )
|
|
888
|
+
|
|
889
|
+
[//]: # (│ ├── file_manager.py )
|
|
890
|
+
|
|
891
|
+
[//]: # (│ ├── metadata.py )
|
|
892
|
+
|
|
893
|
+
[//]: # (│ ├── plugins.py )
|
|
894
|
+
|
|
895
|
+
[//]: # (│ ├── secrets.py )
|
|
896
|
+
|
|
897
|
+
[//]: # (│ └── secure_memory.py )
|
|
898
|
+
|
|
899
|
+
[//]: # (│)
|
|
900
|
+
|
|
901
|
+
[//]: # (├── crypto/ )
|
|
902
|
+
|
|
903
|
+
[//]: # (│ ├── encryption.py )
|
|
904
|
+
|
|
905
|
+
[//]: # (│ ├── decryption.py )
|
|
906
|
+
|
|
907
|
+
[//]: # (│ ├── key_management.py )
|
|
908
|
+
|
|
909
|
+
[//]: # (│ ├── kdf.py )
|
|
910
|
+
|
|
911
|
+
[//]: # (│ ├── streaming.py )
|
|
912
|
+
|
|
913
|
+
[//]: # (│ └── asymmetric.py )
|
|
914
|
+
|
|
915
|
+
[//]: # (│)
|
|
916
|
+
|
|
917
|
+
[//]: # (├── hashing/ )
|
|
918
|
+
|
|
919
|
+
[//]: # (│ └── crypto_hash.py )
|
|
920
|
+
|
|
921
|
+
[//]: # (│)
|
|
922
|
+
|
|
923
|
+
[//]: # (├── integrity/ )
|
|
924
|
+
|
|
925
|
+
[//]: # (│ ├── checksum.py )
|
|
926
|
+
|
|
927
|
+
[//]: # (│ ├── mac.py )
|
|
928
|
+
|
|
929
|
+
[//]: # (│ └── signature.py )
|
|
930
|
+
|
|
931
|
+
[//]: # (│)
|
|
932
|
+
|
|
933
|
+
[//]: # (├── cli/ )
|
|
934
|
+
|
|
935
|
+
[//]: # (│ └── main.py )
|
|
936
|
+
|
|
937
|
+
[//]: # (│)
|
|
938
|
+
|
|
939
|
+
[//]: # (└── api/ )
|
|
940
|
+
|
|
941
|
+
[//]: # ( └── sdk.py )
|
|
942
|
+
|
|
943
|
+
[//]: # (```)
|
|
841
944
|
|
|
842
945
|
### Module Dependencies
|
|
843
946
|
|
|
@@ -1098,7 +1201,8 @@ encrypt_stream_file(input_path, output_path, key, chunk_size=16*1024) # 16 KB
|
|
|
1098
1201
|
|
|
1099
1202
|
---
|
|
1100
1203
|
|
|
1101
|
-
##
|
|
1204
|
+
## Contributors || Acknowledgements
|
|
1205
|
+
[@stephenlb](https://github.com/stephenlb) Thanks for the inspiration and guidance on encryption and security best practices.
|
|
1102
1206
|
|
|
1103
1207
|
### Development Setup
|
|
1104
1208
|
|
|
@@ -1129,15 +1233,21 @@ pip install -e ".[dev]"
|
|
|
1129
1233
|
|
|
1130
1234
|
[//]: # (```)
|
|
1131
1235
|
|
|
1132
|
-
### Pull Request Guidelines
|
|
1236
|
+
[//]: # (### Pull Request Guidelines)
|
|
1133
1237
|
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
3. Follow existing code style
|
|
1137
|
-
4. Add type hints
|
|
1138
|
-
5. Run full test suite before submitting
|
|
1238
|
+
[//]: # ()
|
|
1239
|
+
[//]: # (1. Write tests for new features)
|
|
1139
1240
|
|
|
1140
|
-
|
|
1241
|
+
[//]: # (2. Update documentation)
|
|
1242
|
+
|
|
1243
|
+
[//]: # (3. Follow existing code style)
|
|
1244
|
+
|
|
1245
|
+
[//]: # (4. Add type hints)
|
|
1246
|
+
|
|
1247
|
+
[//]: # (5. Run full test suite before submitting)
|
|
1248
|
+
|
|
1249
|
+
[//]: # ()
|
|
1250
|
+
[//]: # (---)
|
|
1141
1251
|
|
|
1142
1252
|
## Changelog
|
|
1143
1253
|
|