Encryption is the core of TextSandbox

TextSandbox uses XChaCha20-Poly1305 authenticated encryption and Argon2id to protect the Master Password. Vault content is encrypted locally before it is saved or synced. This page describes how the encryption works — and what encryption cannot protect.

  • Authenticated encryption (AEAD)
  • Argon2id protects the Master Password
  • Encrypted before saving

Algorithms used

Two core cryptographic building blocks

One algorithm to encrypt content, one to protect the Master Password. Both run locally on your device.

Content encryption

XChaCha20-Poly1305

Authenticated encryption (AEAD): the XChaCha20 stream cipher keeps content confidential, while the Poly1305 authentication tag detects any modification of the encrypted data. A 192-bit extended nonce makes random nonce generation safe.

Type
AEAD — authenticated encryption
Protects
Confidentiality + integrity
Applied to
Document content, titles, version history, attachments, workspace state

Master Password protection

Argon2id

A memory-hard key derivation function and winner of the Password Hashing Competition. Argon2id turns your Master Password into an encryption key and makes brute-force password guessing expensive.

Type
Memory-hard KDF
Purpose
Derive the encryption key from the Master Password
Master Password
Never stored, never sent to the cloud

All encryption and decryption happens locally on your device. Cloud Sync stores encrypted data only and never receives the Master Password, Recovery Key or readable content.

Encryption pipeline

What steps does your content go through?

Text only exists in readable form in memory while the Vault is unlocked. Before it touches the disk or leaves the device, it is always encrypted.

In memory (Vault unlocked)

# Research notes
Client contract — draft 3

On disk & in the cloud

a7f3e1b9c05d... 4c2d8e
+ Poly1305 auth tag

Four encryption steps

  1. 1

    Enter the Master Password

    The password lives in memory only for as long as the Vault stays unlocked.

  2. 2

    Argon2id derives the key

    The Master Password becomes an encryption key via a memory-hard KDF.

  3. 3

    XChaCha20-Poly1305 encrypts

    Content, titles, history and attachments are encrypted together with an authentication tag.

  4. 4

    Written into the .tsbx Vault

    Only encrypted data reaches the disk — and only that data is ever synced.

Encrypted locally before saving

Vault content, document titles, edit history, attachments and workspace state are encrypted with XChaCha20-Poly1305 before being written to disk — they never exist there as plain text.

The Master Password never leaves your device

The Master Password is protected with Argon2id, is never stored and is never sent to the cloud. A cloud account does not replace it and cannot decrypt your Vault.

The cloud stores encrypted data only

Cloud Sync stores encrypted data only and never receives the Master Password, Recovery Key or readable content. The service has no key to decrypt your Vault.

No decryption backdoor

No backup key exists anywhere else. If both the Master Password and Recovery Key are lost, the encrypted data cannot be decrypted — the direct consequence of real encryption.

Because encryption happens at the data layer, TextSandbox suits notes, drafts, personal documents or work data you would rather not keep as plain text on your machine or in the cloud.

Recovery Key & auto-lock

Two layers guarding access

When you create a Vault, TextSandbox issues a Recovery Key — the only second path to the Vault's decryption key if you forget the Master Password. It should be stored offline, separate from the Vault, and is never sent to the cloud.

The app can also lock itself after a period of inactivity. When you close the window, TextSandbox saves your edits and workspace state, confirms the Vault is safely locked, and only then exits.

Never store the Recovery Key inside the very Vault it is meant to recover.

Vault states

Locked

Content sits on disk in encrypted form. It cannot be decrypted without the Master Password or Recovery Key.

Unlocked

Content is decrypted in memory so you can work. Autosave re-encrypts every change before writing it back into the Vault.

Auto-lock

After the idle period you configured, the Vault returns to the locked state and the decryption key is discarded from memory.

On exit

Save edits, save workspace state, confirm the Vault is safely locked, then quit.

Threat model

What encryption protects — and what it does not

Encryption protects data while the Vault is locked, while it sits on disk, and when the .tsbx file is copied off the device. While the Vault is unlocked, content must be decrypted in memory so you can work — so some risks are things encryption simply cannot address.

Protected by encryption

  • A locked Vault file copied off the device.
  • Data stored long-term on disk.
  • Encrypted data sitting on the cloud service.
  • Someone accessing the machine while the Vault is locked.
  • Attempts to tamper with encrypted data (caught by the Poly1305 tag).

What encryption cannot address

  • Malware running on the machine.
  • Keyloggers capturing the Master Password.
  • Screen capture tools while the Vault is unlocked.
  • A compromised operating system.
  • A Master Password that is too weak or shared.

The SECURITY, PRIVACY and THREAT MODEL documents shipped with the product describe the scope in detail. For the latest versions, see textsandbox.com or contact cuongtechnology@gmail.com.

Where does data live?

ItemOn deviceIn the cloud
Document contentEncryptedOnly with Sync on — encrypted
Document titlesEncryptedOnly with Sync on — encrypted
AttachmentsEncryptedOnly with Sync on — encrypted
Version historyEncryptedOnly with Sync on — encrypted
Workspace stateEncryptedOnly with Sync on — encrypted
Readable contentIn memory only while unlockedNever
Master PasswordNever stored (Argon2id)Never
Recovery KeyStored offline by youNever

Privacy

Local-first, locally encrypted, no account required

You can use TextSandbox entirely locally: no account, no internet connection, and no cloud plan — the full encryption still happens on your machine. Cloud Sync is an optional add-on, never a requirement for using the app.

  • The local Vault is always encrypted, even if you never use the cloud.
  • Autosave re-encrypts your data before every write to disk.
  • The encryption key is derived on the spot from your Master Password — no server involved.
  • You decide when encrypted data leaves your device.

Practices worth following

Encryption is strongest when combined with the right habits.

Never share your keys

Do not share the Master Password or Recovery Key with anyone.

Use a strong Master Password

Argon2id greatly slows brute-force guessing, but the strength of your password is still the deciding factor.

Keep the key outside the Vault

Never store the Recovery Key inside the Vault it is meant to recover.

Always keep a backup

Keep at least one Vault backup in a safe location.

Lock before you leave

Lock the Vault before stepping away from a shared device.

Understand the trade-off

Losing both the Master Password and Recovery Key means the content cannot be recovered.

Turn on auto-lock

Configure an idle timeout that matches your working environment.

Questions about the encryption or its scope?

Reach out to the author directly — every encryption and security report is reviewed carefully.