readme
Browse files
README.md
CHANGED
|
@@ -1,10 +1,108 @@
|
|
| 1 |
---
|
| 2 |
title: Paper
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
title: Paper
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# Paper β¨
|
| 11 |
+
|
| 12 |
+
A minimal, secure notepad for temporary notes. Zero tracking, zero accounts β just encrypted notes.
|
| 13 |
+
|
| 14 |
+
## Features
|
| 15 |
+
|
| 16 |
+
- π **Client-side encryption** β Your password never leaves your browser
|
| 17 |
+
- ποΈ **Auto-delete** β Notes removed after 2 days of inactivity
|
| 18 |
+
- π **Access anywhere** β Same password = same note, from any device
|
| 19 |
+
- π« **No tracking** β No cookies, no analytics, no accounts
|
| 20 |
+
|
| 21 |
+
## How It Works
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
βββββββββββββββββββ βββββββββββββββββββ
|
| 25 |
+
β Browser β β Server β
|
| 26 |
+
βββββββββββββββββββ€ βββββββββββββββββββ€
|
| 27 |
+
β β β β
|
| 28 |
+
β Password βββββββΌββΊ SHA-256 Hash (16 char) β
|
| 29 |
+
β β β β β β
|
| 30 |
+
β βΌ β β βΌ β
|
| 31 |
+
β PBKDF2 Key β β File ID β
|
| 32 |
+
β (250k rounds) β β (no password) β
|
| 33 |
+
β β β β β
|
| 34 |
+
β βΌ β β β
|
| 35 |
+
β AES-GCM β β β
|
| 36 |
+
β Encrypt/DecryptββββββββββΊβ Store/Load β
|
| 37 |
+
β β β Encrypted Blob β
|
| 38 |
+
βββββββββββββββββββ βββββββββββββββββββ
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
**Key points:**
|
| 42 |
+
- Password β PBKDF2 β AES-256-GCM key (client only)
|
| 43 |
+
- Password β SHA-256 β File identifier (sent to server)
|
| 44 |
+
- Server stores only: encrypted content + random salt
|
| 45 |
+
- Server never sees: password or decrypted content
|
| 46 |
+
|
| 47 |
+
## Architecture
|
| 48 |
+
|
| 49 |
+
```
|
| 50 |
+
Paper/
|
| 51 |
+
βββ index.html # Single-page app (HTML + CSS + JS)
|
| 52 |
+
βββ main.py # Flask backend
|
| 53 |
+
βββ Dockerfile # Container setup
|
| 54 |
+
βββ requirements.txt
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
### Frontend (`index.html`)
|
| 58 |
+
- Single HTML file with embedded CSS and JavaScript
|
| 59 |
+
- Crypto API for AES-GCM encryption and PBKDF2 key derivation
|
| 60 |
+
- Auto-save with debounce (1.5s after typing stops)
|
| 61 |
+
- Dark theme with colorful accents
|
| 62 |
+
|
| 63 |
+
### Backend (`main.py`)
|
| 64 |
+
- Flask server with CORS support
|
| 65 |
+
- Two endpoints: `/api/load` and `/api/save`
|
| 66 |
+
- File-based storage (configurable via `DATA_DIR`)
|
| 67 |
+
- Auto-cleanup: files older than 2 days or when storage exceeds limit
|
| 68 |
+
|
| 69 |
+
## Environment Variables
|
| 70 |
+
|
| 71 |
+
| Variable | Default | Description |
|
| 72 |
+
|----------|---------|-------------|
|
| 73 |
+
| `DATA_DIR` | `/tmp` | Storage directory |
|
| 74 |
+
| `AGE_LIMIT_DAYS` | `2` | Days before auto-delete |
|
| 75 |
+
| `MAX_TOTAL_SIZE_MB` | `100` | Max storage size |
|
| 76 |
+
| `MAX_CONTENT_SIZE_MB` | `10` | Max note size |
|
| 77 |
+
|
| 78 |
+
## Run Locally
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
# Install dependencies
|
| 82 |
+
pip -r requirements.txt
|
| 83 |
+
|
| 84 |
+
# Start server
|
| 85 |
+
python main.py
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
Open http://localhost:7860
|
| 89 |
+
|
| 90 |
+
## Deploy
|
| 91 |
+
|
| 92 |
+
### Docker
|
| 93 |
+
```bash
|
| 94 |
+
docker build -t paper .
|
| 95 |
+
docker run -p 7860:7860 paper
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
## Security Notes
|
| 99 |
+
|
| 100 |
+
- All encryption happens in your browser
|
| 101 |
+
- Password is never transmitted or stored
|
| 102 |
+
- Server cannot decrypt your notes
|
| 103 |
+
- Use a strong, memorable password
|
| 104 |
+
- No password recovery possible
|
| 105 |
+
|
| 106 |
+
## License
|
| 107 |
+
|
| 108 |
+
MIT
|