cryptfix v2

a complete recode!

read

back to blog

last year i made cryptfix cryptfix is a message sharing tool i liked a lot so i made cryptfix v2, a complete recode.

cryptfix encrypts messages on my machines. the cli creates a random token, signs the message with a gpg key, then encrypts the message and signature with aes-256-gcm. it derives a unique key for each link from a shared 32-byte secret and the token using hkdf-sha-256.

the link puts the token in its path and the encrypted data after #. browsers do not send that fragment in http requests. when a recipient opens the link, the browser sends the token and a turnstile response to the cloudflare worker. the worker checks the challenge and rate limit, derives the link’s key, and returns it. the browser decrypts the fragment and verifies the signature and tokenbefore displaying the message.

another new feature is key rotation which allows me to rotate my gpg signing key if i ever need to do it, but i probably wont.

cryptfix’s trust model has three important limits:

  • A the first public key a browser sees is trusted on first use, which helps detect later key changes but does not establish the sender’s real-world identity.
  • a link is a bearer link: anyone who has it can request its key after passing turnstile. the worker does not receive the ciphertext or plaintext, but it holds the shared secret and can derive the key.
  • the Worker could create an encrypted link, but it cannot sign one as the sender. It holds the shared AES secret, but the sender’s GPG private key stays local. Without that key, a Worker-created link cannot pass the signature verification andit would have to be unsigned and marked legacy. The current Worker has no ability to create a link, though a compromised or modified one could generate the encrypted link.

my current instances of cryptfix are:

the c.crafte.cc instance is of my fedora pc and can be trusted but doesnt have pgp signing rn, the omarchy.crafte.cc instance is with pgp signing and will soon get a new UI, the cryptfix.craftefix.workers.dev is legacy cryptfix v1 with complete different cryto setup. i wont make new messages there.

in the future i plan to make a nicer more verbose ui with a few more features.

Above line this stops the signing for the signed cryptfix message below. the fingerprint and omarchy’s pub key is below:

Fingerprint: 49D9378336DD056417B178E64E572D4A6FB86672

-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEaqXJCxYJKwYBBAHaRw8BAQdAlsQxKrNMb6wC5Dge4G+764uXlm/A5TlRskm1 D4VD+U+0JG9tYXJjaHktY3J5cHRmaXggPG9tYXJjaHlAY3JhZnRlZml4PoiWBBMW CgA+FiEESdk3gzbdBWQXsXjmTlctSm+4ZnIFAmqlyQsCGwMFCQHhM4AFCwkIBwIG FQoJCAsCBBYCAwECHgECF4AACgkQTlctSm+4ZnJzAAEAjs4BbURGlz7f0AYmTfmh wx3jasgxes+zXLMWcKMo3HAA+QGc91onB8J6qoaCYVHIu+09wLFEzlCOsDHEDUpa xRUC =V0ir -----END PGP PUBLIC KEY BLOCK-----

cryptfixv2 signed message from omarchy