Menu

Locked content

Albums and files encrypted on your computer before upload, opened with a password, a share link, a recovery kit or a person's key; what locking protects and what it cannot do.

Stored content is public: anyone with its address can fetch it. Locked content is encrypted on your computer before it is uploaded, so weird and the storage providers store only ciphertext; the password and the keys stay on your device. weird does serve the page that opens an album (and, in the application, the page that locks one), so check it as the viewer section below says. It opens with a way in that you choose: a password, a share link, a recovery kit, or a person's public key.

The format is published as weirdlock1 (Apache-2.0), so a locked album opens without weird too: see Opening your content without weird.

Lock and upload#

A file or a folder becomes a locked album:

$ weird storage add ./wedding --lock$ weird storage add ./wedding --lock --link --recovery-kit kit.txt$ weird storage add doc.pdf --lock-to weirdpk1… --lock-key me
  • --lock: a password, typed hidden and twice. A weak password is warned about, not refused. In scripts, read it with --password-fd N or --password-env NAME; a password never goes on the command line.
  • --link: a share link, printed once. Its key travels in the part of the link after #, which browsers do not send to servers.
  • --recovery-kit FILE: a recovery link written to a new file only you can read. Keep it offline.
  • --lock-to weirdpk1…: a person's public key (--lock-to-hidden does not write whose key it is). --lock-key NAME: one of your own keys.
  • --pad hides exact file sizes (at most 12% more storage); --title gives the album an encrypted title; --password-hint is a public hint shown next to the password field, readable by anyone.

Your own key pairs live on this computer only:

$ weird storage keys create me$ weird storage keys show me$ weird storage keys export me -o me-key.txt

weird storage keys show prints the public key (weirdpk1…) to give to people who lock things for you. weird storage keys export writes a recovery copy of the key pair, private key included, to a new file; keep it somewhere safe, because a lost key cannot be recovered.

A single locked file that is not uploaded, to send or keep anywhere:

$ weird storage lock seal doc.pdf -o doc.pdf.wlk --lock

Locked content is stored and billed like any other upload (Storage and sites).

Open it#

$ weird storage get <cid> --unlock -o ./wedding$ weird storage get <cid> --recovery-kit kit.txt -o ./wedding$ weird storage get <cid> --key me -o ./wedding

--link-key opens with a share link or its #k= part, pasted at a hidden prompt. Each file is written only after its whole encrypted stream has been checked.

In a browser: the viewer#

A locked album carries its own viewer: an index.html at its root and a script and a stylesheet under v/<release>/, next to lock/. Open the album's address and the viewer asks for a way in; the album is decrypted in your browser and nothing you type leaves the page. It:

  • opens with a password, with a share link (the key after #k= in the address, removed from the address bar as soon as it is read), or with a key file or recovery kit you choose on your device (read there, never uploaded);
  • shows the album as a grid of previews; opens a photo, plays a video or a sound, and downloads any file decrypted;
  • locks again when you ask, after 15 minutes without use, and when you leave the page: the album key is dropped and every decrypted file let go;
  • runs only on the album's own address: a hostname of your domain, or the content's own address (https://<cid>.ipfs.<gateway domain>/, see Storage). It refuses to run on a shared gateway path, where other people's pages share its origin, and inside another page (a frame);
  • talks to nothing but the album's own files: no update check, no font, no analytics, no other site. Its content security policy allows nothing else, and it never stores a key, a password or anything about you in the browser;
  • honours --expires: after that date it says the owner set the album to stop opening.

Its limits: a file larger than the viewer opens in memory (512 MB; less on devices with little memory) is not opened in the browser, and the viewer names the command to use instead; a password needs about 128 MB of memory for a moment, which very old phones may not have; video plays once it is decrypted whole (no streaming); a locked site of many pages does not open (the format reserves it).

Albums locked with the weird CLI and in the application both carry the viewer (for implementers).

Checking the viewer. The viewer is the weakest point: whoever serves the album serves its code, and a changed viewer could send your password away. The release is a fixed set of files whose SHA-256 values are published with the release; the script and stylesheet are loaded with Subresource Integrity, so only index.html can differ without the browser refusing it. Compare the served index.html with the published value, or open the album with the command line, which never runs web code:

$ weird storage get <cid> --unlock -o ./wedding

In the application#

app.weird.ro locks an album in your browser: choose files, a password (typed twice; a weak one is said to be weak), optionally a public hint and a recovery kit, and confirm that a lost password cannot be recovered. The files are encrypted in the page with the viewer's own code; the password, the album key and the files never reach weird. You get the locked folder as a zip (the viewer at its root, lock/ beside it) and, if you asked, the recovery kit as a text file.

The browser does not upload it: the storage nodes that take uploads do not accept them from a web page. Upload the folder with the command line and give it an address of its own:

$ weird storage add ./wedding-locked$ weird storage domains attach album.example.ro <cid>

The application's code is served by weird, as the viewer's is: if that matters to you, lock with the command line.

See what is visible without a key#

$ weird storage lock show <cid>$ weird storage lock list <cid> --unlock

weird storage lock show reads only the public parts, with no password or key: exactly what weird, the storage providers and anyone holding the CID can see. weird storage lock list opens the encrypted list of names, types and sizes, downloading only that.

Change who may open it#

$ weird storage lock add-person <cid> weirdpk1…$ weird storage lock add-password <cid> --unlock$ weird storage lock add-link <cid> --unlock$ weird storage lock password <cid> --unlock$ weird storage lock remove <cid> --slot 2 --unlock

Each needs a way in that already works (here --unlock). The slot numbers come from weird storage lock show. For stored content, the album is uploaded again as new content with the same encrypted files and a new key list; --host www.example.ro serves the new copy at your hostname instead of the old one. The old copy stays stored, and billed, until you delete it with weird storage delete.

What locking protects#

  • From weird and the storage providers: they hold ciphertext, sizes and upload details; never a key, a password or a link secret.
  • From anyone who finds the address or the CID without a way in.
  • From tampering in storage: every part of every file is authenticated. A changed, cut, reordered or swapped file fails to open, and nothing unchecked is released.
  • From fast password guessing: the password is stretched with a memory-hard function. It slows guessing down; it does not save a weak password.

What it cannot do#

  • A weak password. The ciphertext is public for ever and can be guessed at offline, without limit. Use a long passphrase.

  • Taking back what was opened. Removing a way in is not revocation: whoever opened the album before may have kept the album key or the files, and the old copy still opens with the old key list. To shut someone out for good, lock everything again under a new key and upload it as new content:

    $ weird storage get <cid> --unlock -o ./wedding$ weird storage add ./wedding --lock
  • Expiry. --expires DATE is advisory: viewers that cooperate honour it; it cannot stop someone who saved the album.

  • Metadata. The number of encrypted files and their approximate sizes, the number and kind of ways in, upload and access times, your account and hostname stay visible to weird.

  • A compromised device, yours or the visitor's, or someone looking over a shoulder.

  • Leaked links. A share link lives on in chat histories, browser history and synced bookmarks; anyone who has it can open the album.

  • Who sent it. Anyone can lock something to a person's public key: a person key says "this was meant for you", not "this came from X".

  • Lost passwords and keys. Nobody, weird included, can recover them. Keep a recovery kit or an exported key offline.

The full threat model is in section 2 of the format.

With an AI assistant#

The locked toolset of the MCP server locks only for people's public keys and your own keys by name. No tool takes or returns a password, a link secret or a private key: a share link, if asked for, is written to a private file and only its path is answered, and every step that needs a password answers the terminal command for you to run.

The older format#

--encrypt-password, --key-file and --encrypt-to store one encrypted envelope (weirdenc1) instead of an album; it downloads with weird storage get <cid> --decrypt-password (or --key-file). It still works; new content should be locked.

Reference#