Skip to main content
[access] makes the installer ask for a key and encrypts the packaged files with it. The key is never written into bach.toml. Walkthrough and limits: Access keys.
bach.toml
With encrypt = false, send_key must be on, otherwise the section does nothing and Bach refuses it.

Keys

  • 8 to 128 characters: letters, digits and - _ . ~ + / = :. bach key makes random ones.
  • A key file holds one key per line; blank lines and lines starting with # are skipped. Up to 1000 keys, each opening the setup file on its own. The environment variable holds one key.
  • Silent installs take --key-file or BACH_ACCESS_KEY. No key: exit code 2. Wrong key: 1.

On the user’s computer

With [updates], the key is stored under HKCU\Software\Bach\Access, protected with the Windows Data Protection API for that user, and deleted on uninstall. Programs running as that user can still ask Windows to read it, as with saved browser passwords. It is sent only to the feed’s host; redirects to other hosts are followed without it.

How files are protected

The files are encrypted with a random key. For each access key, that random key is stored once, locked with a key derived from the access key using Argon2id (64 MiB, 3 passes) and ChaCha20-Poly1305. The archive is encrypted in authenticated 64 KB pieces, so a changed or shortened file fails with a message. A setup file that asks for more than 256 MiB of memory, or an unknown method, is refused. Trying a key takes about a third of a second. With 17 keys or more, each stored copy also has a one-byte tag that lets setup find the right one quickly; random keys make this safe. File names and sizes remain visible without a key, and installed files are ordinary files. Setup files made with one key for the whole file, from older versions, still open. Not allowed with: download components while encrypting, kind = "zip" profiles, and --msi.