confium-examples 0.5.0

Runnable example binaries demonstrating Confium threshold cryptography
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python3
"""Differential privacy aggregation in Python."""

from confium.privacy import dp_query

true_count = 1234
epsilon = 0.5

# Each call adds fresh Laplace noise
for _ in range(5):
    noisy = dp_query(true_count, sensitivity=1, epsilon=epsilon)
    print(f"True: {true_count} → Published: {noisy:.2f}")

print("✅ DP aggregation demo complete.")