Kitten

Reference sections

The Kitten Cryptography API is one module in two places: the kitten.crypto object on the server and /๐Ÿฑ/library/crypto-1.js in the browser, as an ES module. Keys are 32 bytes. Where a parameter takes hex, it takes a hexadecimal string.

A Kitten server never has a personโ€™s secret. Call the functions that take a private key or an ourPrivateKey parameter in the browser.

Secrets and encoding

Identity creation

Signing

Encryption

Domains

A domainโ€™s identity is the ed25519 public key it publishes at https://<domain>/๐Ÿ’•/id/. Where a function takes an ourPrivateKey parameter, pass the KittenMoji secret, the raw 32-byte secret, or the identity that the getIdentity() function returns from the key store (below).

Key store

In the browser, the /๐Ÿฑ/library/key-store-1.js module stores a personโ€™s identity as non-extractable Web Crypto keys in IndexedDB, or in memory for the session when IndexedDB is unavailable. The raw secret is never persisted. Kittenโ€™s sign-in page stores the identity and its sign-out route clears it.

An identity has the signingKey (ed25519, non-extractable), keyAgreementKey (X25519, non-extractable), ed25519PublicKeyHex, and x25519PublicKeyHex properties. See Browser support for a WebKit limitation on X25519 keys.

The security (and privacy) of Catalyst/Kitten are based on a 32-byte cryptographically-random secret string that only the person who owns/controls a Small Web place knows.

This is a Base256-encoded ed25519 secret key where the Base256 alphabet is a set of curated emoji surrogate pairs without any special modifiers chosen mainly from the animals, plants, and food groups with some exceptions (to avoid common phobias or triggers, etc.) that we call KittenMoji.

๐Ÿต๐Ÿ’๐Ÿฆ๐Ÿฆง๐Ÿถ๐Ÿ•๐Ÿฆฎ๐Ÿฉ๐Ÿบ๐ŸฆŠ๐Ÿฆ๐Ÿฑ๐Ÿˆ๐Ÿฆ๐Ÿฏ๐Ÿ…
๐Ÿ†๐Ÿด๐Ÿงฎ๐Ÿฆ„๐Ÿฆ“๐ŸฆŒ๐Ÿฆฌ๐Ÿฎ๐Ÿ‚๐Ÿƒ๐Ÿ„๐Ÿท๐Ÿ–๐Ÿ—๐Ÿฝ๐Ÿ
๐Ÿ‘๐Ÿ๐Ÿช๐Ÿซ๐Ÿฆ™๐Ÿฆ’๐Ÿ˜๐Ÿฆฃ๐Ÿฆ๐Ÿฆ›๐Ÿญ๐Ÿ๐Ÿ€๐Ÿน๐Ÿฐ๐Ÿ‡
๐ŸŽˆ๐Ÿฆซ๐Ÿฆ”๐Ÿฆ‡๐Ÿป๐Ÿจ๐Ÿผ๐Ÿฆฅ๐Ÿฆฆ๐Ÿฆจ๐Ÿฆ˜๐Ÿฆก๐Ÿพ๐Ÿฆƒ๐ŸŽน๐Ÿ“
๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฆ๐Ÿง๐Ÿ’•๐Ÿฆ…๐Ÿฆ†๐Ÿฆข๐Ÿฆ‰๐Ÿฆค๐Ÿชถ๐Ÿฆฉ๐Ÿฆš๐Ÿฆœ๐Ÿšฒ
๐ŸŠ๐Ÿข๐ŸฆŽ๐Ÿ“š๐Ÿ‰๐Ÿฆ•๐Ÿฆ–๐Ÿณ๐Ÿ‹๐Ÿฌ๐Ÿฆญ๐ŸŸ๐Ÿ ๐Ÿก๐Ÿฆˆ๐Ÿ™
๐Ÿš๐ŸŒ๐Ÿฆ‹๐Ÿ›๐Ÿœ๐Ÿ๐Ÿชฒ๐Ÿž๐Ÿฆ—๐ŸŽญ๐ŸŽ๐Ÿงฌ๐Ÿชฑ๐Ÿฆ ๐Ÿ’๐ŸŒธ
๐ŸŽ ๐ŸŒˆ๐ŸŒน๐Ÿงฃ๐ŸŒบ๐ŸŒป๐ŸŒผ๐ŸŒท๐ŸŒฑ๐Ÿชด๐ŸŒฒ๐ŸŒณ๐ŸŒด๐ŸŒต๐ŸŒพ๐ŸŒฟ
๐ŸŽค๐Ÿ€๐Ÿ๐Ÿชบ๐Ÿ‘ฝ๐Ÿ‡๐Ÿˆ๐Ÿ‰๐ŸŠ๐Ÿ‹๐ŸŒ๐Ÿ๐Ÿฅญ๐ŸŽ๐Ÿ๐Ÿ
๐Ÿ‘๐Ÿ’๐Ÿ“๐Ÿซ๐Ÿฅ๐Ÿ…๐Ÿซ’๐Ÿฅฅ๐Ÿฅ‘๐Ÿ†๐Ÿฅ”๐Ÿฅ•๐ŸŒฝ๐Ÿงธ๐Ÿซ‘๐Ÿฅ’
๐Ÿฅฌ๐Ÿฅฆ๐Ÿง„๐Ÿง…๐Ÿ„๐Ÿฅœ๐ŸŒฐ๐Ÿž๐Ÿฅ๐Ÿฅ–๐Ÿ’ฉ๐Ÿฅจ๐Ÿฅฏ๐Ÿฅž๐Ÿง‡๐Ÿง€
๐ŸŽถ๐Ÿธ๐ŸŽพ๐ŸŽจ๐Ÿ”๐Ÿ”ญ๐Ÿ•๐ŸŒญ๐Ÿฅช๐ŸŒฎ๐ŸŒฏ๐Ÿ˜ธ๐Ÿ“ท๐ŸŒœ๐Ÿฅš๐Ÿš‚
๐Ÿ›ผ๐Ÿš๐Ÿ‘พ๐Ÿ‘ป๐Ÿฅ—๐Ÿฟ๐Ÿงฉ๐Ÿ––๐Ÿฅซ๐ŸŽธ๐Ÿ˜๐Ÿ™๐Ÿš๐Ÿƒ๐Ÿœ๐Ÿ
๐Ÿ ๐Ÿข๐Ÿฃ๐Ÿค๐Ÿฅ๐Ÿฅฎ๐Ÿก๐ŸฅŸ๐Ÿฅ ๐Ÿฉฐ๐Ÿฆ€๐Ÿฆž๐Ÿฆ๐Ÿฆ‘๐ŸŽก๐Ÿฆ
๐Ÿง๐Ÿจ๐Ÿฉ๐Ÿช๐ŸŽ‚๐Ÿฐ๐Ÿง๐Ÿฅง๐Ÿซ๐Ÿฌ๐Ÿญ๐Ÿฎ๐ŸŽ“๐Ÿผ๐ŸŽฎ๐Ÿ›น
๐Ÿซ–๐ŸŒ๐ŸŒŽ๐ŸŒ๐Ÿงญ๐ŸŒ ๐Ÿช๐Ÿช€๐Ÿงต๐Ÿงถ๐Ÿง‹๐ŸŽ‰๐Ÿช๐Ÿ™ˆ๐Ÿ™‰๐Ÿ™Š

The KittenMoji standard was frozen in time on Friday, November 25th, 2022.

The string created by joining the list of the full KittenMoji alphabet has the following hash: d9b1533de36a75c9e47f1713aada4ff332918ff0d3cada5b645ca84d73dd50d6.

When setting up a Small Web app via Catalyst, this key is generated in the personโ€™s browser, on their own computer, and is never communicated to either the Catalyst instance or the Kitten app being installed. Instead the ed25519 public key is sent to both and signed token authentication is used when the server needs to verify the ownerโ€™s identity (e.g., before allowing access to the administration area).

Kitten uses the Web Crypto API and non-extractable keys to ensure that even if a session is intercepted by a cross-site scripting attack, the long-term secret key is still safe. (In such a hypothetical attack, if successful, the attacker will be able to sign/encrypt messages as the person who owns the Small Web site/app but will not have access to their key material.)

The expected/encouraged behaviour is for the person to store this secret in their password manager of choice.

For encryption, Kitten uses Diffie-Hellman key exchange and XChaCha20-Poly1305 where the secret key from the key exchange is run through the HKDF-SHA-256 key derivation function.

Static keys that never leave the client are a core aspect of Kittenโ€™s usable security model. This means the number of messages encrypted with a single key is essentially unbounded. This is why Kitten uses XChaCha20, which has a 192-bit nonce thatโ€™s safe to generate randomly. This lets us avoid the added complexity of key rotation or nonce-state management.

Kitten running on a development machine can also recreate these SSH keys and configure the personโ€™s SSH access to their server when the secret key is provided.

The personโ€™s ed25519 public key is used as their identity within the system and enables their Small Web place (Kitten app) to communicate with the Catalyst instance for administrative reasons (e.g., to cancel hosting, etc.)

The audience for Catalyst/Kitten and the Small Web in general is everyday people who use technology as an everyday thing and want privacy by default in the systems they use.

If you are an activist, etc., who might be specifically targetted by nation states, etc., please do not use this system as it does not protect against, for example, infiltration of hosting providers by nation state actors.

Given that the secret key material is generated in a web app, you must trust that the code being served by the server is what you expect it to be. Currently, there is no validation mechanism for this, although this is on the roadmap going forward (via, for example, a browser extension). This is not a problem unique to web apps, given that native apps are commonly dynamically built by app stores (at which point a nation state actor could inject malicious code) and given the lack of verifiable builds in mainstream supply chains.

You can, however, overcome this limitation by hosting Kitten and Catalyst yourself, on your own hardware (e.g., a single-board computer like a Raspberry Pi).

The other thing to be aware of is that the security of the system is based on your secret key remaining secret and, initially at least, there will not be a way to change this secret key. (On the longer roadmap, it would be nice to provide a means of changing it but this is not a trivial process, especially if encryption keys have been derived from it and encrypted messages exist within a Kitten app).

WebKit cannot read an X25519 CryptoKey back from IndexedDB (WebKit bug 312279). The write succeeds but the read returns null. Sign-in works in Safari. After sign-in, the getIdentity() function returns null, and end-to-end encryption does not work. There is currently no acceptable workaround that doesnโ€™t weaken the cryptographic properties of Kitten. Until the bug is fixed in WebKit, use a non-WebKit/non-Safari browser for Small Web apps that require end-to-end encryption.

Like this? Fund us!

Small Technology Foundation is a tiny, independent not-for-profit.

We exist in part thanks to patronage by people like you. If you share our vision and want to support our work, please become a patron or donate to us today and help us continue to exist.