This page is docs/WHITEPAPER.md in the repository. The repository copy is the source; this is the same text with its links rewritten for the wiki.
VeilVoice: what it destroys, what it keeps, and why
Updated 2026-08-16, covering the tree as it stands including at-rest encryption by default and the app lock. This document is the honest version of the pitch. It states what VeilVoice guarantees, how, and, at least as importantly, what it does not. A privacy tool that overstates its reach is worse than none, because someone will rely on the part that was never true.
1. The goal, and the contradiction in the obvious version of it
The intuitive ask is "make it impossible to isolate my voice, fill the whole spectrogram with noise." That cannot be built, because it conflicts with the other half of the requirement. Audio that stays understandable and transcribable must carry the phonemes; noise that covers the phonemes covers the words. The two goals are mutually exclusive, and no amount of engineering reconciles them.
So VeilVoice targets the achievable and genuinely useful goal:
Irreversible destruction of the speaker's identity, with intelligibility preserved on purpose.
The voiceprint, meaning fundamental pitch, formant structure, timbre, micro-timing and the melody of an accent, is destroyed. The words survive. If the message also needs to be secret, that is a different problem with a different solution: encrypt it.
2. Threat model
Assumed adversary. Holds the output audio. Has unlimited compute, the full VeilVoice source, and knowledge of every parameter except the per-session random seed. May hold reference recordings of the target speaker and use state-of-the-art speaker-recognition models. May store the file indefinitely, including until a cryptographically relevant quantum computer exists.
In scope. Recovering the original waveform. Recovering the speaker's biometric voiceprint. Matching the output against a reference recording of the same speaker.
Explicitly out of scope.
- The words. Preserved deliberately. See "If the message must be secret too" below.
- Background content. Room acoustics, a doorbell, a colleague's voice, a regional siren. VeilVoice processes the whole signal but does not attempt scene sanitisation. Check what else is in your recording.
- An attacker already on your machine. If they can read process memory or tap the microphone before VeilVoice does, nothing here helps. The app lock (§8) raises the bar against someone who merely sits down at an unlocked session; it does nothing against someone running code as you, and does not claim to.
- Metadata outside the file. Filenames, filesystem timestamps and the channel you send it over.
veilvoice-metacleans metadata inside the file only.
3. Why the transform is one-way
Three independent mechanisms, each individually lossy. Reversal requires defeating all three.
3.1 Phase is discarded every frame
For each STFT frame VeilVoice keeps only the magnitude spectrum and throws away the measured phase. Phase encodes the precise waveform and the speaker's micro-timing, the excitation pattern that makes one glottis distinguishable from another.
This is not obfuscation, it is deletion. The information is never written down, never stored, and never derivable from what remains: an infinite family of waveforms shares any given magnitude spectrogram. A fresh, synthetic phase is generated in its place.
3.2 Every speaker is collapsed onto one canonical identity
Three of the strongest biometric features are normalised, not randomised:
| Feature | What happens |
|---|---|
| Pitch register | Mapped to one constant canonical fundamental |
| Vocal-tract length | Warped so the long-term formant centroid hits one canonical value |
| Long-term spectral tilt | Rotated onto one canonical slope |
Each mapping is many-to-one. A whole population of speakers lands on the same output value, so the original cannot be inferred from the result: there is nothing to invert, only a value that many inputs share. This is strictly stronger than randomising those features, which would merely displace them.
Crucially, every correction is derived from a multi-second average, never from the current frame. Per-frame spectral shape is what distinguishes /i/ from /u/; normalising it frame-by-frame would erase the vowels along with the accent. The engine's test suite asserts that vowel contrast survives.
3.3 The residual transform is non-stationary and CSPRNG-driven
The formant ratio changes every frame, drawn from a ChaCha20 stream whose 32-byte seed comes from the OS CSPRNG, lives only in page-locked RAM, and is zeroized on drop. There is no single fixed transform to undo, and the sequence is unknowable without the seed, which is never written anywhere.
The per-bin synthesis phase offsets come from the same stream.
3.4 The seed rolls forward
The stream does not run for the whole session. Every two seconds by default, the modulator draws a fresh 32-byte seed from its own output and restarts on it. ChaCha20 cannot be run backwards, so this is a ratchet: an adversary who somehow obtained the current state could produce everything from that moment on and still could not reconstruct the modulation of any earlier segment. A long recording is therefore not one key stream but a chain of short ones, each sealed permanently once it has passed.
The interval is configurable, including off. Rolling is inaudible by construction, because the smoothed parameters are never reset, only their source of future targets, and the per-bin phase offsets ease to their new values over about half a second rather than stepping. Both properties are asserted in the test suite, one of them by comparing the worst sample-to-sample jump against a non-rolling run.
The seed is deliberately not re-read from the OS CSPRNG on each roll. That would put a syscall inside an audio callback every couple of seconds, and it would make deterministic runs impossible, which the reproducible-build story depends on. The OS seeds the chain once; the ratchet carries it forward.
4. Accent: what is removed, and the limit
Accent is carried by two different kinds of cue, and they get different answers.
Suprasegmental cues: removed. Intonation contour, pitch range, voice quality, and the vocal-tract scale behind a speaker's vowel space. These are properties of the signal, and the normalisation described above collapses all of them.
Segmental cues: cannot be removed. Which phonemes the speaker actually produced: rhoticity, vowel mergers, dental-fricative substitution, aspiration patterns. At this level the accent is the words. Changing it means deciding that a different phoneme was said, which no filter can do: it requires recognising the speech and re-synthesising it.
Therefore: a strong regional accent may still be audible in the output, even though its melody and colour are gone. VeilVoice does not claim otherwise. The planned text-to-speech mode closes this gap completely, because it never carries the original signal at all.
5. Synthesis, and an honest note on how it sounds
Voiced frames are resynthesised as an ideal harmonic comb at the canonical fundamental, quantised to the nearest FFT bin, passed through the (warped, tilt-corrected) formant envelope. This is the textbook source-filter model.
Two consequences worth stating plainly:
- The output has a synthetic, even quality. Pitch is constant by design. This is the sound of the identity being gone, not a defect.
- Pitch resolution is limited by the bin grid (46.875 Hz at the 48 kHz / 1024 default), so the canonical register lands on the nearest bin. Irrelevant when flattening fully, which is the default; partial flattening steps rather than glides. Lifting this needs window-kernel synthesis, which is future work.
Unvoiced frames keep a channel-vocoder phase, which is the correct model for fricatives and noise.
6. What an attacker can still learn
Stated so nobody is surprised:
- The words. By design.
- Speaking rate and rhythm. VeilVoice does not time-warp. Rate is a weak biometric but a real one, and it survives.
- Language, dialect vocabulary, and idiolect. Word choice is content.
- **Whether two outputs came from the same session.** Within one session the seed is fixed. Different sessions are unlinkable; a single long recording is internally consistent.
- Coarse voice-activity structure, meaning when you spoke and when you did not.
7. The message, and why it is encrypted by default
De-identification and confidentiality are separate problems. The engine solves only the first: the words survive on purpose, so a veiled recording sitting on a disk is still a recording of everything that was said. Writing it in the clear by default would leave the second problem silently unsolved for everyone who did not think to ask.
So veilvoice anonymise seals its output into a .veil container, and the desktop app does the same. Turning that off is possible and prints what is being given up first: the CLI waits for the word UNENCRYPTED on a terminal; the GUI opens a dialogue that must be answered before the tick box changes.
The WAV is encoded in memory and sealed there. An encrypted recording never exists on disk in the clear, not even briefly. This matters more than it sounds: a plaintext file that is written and then deleted cannot be reliably taken back on flash storage, because wear levelling leaves the original blocks in cells no write can reach, and the argument is set out in full in veilvoice-crypto's shred module.
The primitives:
- Argon2id (RFC 9106 profile) for password-derived keys.
- X25519 + ML-KEM-768 hybrid for public-key encryption. Hybrid because ML-KEM is young and X25519 falls to a quantum adversary; breaking the construction requires breaking both. This matters for harvest-now-decrypt-later: a recording stored today may be attacked decades from now.
- XChaCha20-Poly1305 for the payload, with random 192-bit nonces, and the full container header authenticated as associated data, so an attacker cannot downgrade the stored KDF cost to make cracking cheap.
- Page-locked, zeroizing secrets, so keys do not reach the swap file. Locking does not survive hibernation and does not stop an attacker who can already read process memory;
Secret::is_lockedreports whether it actually succeeded rather than assuming.
Except in a browser, where there is nothing to lock: a WebAssembly module is handed one linear memory by the host and has no mlock and no page file of its own, so that build locks nothing and is_locked answers false everywhere, which is the same answer a Linux machine out of RLIMIT_MEMLOCK budget has always given. Everything else a Secret does it still does there: it wipes on drop, it compares in constant time, and it refuses to print itself. That is a real reduction, so it is written here rather than left to a cfg, and it is written at greater length in veilvoice-crypto's amnesia module note. The only build it applies to is the demonstration of the interface that roadmap item 177 puts on the website, which holds no recording and no passphrase anybody wants kept out of a page file. A browser is somewhere to look at VeilVoice, not somewhere to open a vault.
One caveat that is stated rather than engineered around: a passphrase being typed into a text field or a terminal prompt lives in an ordinary string, because something has to receive the keystrokes. It is moved into a page-locked Secret the moment it is confirmed and the buffer is wiped, so the exposure lasts as long as the typing rather than as long as the session, but for those moments it is ordinary memory and could reach swap. Closing the gap entirely needs a custom text widget nobody would audit, which is a worse trade than saying so here.
8. The app lock, and exactly what it is worth
VeilVoice can be put behind a password of its own, so that someone who picks up your unlocked computer cannot open it, see which files you have processed, or start a live scramble.
This is not tamper-proof, and cannot be. A local application has nowhere to hide a secret from the machine it runs on. Whoever can read the lock file can also delete it, and deleting it removes the lock. That is not a gap in the implementation; it is what a local lock is. The unlock screen says so on the screen itself rather than in a footnote.
What it is, concretely:
- An Argon2id verifier, not a key.
Argon2id(domain ‖ password, salt)is stored and compared in constant time. It deliberately encrypts nothing, because there is nothing here it could usefully encrypt, and implying otherwise would be the overclaim this document exists to avoid. - Rate limited, and the limit is persisted. Three attempts are free; after that the wait doubles: 5 s, 10 s, 20 s … capped at fifteen minutes. The count is written to disk after every attempt, so killing the process does not hand an attacker a fresh budget.
- A separate password from the recording one. Unlocking the app is not the same act as unsealing everything it has ever written. The verifier is domain-separated, so a user who types the same passphrase in both places still does not end up with two copies of one value.
What it is not:
- Not a defence against someone holding the disk. They can delete the lock file, edit the attempt counter, move the clock to defeat the wait, or attack the stored hash offline. Argon2id at 256 MiB makes each offline guess expensive, which helps a good passphrase and does not save a bad one.
- Not disk encryption. If the disk is the threat, use LUKS, BitLocker or FileVault, and encrypt the recordings themselves, which VeilVoice now does by default.
9. Verifying these claims yourself
Nothing here asks for trust:
cargo test --workspace # the properties above are asserted in tests
cargo run -p veilvoice-core --example spectrum_report
spectrum_report prints where the output partials land, demonstrating the synthesis behaviour directly. The engine's tests assert speaker convergence, vowel-contrast survival, gain neutrality and real-time performance. The crypto tests assert header-downgrade detection, tamper detection on each half of the hybrid, and that a wiped secret is actually wiped.
The honest statements above are asserted too, not merely written down: tests check that at-rest encryption is still the default, that a job refuses to start with encryption on and nothing to encrypt with, that the app lock's rate limit has the shape claimed here and survives a reload, and that the warning texts still say the uncomfortable part rather than having been softened into reassurance.
VeilVoice contains no unsafe code. Every crate carries #![forbid(unsafe_code)], including the page-locking path.
10. Status of this document
This is a design and rationale document, not a peer-reviewed security proof. The de-identification argument rests on information destruction that is easy to verify by reading spectral.rs and accent.rs; the cryptography uses standard, well-reviewed primitives from the RustCrypto and dalek ecosystems rather than anything invented here.
The code has been audited by tilas01, who wrote and reviewed it. That is a maintainer audit and is worth exactly what a maintainer audit is worth: it catches what the author can see. No external firm or independent researcher has reviewed this code, and until one has, the strongest verification available to you is the source itself, which is why it is written to be read.
How much that caveat is worth is now a measured quantity rather than a modest noise. The latest audit round, covering parser fuzzing, timing measurement, an adversarial read of the DSP and hostile-input testing of the website, found seven defects in code the previous round had called clean. None broke confidentiality; two aborted the process on a crafted file and one silently turned every subsequent recording into noise. All are fixed and written up in docs/AUDIT.md, including the ones that make the earlier "no vulnerabilities found" look complacent. Better tools found what careful reading had not, which is the argument for someone outside the project looking next.
This page is also Doc-WHITEPAPER in the GitHub wiki, and both are generated from the same document in the repository.