Cryptographic Algorithms used in Gankpo
Modern, standardized cryptographic building blocks aligned with ANSSI recommendations
Gankpo relies exclusively on modern, standardized cryptographic building blocks aligned with ANSSI recommendations and industrial standards. The core implementation relies on the following algorithms:
1. Hashing (Hash)
- • Calculation of payload fingerprint (file content)
- • Calculation of header checksum
- • Nonce derivation in certain flows
- • Support for fast file comparison and internal integrity
Rust Library: blake3
- • Used notably for SPKI pinning in PKI (pin_sha256)
- • Support for X.509 certificates and certain external integrations
Rust Library: sha2
2. Digital Signature
Ed25519 (modern elliptic curve)
Signature of the full GKP:
header || metadata || encrypted_payload || payload_hashPublic Key
32 bytes
Signature
64 bytes
Rust Library
ed25519-dalek
Guarantees the authenticity of the electronic original and the identity of the signer
3. AEAD Encryption (Authenticated Encryption with Associated Data)
Payload encryption (file content)
Benefits from hardware support (AES-NI) on many platforms
Rust Library: aes-gcm
Modern alternative to AES-256-GCM
Particularly suitable for environments without AES acceleration
Rust Library: chacha20poly1305
4. Key Derivation (KDF)
Master derivation from a password
Resistant to GPU/ASIC attacks (OWASP compliant)
Rust Library: argon2
Content key derivation
Rust Library: hkdf
5. Encoding / Serialization
Canonical CBOR (RFC 8949 §4.2)
Serialization of GKP metadata
- ✓Strict lexicographical sorting of keys
- ✓Minimal encoding, strict UTF-8
- ✓Allows a stable and verifiable representation of metadata
Rust Libraries: ciborium, serde_cbor
6. Integrity Verification
CRC32
- • Fast corruption detection on certain structures
- • Used in addition to BLAKE3 for header checksum
- • Lightweight and fast checks
CRC32 offers basic and ultra-fast corruption detection, while BLAKE3 ensures strong cryptographic verification.
7. PKI & Timestamping
- • PKI certificate management, certificate chains
- • OCSP/CRL validation
- • Extended Key Usage (EKU) adapted for document signing
Rust Libraries: x509-parser, der-parser
Time Stamping Authority
- • TSA token encoded in DER
- • Timestamping of the BLAKE3 hash of the payload
- • Proves that at a given time, the file possessed this fingerprint
Guarantees the creation or signature date of the document
Summary by function
| Function | Main algorithm | Alternative |
|---|---|---|
| Hashing | BLAKE3 | SHA-256 |
| Signature | Ed25519 | — |
| AEAD Encryption | AES-256-GCM | ChaCha20-Poly1305 |
| KDF (password) | Argon2id | — |
| KDF (content) | HKDF | — |
| Serialization | Canonical CBOR | — |
| PKI / Certificates | X.509 | — |
Design Choices
Why these algorithms?
BLAKE3
Faster than SHA-256, parallelizable, modern security
Ed25519
Fast signatures, short keys (32 bytes), widely audited
AES-256-GCM / ChaCha20-Poly1305
Modern AEAD standards, hardware support or optimized
Argon2id
Recommended by OWASP for password derivation, resistant to GPU/ASIC attacks
HKDF
Safe derivation of multiple keys from a single master key
Compliance and Best Practices
All algorithmic choices are aligned with ANSSI recommendations and international best practices for document proof and signature systems.