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 | :white_check_mark: | :white_check_mark: | :warning: |
| No model weights | :white_check_mark: | :white_check_mark: | :x: |
| Multi-speaker, per-speaker keys | :white_check_mark: | :x: | :x: |
| Automatic VAD (ignores noise) | :white_check_mark: | :x: | :x: |
| Natural-sounding output | :white_check_mark: | :x: | :white_check_mark: |
| Deterministic / auditable | :white_check_mark: | :x: | :x: |
| Cryptographically one-way | :white_check_mark: | :x: | :x: |
| Real-time microphone support | :white_check_mark: | :white_check_mark: | GPU |
How It Works
Chimera applies six processing stages to every audio input:
Input audio
|
v [1] VAD -- isolates speech from noise, music, silence
|
v [2] Diarization -- MFCC k-means, assigns segments to speakers
|
v [3] Key Derivation -- HKDF-SHA256 per speaker -> 5 parameters
|
v [4] Voice Transform (Praat LPC source-filter model)
| Pitch shift via PSOLA resynthesis
| Formant shift via LPC vocal-tract length scaling
|
v [5] COWL -- Cryptographic One-Way Layer
| Sub-perceptual spectral noise (SSNI)
| Micro phase perturbation (MPP)
|
v [6] Cross-fade stitching + level matching
|
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.91234x
# Spectral tilt : -1.214 dB/kHz
# Breathiness : 0.0812
# 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:
- Key-seeded micro phase perturbation (requires HKDF seed)
- Key-derived sub-perceptual noise injection (requires HMAC sub-key)
- Praat LPC pitch + formant transform (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 # Praat LPC source-filter voice transform
| |-- 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
|-- 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, voice transformation 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.2.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.2.0.tar.gz.
File metadata
- Download URL: chimera_voice-0.2.0.tar.gz
- Upload date:
- Size: 77.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a776a67bc3edac02c4ee7d1787b5830d847cbd8ac2253558fffb9eb1778b067
|
|
| MD5 |
f319b3d951a0a86d89d9b10b1afb959c
|
|
| BLAKE2b-256 |
0c952d0940e1d2d66be1edfb4004f851f8465a21018839768480ff7cd8c10308
|
Provenance
The following attestation bundles were made for chimera_voice-0.2.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.2.0.tar.gz -
Subject digest:
5a776a67bc3edac02c4ee7d1787b5830d847cbd8ac2253558fffb9eb1778b067 - Sigstore transparency entry: 1092531140
- Sigstore integration time:
-
Permalink:
Ohswedd/chimera@d5d7b44937a67b64383d24b07f5bc5d73c6d84f6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Ohswedd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d5d7b44937a67b64383d24b07f5bc5d73c6d84f6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chimera_voice-0.2.0-py3-none-any.whl.
File metadata
- Download URL: chimera_voice-0.2.0-py3-none-any.whl
- Upload date:
- Size: 32.8 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 |
c533157a226834b2341a5dad829e3cfc91bedd6f3f32296801010dd5b7b8a79f
|
|
| MD5 |
87b319c295761eaa62eaef4ceec2ef6f
|
|
| BLAKE2b-256 |
18ae06136397685dfadaee7194cbd4c3afa6ca3f81fc215a285aea55253fbcf3
|
Provenance
The following attestation bundles were made for chimera_voice-0.2.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.2.0-py3-none-any.whl -
Subject digest:
c533157a226834b2341a5dad829e3cfc91bedd6f3f32296801010dd5b7b8a79f - Sigstore transparency entry: 1092531143
- Sigstore integration time:
-
Permalink:
Ohswedd/chimera@d5d7b44937a67b64383d24b07f5bc5d73c6d84f6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Ohswedd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d5d7b44937a67b64383d24b07f5bc5d73c6d84f6 -
Trigger Event:
push
-
Statement type: