forked from username/flaskpaste
docs: update for encrypt-by-default CLI
Update README.md, api.md, and error hints to reflect: - encryption is now default (no -e flag needed) - use -E/--no-encrypt to disable - file path shortcut (fpaste file.txt)
This commit is contained in:
28
README.md
28
README.md
@@ -105,29 +105,30 @@ pip install cryptography
|
|||||||
### Basic Usage
|
### Basic Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Create paste from file
|
# Create paste from file (encrypts by default)
|
||||||
./fpaste create file.txt
|
./fpaste file.txt
|
||||||
|
# Returns: https://paste.example.com/abc123#<key>
|
||||||
|
|
||||||
|
# Shortcut: file path auto-selects "create" command
|
||||||
|
./fpaste secret.txt # Same as: ./fpaste create secret.txt
|
||||||
|
|
||||||
# Create paste from stdin
|
# Create paste from stdin
|
||||||
echo "Hello" | ./fpaste
|
echo "Hello" | ./fpaste
|
||||||
|
|
||||||
# Create encrypted paste (E2E, zero-knowledge)
|
# Disable encryption (upload plaintext)
|
||||||
./fpaste create -e secret.txt
|
./fpaste -E file.txt
|
||||||
# Returns: https://paste.example.com/abc123#<key>
|
./fpaste create --no-encrypt file.txt
|
||||||
|
|
||||||
# Create burn-after-read paste (single access, auto-deletes)
|
# Create burn-after-read paste (single access, auto-deletes)
|
||||||
./fpaste create -b secret.txt
|
./fpaste -b secret.txt
|
||||||
|
|
||||||
# Create paste with custom expiry (1 hour)
|
# Create paste with custom expiry (1 hour)
|
||||||
./fpaste create -x 3600 temp.txt
|
./fpaste -x 3600 temp.txt
|
||||||
|
|
||||||
# Combine options: encrypted + burn-after-read
|
# Combine options: encrypted + burn-after-read
|
||||||
./fpaste create -e -b secret.txt
|
./fpaste -b secret.txt
|
||||||
|
|
||||||
# Get paste content
|
# Get paste content (auto-decrypts if URL has #key fragment)
|
||||||
./fpaste get abc12345
|
|
||||||
|
|
||||||
# Get encrypted paste (auto-decrypts if URL has #key fragment)
|
|
||||||
./fpaste get "https://paste.example.com/abc123#<key>"
|
./fpaste get "https://paste.example.com/abc123#<key>"
|
||||||
|
|
||||||
# Get paste metadata
|
# Get paste metadata
|
||||||
@@ -142,12 +143,13 @@ echo "Hello" | ./fpaste
|
|||||||
|
|
||||||
### End-to-End Encryption
|
### End-to-End Encryption
|
||||||
|
|
||||||
The `-e` flag encrypts content client-side using AES-256-GCM before upload:
|
Content is encrypted by default using AES-256-GCM before upload:
|
||||||
|
|
||||||
- Key is generated locally and never sent to server
|
- Key is generated locally and never sent to server
|
||||||
- Key is appended to URL as fragment (`#...`) which browsers never transmit
|
- Key is appended to URL as fragment (`#...`) which browsers never transmit
|
||||||
- Server stores only opaque ciphertext
|
- Server stores only opaque ciphertext
|
||||||
- Retrieval auto-detects `#key` fragment and decrypts locally
|
- Retrieval auto-detects `#key` fragment and decrypts locally
|
||||||
|
- Use `-E` or `--no-encrypt` to disable encryption
|
||||||
|
|
||||||
This provides true zero-knowledge storage: the server cannot read your content.
|
This provides true zero-knowledge storage: the server cannot read your content.
|
||||||
|
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ class IndexView(MethodView):
|
|||||||
400,
|
400,
|
||||||
size=content_size,
|
size=content_size,
|
||||||
min_size=min_size,
|
min_size=min_size,
|
||||||
hint="Encrypt content before uploading (-e flag in fpaste)",
|
hint="Encrypt content before uploading (fpaste encrypts by default)",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Entropy check
|
# Entropy check
|
||||||
@@ -476,7 +476,7 @@ class IndexView(MethodView):
|
|||||||
400,
|
400,
|
||||||
entropy=round(entropy, 2),
|
entropy=round(entropy, 2),
|
||||||
min_entropy=min_entropy,
|
min_entropy=min_entropy,
|
||||||
hint="Encrypt content before uploading (-e flag in fpaste)",
|
hint="Encrypt content before uploading (fpaste encrypts by default)",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Binary content requirement (reject recognizable formats)
|
# Binary content requirement (reject recognizable formats)
|
||||||
@@ -492,7 +492,7 @@ class IndexView(MethodView):
|
|||||||
"Recognizable format not allowed",
|
"Recognizable format not allowed",
|
||||||
400,
|
400,
|
||||||
detected=detected_format,
|
detected=detected_format,
|
||||||
hint="Encrypt content before uploading (-e flag in fpaste)",
|
hint="Encrypt content before uploading (fpaste encrypts by default)",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Deduplication check
|
# Deduplication check
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ export FLASKPASTE_MIN_ENTROPY_SIZE=256 # Only check content >= this size (defaul
|
|||||||
**Caveats:**
|
**Caveats:**
|
||||||
- Small data is exempt (configurable via `MIN_ENTROPY_SIZE`, default 256 bytes)
|
- Small data is exempt (configurable via `MIN_ENTROPY_SIZE`, default 256 bytes)
|
||||||
- Compressed data (gzip, zip) also has high entropy — not distinguishable from encrypted
|
- Compressed data (gzip, zip) also has high entropy — not distinguishable from encrypted
|
||||||
- This is a heuristic, not cryptographic proof of encryption
|
- This is a heuristic, not cryptographic proof of encryption
|
||||||
|
|
||||||
**Recommended thresholds:**
|
**Recommended thresholds:**
|
||||||
| Threshold | Effect |
|
| Threshold | Effect |
|
||||||
@@ -597,7 +597,7 @@ export FLASKPASTE_REQUIRE_BINARY=1 # Reject recognizable formats (0=disabled)
|
|||||||
**Detected formats:**
|
**Detected formats:**
|
||||||
- `text/plain` (valid UTF-8 text)
|
- `text/plain` (valid UTF-8 text)
|
||||||
- `image/png`, `image/jpeg`, `image/gif`, `image/webp`
|
- `image/png`, `image/jpeg`, `image/gif`, `image/webp`
|
||||||
- `application/pdf`, `application/zip`, `application/gzip`
|
- `application/pdf`, `application/zip`, `application/gzip`
|
||||||
|
|
||||||
**vs Entropy enforcement:**
|
**vs Entropy enforcement:**
|
||||||
| Method | Detects | False positives |
|
| Method | Detects | False positives |
|
||||||
|
|||||||
Reference in New Issue
Block a user