Cryptographically irreversible, speaker-aware voice anonymisation
Project description
๐ฆ Chimera
Cryptographically Irreversible, Speaker-Aware Voice Anonymisation
Chimera disguises the identity of one or more speakers in any audio recording. It runs entirely on CPU, requires no cloud services, no GPU, and no pre-trained model weights. Given only the output audio and any key, no known algorithm can recover the original speaker's acoustic identity.
Wiki ยท Quick Start ยท Paper
Why Chimera?
| Feature | Chimera | Pitch shift | Neural VC |
|---|---|---|---|
| Fully local / offline | โ | โ | โ ๏ธ |
| No model weights | โ | โ | โ |
| Multi-speaker, per-speaker keys | โ | โ | โ |
| Automatic VAD (ignores noise) | โ | โ | โ |
| Natural-sounding output | โ | โ | โ |
| Deterministic / auditable | โ | โ | โ |
| Cryptographically one-way | โ | โ | โ |
| Real-time microphone support | โ | โ | GPU |
How It Works
Chimera applies six processing stages to every audio input:
Input audio
โ
โผ [1] VAD โ isolates speech from noise, music, silence
โ
โผ [2] Diarization โ MFCC k-means, assigns segments to speakers
โ
โผ [3] Key Derivation โ HKDF-SHA256 per speaker โ 8 parameters
โ
โผ [4] 7-Layer Vocoder Stack (WORLD)
โ L1 Pitch shift F0 ร 2^(ฮst/12)
โ L2 Sinusoidal vibrato modulation
โ L3 Micro-temporal jitter
โ L4 Formant warp SP resampled at ฮฑยทf
โ L5 Spectral tilt ยฑ4 dB/kHz ramp
โ L6 Sub-harmonic injection
โ L7 Breathiness blend toward noise
โ
โผ [5] COWL โ Cryptographic One-Way Layer
โ Sub-perceptual spectral noise (SSNI)
โ Phase randomisation
โ Non-linear spectral quantisation (NLSQ)
โ
โผ [6] Cross-fade stitching + normalisation
โ
Output audio (mono float64, same sample rate)
All randomness is derived from the key via HKDF, making the transformation fully deterministic and fully one-way: same key โ same output; output โ original is computationally infeasible.
Installation
pip install chimera-voice
With real-time microphone support:
pip install "chimera-voice[realtime]"
From source:
git clone https://github.com/Ohswedd/chimera
cd chimera
pip install -e ".[dev]"
Quick Start
Anonymise a file
import chimera
chimera.mask_file("interview.wav", "anonymous.wav", key="my-secret", preset="strong")
Work with NumPy arrays
import chimera
import soundfile as sf
audio, sr = sf.read("interview.wav")
result = chimera.mask_array(audio, sr, key="my-secret", preset="strong")
sf.write("anonymous.wav", result.audio, sr)
Multi-speaker: independent key per speaker
result = chimera.mask_array(
audio, sr,
key = "my-secret",
preset = "moderate",
mode = chimera.MaskMode.ALL_UNIQUE, # default
n_speakers = 3,
)
print(result.speakers_masked) # ['SPEAKER_0', 'SPEAKER_1', 'SPEAKER_2']
print(f"Processed in {result.processing_time_s:.2f}s")
Mask only selected speakers
result = chimera.mask_array(
audio, sr,
key = "my-secret",
preset = "strong",
mode = chimera.MaskMode.SELECTED,
speaker_ids = ["SPEAKER_0"], # only mask speaker 0
)
Real-time microphone
from chimera.realtime import RealtimeAnonymiser
anon = RealtimeAnonymiser(key="my-secret", preset="moderate")
anon.start()
input("๐ Recording โ press Enter to stop...")
anon.stop()
anon.save("recorded_anonymous.wav")
Streaming (generator-based)
from chimera.realtime import mask_stream
for masked_chunk in mask_stream(my_chunk_generator, sr=22050,
key="my-secret", preset="strong"):
send_to_output(masked_chunk)
Inspect parameters
p = chimera.get_params("my-secret", preset="strong")
print(p.summary())
# Chimera MaskParams
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Speaker label : (none)
# Pitch shift : +5.743 st
# Formant warp : 0.91234ร
# Spectral tilt : -2.814 dB/kHz
# Breathiness : 0.3122
# Temporal jitter : 0.01203 ฯ
# Vibrato rate : 4.210 Hz
# Vibrato depth : 0.2891 st
# Subharmonic mix : 0.0984
# Master intensity : 0.780
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Presets
| Preset | Intensity | ASV EERโ | Use case |
|---|---|---|---|
whisper |
0.12 | ~5 % | Soft watermarking |
subtle |
0.28 | ~15 % | Light disguise |
moderate |
0.52 | ~35 % | Speaker unrecognisable to humans |
strong |
0.78 | ~48 % | ASV systems fail |
extreme |
1.00 | ~50 % | Maximum โ content only |
โ Indicative Equal Error Rate against ECAPA-TDNN (VoicePrivacy 2024 protocol).
MaskMode
| Mode | Behaviour |
|---|---|
MaskMode.ALL_UNIQUE |
Each speaker gets independent parameters (default) |
MaskMode.ALL_SAME |
All speakers share the same transformation |
MaskMode.SELECTED |
Only speakers listed in speaker_ids are masked |
Security
Chimera is designed with three security properties:
Determinism โ F(audio, key) always returns the same output.
Every bit of randomness is derived from the key via HKDF-SHA256.
One-way โ Given F(audio, key), recovering the original speaker's acoustic identity requires simultaneously inverting:
- Non-linear ฮผ-law spectral quantisation (ill-posed)
- Key-seeded phase randomisation (requires HKDF seed)
- Key-derived sub-perceptual noise injection (requires HMAC sub-key)
- Seven vocoder transformation layers (non-invertible without all params)
Key independence โ HKDF-SHA256 provides 128-bit second-preimage resistance.
Per-speaker keys are domain-separated: key + ":chimera:spk:" + speaker_id.
โ ๏ธ Chimera is a privacy-enhancing tool, not an encryption scheme. For high-stakes deployments, combine it with access control, key rotation, and additional anonymisation measures. See the Security wiki page for the full threat model.
Supported Audio Formats
Any format supported by libsndfile: WAV, FLAC, OGG, AIFF, and more.
Supported sample rates: 8 000, 16 000, 22 050, 24 000, 44 100, 48 000 Hz.
Project Structure
chimera/
โโโ chimera/ # Library source
โ โโโ __init__.py # Public API surface
โ โโโ core.py # High-level functions: mask_file, mask_array, get_params
โ โโโ pipeline.py # ChimeraPipeline โ full orchestration
โ โโโ keygen.py # HKDF-SHA256 parameter derivation
โ โโโ vad.py # Voice Activity Detector
โ โโโ diarize.py # MFCC k-means speaker diarizer
โ โโโ transform.py # 7-layer WORLD vocoder stack
โ โโโ irreversible.py # Cryptographic One-Way Layer (COWL)
โ โโโ realtime.py # Real-time microphone / streaming engine
โ โโโ presets.py # Named intensity presets
โ โโโ types.py # MaskParams, ChimeraResult, MaskMode, โฆ
โ โโโ exceptions.py # Exception hierarchy
โ โโโ py.typed # PEP 561 marker
โโโ tests/ # Full test suite (26 tests)
โโโ examples/ # Runnable usage examples
โโโ docs/ # Documentation
โโโ benchmarks/ # Performance benchmarks
โโโ paper/ # Academic paper (PDF)
โโโ .github/workflows/ # CI and release workflows
โโโ pyproject.toml
โโโ CHANGELOG.md
โโโ CONTRIBUTING.md
โโโ LICENSE
Development
Setup
git clone https://github.com/Ohswedd/chimera
cd chimera
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Run tests
pytest # all tests
pytest -m "not slow" # skip slow tests
pytest --cov=chimera # with coverage
Lint and format
black chimera tests examples
ruff check chimera tests examples
mypy chimera
Build distribution
pip install build
python -m build
Academic Paper
The full technical paper is available at paper/chimera_paper.pdf.
It covers the full threat model (A1โA4), HKDF key derivation, all seven vocoder layers, COWL security argument, diarization architecture, real-time latency profile, comparison with state-of-the-art, and 15 references.
Citation:
@software{chimera2026,
title = {Chimera: Cryptographically Irreversible Speaker-Aware Voice Anonymisation},
author = {Ohswedd},
year = {2026},
url = {https://github.com/Ohswedd/chimera},
version = {0.1.0},
license = {MIT}
}
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
License
MIT ยฉ 2026 Ohswedd
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chimera_voice-0.1.0.tar.gz.
File metadata
- Download URL: chimera_voice-0.1.0.tar.gz
- Upload date:
- Size: 80.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c409c75b8d0f0f57723969136588e278438a36454b8e033186511b5a918c47be
|
|
| MD5 |
f1e6385cc1637d34affd60da6bc0ee16
|
|
| BLAKE2b-256 |
5c56001f63fb33332c5e8acc24228e09f359ee16a01211e6b46e2a7185488f28
|
Provenance
The following attestation bundles were made for chimera_voice-0.1.0.tar.gz:
Publisher:
release.yml on Ohswedd/chimera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chimera_voice-0.1.0.tar.gz -
Subject digest:
c409c75b8d0f0f57723969136588e278438a36454b8e033186511b5a918c47be - Sigstore transparency entry: 1091635880
- Sigstore integration time:
-
Permalink:
Ohswedd/chimera@aceb18f366b222cfa68ab0c606ed9da8a3a74d01 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Ohswedd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aceb18f366b222cfa68ab0c606ed9da8a3a74d01 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chimera_voice-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chimera_voice-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a74c2a81fda12f5f2dc8a685be0d1ad8bbe281258784404ace9e28829de1a09a
|
|
| MD5 |
a6682b7e17cb24b78ae8a0012b0779a5
|
|
| BLAKE2b-256 |
b8a572598016ca84046857ea1abfa1d14dfcf6d8a3813ef12828e129710ed346
|
Provenance
The following attestation bundles were made for chimera_voice-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Ohswedd/chimera
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chimera_voice-0.1.0-py3-none-any.whl -
Subject digest:
a74c2a81fda12f5f2dc8a685be0d1ad8bbe281258784404ace9e28829de1a09a - Sigstore transparency entry: 1091635910
- Sigstore integration time:
-
Permalink:
Ohswedd/chimera@aceb18f366b222cfa68ab0c606ed9da8a3a74d01 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Ohswedd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aceb18f366b222cfa68ab0c606ed9da8a3a74d01 -
Trigger Event:
push
-
Statement type: