On a Mac, Chrome encrypts each cookie value with AES-128-CBC, using a key it derives from a password kept in your login Keychain. The password is an item called Chrome Safe Storage, made from 16 random bytes the first time Chrome needs it. Chrome runs it through PBKDF2 and writes every encrypted value with a v10 prefix into the profile's Cookies database. Our engine, Tesseract Chrome, runs every profile with --use-mock-keychain, which keeps all of that but replaces the password with a constant from Chromium's source. A change in our engine lets Mosaic pass each profile a password of its own instead, and changes nothing else.

Four lines cover it. We read them off Chromium's source and then decrypted real cookies from our own disk with them, before any of our code was allowed near a jar:

password        = Keychain item "Chrome Safe Storage" (Base64 of 16 random bytes)
key             = PBKDF2-HMAC-SHA1(password, salt "saltysalt", 1003 iterations, 16 bytes)
plain           = SHA-256(host_key) || value
encrypted_value = "v10" || AES-128-CBC(key, IV = 16 spaces, PKCS#7(plain))

Where people trip when they read the file by hand:

  • On a Chromium build the item is Chromium Safe Storage, not Chrome Safe Storage.
  • 32 bytes of garbage before the value? That's the SHA-256 of the host, and it means your key was right. Chromium glues it on so a blob moved to another host's row won't decrypt as valid. Skip it.
  • The "wants to use Chrome Safe Storage" prompt is this Keychain read. Chrome makes it on a worker thread, and nothing decrypts until it returns.

On Windows the scheme is different, with App-Bound Encryption on top; that story is in App-Bound Encryption, and why tools stopped reading Chrome's cookies.

Your profiles, cookies and proxies stay on your computerIn Mosaic: Local first. Profiles, cookies and proxies stay on your computer. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

How it works: Local first

Why our engine does not use the Keychain

There is one login Keychain for the whole machine, and Mosaic runs many browser profiles on it. The first finished build of our engine wrote Local State and then sat at 0% CPU with no window, its main thread inside SecItemCopyMatching waiting for an access dialog. Every launcher bundle was a new code identity to the Keychain, so "Always Allow" lasted one launch.

--use-mock-keychain removes the dialog. It does not remove encryption: the format, the salt and the v10 prefix all stay, and the password becomes mock_password, a constant anyone can read in Chromium's source. Before this change existed, one command against a real profile printed a live session cookie in about a second. Chromium's mock keychain has that measurement and the rest of what we sealed after it.

What the change does

Two files. A new switch in components/os_crypt/common/os_crypt_switches.h:

inline constexpr char kOsCryptPassword[] = "os-crypt-password";

and a dozen lines in keychain_key_provider.mm, the one place on macOS where a password becomes a key. The change does it like this:

std::string password;
const base::CommandLine& mosaic_cmd = *base::CommandLine::ForCurrentProcess();
if (mosaic_cmd.HasSwitch(os_crypt::switches::kOsCryptPassword)) {
  password = mosaic_cmd.GetSwitchValueASCII(os_crypt::switches::kOsCryptPassword);
} else {
  KeychainPassword keychain_password(*keychain_to_use);
  password = keychain_password.GetPassword();
}

We check the switch first, before KeychainPassword is ever constructed. Had it come second, a profile with its own password could still have hung on a dialog, or quietly fallen back to the constant when the read failed. From that line down it's Chromium's code untouched (PBKDF2, AES-128-CBC, v10). Open one of our jars with the right password and you can't tell it from any other Chromium jar.

We changed only the asynchronous key provider because in Chromium 153, when we wrote it, that was the single place a macOS password became a key. grep -rl saltysalt components/ found the POSIX and Freedesktop providers and this one, and the old synchronous backend was gone.

Where each profile's password comes from

Mosaic does not store the cookie passwords anywhere. At launch it derives one from the library's data key and the profile's id:

cookie password = Base64( scrypt(data key, "mosaic-cookies:<profile id>", N = 2^14, r = 8, p = 1, 32 bytes) )

and passes it as --os-crypt-password. Delete a profile from the store and its key is gone too; there's no id left to derive from. Copy a profile folder to another machine and no key goes with it. The data key itself is wrapped under your Mosaic account, plus your app-lock password when that is on, which is what lets us say the store and cookie jars are encrypted on disk. What that protects, and what it does not, is in local-first.

It also means Mosaic can open a stopped profile's jar itself, read-only, no browser needed. That's where GET /profiles/:id/cookies gets its answer when the profile is closed; the response says source: "jar" rather than "live".

Old jars keep the key they were written with

We wired the switch on 14 September 2026 and ran the jar reader over the library. It printed 87 of 92 cookies across 9 jars open with Chromium's published password. Pass those nine profiles a fresh password and Chromium can't read a cookie it wrote, so all nine are logged out of everything.

What we do instead, per profile folder:

  • No jar yet: write .mosaic-cookie-key (it holds v1) and launch with the profile's own key.
  • Marker present: launch with the profile's own key.
  • Jar but no marker: launch on the old mock password, untouched.

The marker lives beside the data, not in the store, because a store restored from a week-old backup shouldn't vouch for bytes it never saw. There is a re-key routine for the third case: copy the jar, rewrite it, read every row back under the new key, then rename. A crash anywhere leaves the original. Nothing in the window calls it yet, so old jars stay on the old key for now.

What this change does not fix, because it was never broken: one profile seeing another's cookies. Each has its own data folder, and nineteen jars on one machine shared nothing. The leak was the files, to anyone holding the laptop, a backup or a dead Mac's disk.

The price is that the password is on the browser's command line, and ps shows it to the user who launched it. We took that. Argv is never written to disk, and code running as you could read the key from Mosaic's memory anyway. The rest of our changes to Chromium, and why the engine is ours, is in why we built our own Chromium.