🎧 Listen to this article: English
🌍 Read this in your language: हिंदी · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം · ଓଡ଼ିଆ · 日本語 · 中文
In today's digital world, privacy is more important than ever. As of 24 November 2026, many people are looking for ways to keep their data secure, especially when using tools like UndoHaven. This article explains how UndoHaven encrypts snapshots so that a host never sees file names.
What is UndoHaven?
UndoHaven is an unofficial third-party command-line interface (CLI) for dsh, which is a local agent runtime. It allows users to create encrypted snapshots of their dsh home directories. This includes important files like AGENTS.md and the skills/ directory located under ~/.agents. The snapshots are stored locally and can be restored later without needing an account or network access.
How Does UndoHaven Encrypt Snapshots?
The encryption process in UndoHaven is designed to keep your data safe. Here’s how it works:
Step 1: Create a Snapshot
To start, you can create a snapshot using one of the following commands:
npx undohaven init
undohaven snapshot
This generates an encrypted snapshot stored under $DSH_HOME/undohaven or ~/.dsh/undohaven if DSH_HOME is not set.
Step 2: Generate a Data Key
When you create a snapshot, a 32-byte data key is generated by the client. This key is essential for encrypting your files.
Step 3: Wrap the Passphrase
The passphrase you choose is stretched using a method called Argon2id. This involves using 64 MiB of memory, running 3 iterations, and applying parallelism. The result is a wrapping key that encrypts the data key using AES-256-GCM, a strong encryption standard.
Step 4: Create a Recovery Code
A 24-word recovery code is also generated. This code is formatted in a specific way called BIP39 and provides additional security. It wraps the data key a second time using HKDF-SHA256, which is another secure method.
Step 5: Derive Additional Keys
From the data key, three more keys are derived using HKDF-SHA256. These keys serve different purposes:
- One for encrypting chunks of data.
- One for encrypting the manifest (which contains metadata about the files).
- One for naming the chunks.
Step 6: Chunking and Compression
Files are split into smaller pieces, known as chunks, using a method called FastCDC. This helps manage file sizes effectively. Each chunk is then optionally compressed if it meets certain size criteria.
Step 7: Sealing and Padding
Each chunk is sealed with a combination of metadata and encrypted content. This includes a version byte, a nonce (a random number used once), and an AES-256-GCM ciphertext. The sealed chunks are padded to a size that is a multiple of 64 KiB to ensure consistency.
Step 8: Encrypt the Manifest
The manifest, which contains paths and sizes of the files, is encrypted using one of the derived keys. This means that even the list of files is kept private.
What Happens During Restoration?
When you want to restore a snapshot, you need to first quit dsh. The command for restoration is:
undohaven restore --to SNAPSHOT_ID
This ensures that the restoration process does not interfere with any ongoing sessions. UndoHaven checks if dsh is running and will not proceed until it is safe to do so.
Conclusion
UndoHaven provides a robust way to keep your data secure through encryption. By ensuring that file names and contents are not visible to the host, it protects your privacy effectively.
Merits
- Strong encryption methods keep data secure.
- Snapshots can be created and restored without needing an account.
- Local storage means no reliance on external servers.
Demerits
- Requires understanding of command-line tools.
- If you lose both the passphrase and recovery code, data cannot be recovered.
Caution
This article is for educational purposes only. Always replace placeholder values with your actual data and verify any claims against original sources before relying on them.
Frequently asked questions
- What is UndoHaven? — UndoHaven is a command-line tool that allows users to create encrypted snapshots of their dsh home directories.
- How does UndoHaven ensure file names are private? — It uses strong encryption methods to prevent the host from accessing file names or contents.
- What command do I use to create a snapshot? — You can use
npx undohaven initorundohaven snapshotto create a snapshot. - What happens if I lose my passphrase? — If you lose both the passphrase and recovery code, you cannot recover your data.
- Can I restore a snapshot while dsh is running? — No, you must quit dsh before restoring a snapshot.
- What encryption methods does UndoHaven use? — It uses AES-256-GCM and Argon2id for secure encryption.
Tags
#encryption #security #cli
API Security Testing Checklist
A practical workflow for testing authentication, authorization, input handling, business logic, and evidence without losing track of scope.
Free. No spam — unsubscribe in one click.


Responses
Sign in to leave a response.