jebin2 commited on
Commit
5534454
Β·
1 Parent(s): 624e2ff
Files changed (1) hide show
  1. README.md +102 -4
README.md CHANGED
@@ -1,10 +1,108 @@
1
  ---
2
  title: Paper
3
- emoji: πŸƒ
4
- colorFrom: gray
5
- colorTo: yellow
6
  sdk: docker
7
  pinned: false
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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