Paste Locker No key in this page

Paste Locker

Share a secret behind an eight character code. Add a password, give it an expiry, or let it burn so the first reader is the only reader.

New note

POST /api/create-note
0 characters

Keep the code somewhere safe. Without it, nothing in this app can find the note again.

Open a note

POST /api/read-note

Every fresh deploy ships one note.

Nothing open yet

Enter a code above, or follow a share link, and the note lands here.

Why a serverless function

The notes table is not published on the REST API at all. This page cannot query it, and neither can anyone else. The only way in is two functions that run on the server.

  1. Creating a note posts it to /api/create-note.
  2. That function hashes your password with scrypt, a one way function, then forgets the password.
  3. Only the hash is stored, never the password itself.
  4. Opening a note posts the code and the password to /api/read-note, which hashes the attempt and compares it against the stored hash.

A browser cannot do this part. If the hash were handed to the page, anyone could take it away and try guesses offline for as long as they liked. Burning a note has the same problem: decide "already read" in the browser and two readers can both win the race, so the function settles it in one database statement.