RECITALS Cryptography Manager¶
The RECITALS Cryptography Manager (CrM) is a modular Python library and REST service that brings privacy-preserving and cryptographic operations to the RECITALS platform behind a single, uniform interface. Rather than implementing cryptography itself, it wraps vetted open-source backends and adds what a platform component needs around them: parameter validation, privacy budget accounting, a sanitised audit trail, and token-based authorization.
It can be used either as a Python library, imported directly into a data processing pipeline, or as a containerised REST service that other platform components call over HTTP.
Supported Techniques¶
- Differential privacy: Adds calibrated statistical noise to aggregate queries so that the presence or absence of any single record has a negligible effect on the result. The strength of the guarantee is controlled by the privacy parameter ε, and every query's cost is deducted from a per-user budget that the service enforces.
- Authenticated encryption: Protects data at rest and in transit using vetted AEAD primitives, binding each ciphertext to its context so it cannot be silently replayed elsewhere.
- Key management: Generation, serialisation, loading and rotation of keysets. Rotation retains previous keys, so data encrypted before a rotation stays readable afterwards.
Implementation Status¶
| Operation | Backend | Library | REST | Status |
|---|---|---|---|---|
| Differential privacy | PyDP | yes | yes | Implemented |
| Encryption / decryption | Google Tink | yes | yes | Implemented |
| Key management | Google Tink | yes | yes | Implemented |
| Homomorphic encryption | Pyfhel | no | no | Not implemented — returns 501 |
| Secure multi-party computation | MPyC | no | no | Not implemented — returns 501 |
Homomorphic encryption and secure multi-party computation are recognised operations with a settled request shape, so adding them means writing one adapter each rather than reworking the interface.
The Cryptography Manager delegates all cryptographic work to established open-source libraries, so that the privacy and security guarantees rest on implementations that have been reviewed far more widely than this component could be.
Core Libraries¶
|
PyDP
A Python wrapper around Google's differential privacy library, providing ε-differentially private aggregate statistics with noise calibration and sensitivity analysis inherited from a well-reviewed implementation. |
Google Tink
A misuse-resistant cryptographic library. Algorithm parameters, nonce generation and ciphertext tagging are handled internally, and only vetted primitives are reachable, leaving little room for the implementation errors that break real systems. |
Python Infrastructure¶
The manager leverages a modern Python stack for performance and reliability:
- FastAPI: The REST service and its generated OpenAPI documentation.
- Pydantic: Request, response and configuration validation.
- PyJWT: Bearer token signature and expiry verification.
- HTTPX: Forwarding audit records to downstream platform services.
- Loguru: Structured application logging.
- Pytest: Automated testing and quality assurance.
Contributors¶
| Name | Role | Contact |
|---|---|---|
| Konstantinos Chousos | Development | kchousos@di.uoa.gr |
| Dimitrios Pavlou | Development | dimpavlou@di.uoa.gr |
| George Stamoulis | Supervision | gstam@di.uoa.gr |
Funding¶
This work is part of the RECITALS project, funded by the European Union under Horizon Europe grant agreement No. 101168490.