Integrity Guarantee - Authenticated Encryption Architecture
ANKASecure© ensures 100% cryptographic integrity verification for all encrypted data through mandatory AEAD (Authenticated Encryption with Associated Data) for every encryption the platform performs.
Executive Summary
ANKASecure© implements a zero-trust integrity model where every encryption operation produces an authentication tag that is cryptographically bound to the ciphertext. Decryption always validates this tag before returning plaintext data.
Key Guarantees:
- 100% of symmetric algorithms use AEAD modes (GCM, CCM, Poly1305)
- 100% of asymmetric algorithms use authenticated padding (OAEP) or hybrid AEAD
- 100% of Post-Quantum KEMs use AES-256-GCM for content encryption
- No code paths exist that return decrypted data without integrity verification
Authenticated Encryption Modes
GCM (Galois/Counter Mode)
Used by: AES, Camellia, SEED, SM4, ARIA
GCM provides simultaneous confidentiality and authenticity using a 128-bit authentication tag. The tag is computed over both the ciphertext and any associated data (AAD), ensuring that any modification to either component is detected.
Technical Parameters:
| Parameter | Value | Standard |
|---|---|---|
| Tag Length | 128 bits | NIST SP 800-38D (maximum recommended) |
| IV Length | 96 bits (12 bytes) | NIST SP 800-38D (recommended) |
| Block Size | 128 bits | Algorithm dependent |
Security Properties:
- Provides IND-CCA2 (Indistinguishability under Adaptive Chosen Ciphertext Attack)
- Detects bit-flip attacks with probability 1 - 2^(-128)
- Prevents ciphertext reordering and truncation attacks
- AAD binding prevents context manipulation
CCM (Counter with CBC-MAC)
Used by: AES, SM4, ARIA
CCM combines CTR mode encryption with CBC-MAC authentication, providing both confidentiality and authenticity in a single pass (with preprocessing).
Technical Parameters:
| Parameter | Value | Standard |
|---|---|---|
| Tag Length | 128 bits | IEEE 802.11i, RFC 3610 |
| Nonce Length | 7-13 bytes | Application dependent |
| Counter Size | 2-8 bytes | Determines max message size |
Security Properties:
- Provably secure under standard assumptions
- Suitable for constrained environments
- Resistant to timing attacks with proper implementation
Poly1305
Used by: ChaCha20-Poly1305
Poly1305 is a cryptographic message authentication code (MAC) designed for high-speed software implementations.
Technical Parameters:
| Parameter | Value | Standard |
|---|---|---|
| Tag Length | 128 bits | RFC 8439 |
| Key Length | 256 bits | Per-message key derivation |
| Nonce Length | 96 bits | RFC 8439 |
Security Properties:
- Information-theoretic security (given unique key per message)
- Constant-time implementation prevents timing attacks
- IETF standard for TLS 1.3
Asymmetric Algorithm Integrity
RSA-OAEP (Optimal Asymmetric Encryption Padding)
All RSA encryption in ANKASecure© uses OAEP with SHA-512, which provides:
- Plaintext-awareness: Attacker cannot create valid ciphertexts without knowing plaintext
- Padding oracle immunity: Invalid padding is indistinguishable from decryption failure
- IND-CCA2 security: Proven secure against adaptive chosen-ciphertext attacks
Configuration:
| Parameter | Value |
|---|---|
| Hash Function | SHA-512 |
| MGF | MGF1-SHA-512 |
| Label | Empty (default) |
ECDH-ES Key Agreement
Elliptic Curve Diffie-Hellman Ephemeral-Static key agreement uses:
- A256KW (AES Key Wrap): Includes 64-bit Integrity Check Value (ICV)
- Content Encryption: AES-256-GCM with 128-bit authentication tag
- Key Derivation: NIST Concat KDF with algorithm-specific context
Post-Quantum KEM Hybrid Encryption
All PQC KEMs (ML-KEM, HQC, FrodoKEM, BIKE, SABER, NTRU, etc.) use hybrid encryption:
- Key Encapsulation: KEM produces shared secret
- Key Derivation: HKDF-SHA256 derives content encryption key
- Content Encryption: Always AES-256-GCM with 128-bit tag
This ensures quantum-resistant key exchange combined with proven symmetric AEAD.
Authentication Tag Validation Architecture
Validation Flow
flowchart TD
A["/"<b>DECRYPTION REQUEST</b>"/"]
B["<b>1. Parse JWE/Ciphertext Structure</b><br/>• Extract IV, ciphertext, authentication tag<br/>• Validate header parameters"]
C["<b>2. Initialize AEAD Cipher</b><br/>• Load decryption key from keystore<br/>• Configure GCM/CCM/Poly1305 parameters<br/>• Set tag length to 128 bits"]
D["<b>3. Process Ciphertext + Tag</b><br/>• Concatenate ciphertext with authentication tag<br/>• Execute cipher.doFinal()"]
E{"<b>Tag Valid?</b>"}
F["<b>✓ SUCCESS</b><br/>Return plaintext"]
G["<b>✗ FAILURE</b><br/>AEADBadTagException<br/>→ HTTP 422<br/>'Integrity failed'"]
A --> B
B --> C
C --> D
D --> E
E -->|Yes| F
E -->|No| G
style A fill:#e1f5fe,stroke:#01579b,stroke-width:2px
style B fill:#fff3e0,stroke:#e65100,stroke-width:1px
style C fill:#fff3e0,stroke:#e65100,stroke-width:1px
style D fill:#fff3e0,stroke:#e65100,stroke-width:1px
style E fill:#fce4ec,stroke:#880e4f,stroke-width:2px
style F fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px
style G fill:#ffebee,stroke:#b71c1c,stroke-width:2px Constant-Time Comparison
All MAC/tag comparisons use constant-time algorithms to prevent timing attacks:
- Java's
MessageDigest.isEqual()for byte array comparison - No early-exit on mismatch
- Fixed execution time regardless of data content
Algorithm Coverage Matrix
Symmetric Algorithms (100% AEAD)
| Algorithm Family | Mode | Tag Size | Status |
|---|---|---|---|
| AES-128/192/256 | GCM | 128-bit | Active |
| AES-128/192/256 | CCM | 128-bit | Active |
| ChaCha20 | Poly1305 | 128-bit | Active |
| Camellia-128/192/256 | GCM | 128-bit | Active |
| SEED-128 | GCM | 128-bit | Active |
| SM4-128 | GCM | 128-bit | Active |
| SM4-128 | CCM | 128-bit | Active |
| ARIA-128/192/256 | GCM | 128-bit | Active |
| ARIA-128/192/256 | CCM | 128-bit | Active |
Asymmetric/Hybrid Algorithms (100% Authenticated)
| Algorithm | Integrity Mechanism | Tag/ICV Size |
|---|---|---|
| RSA-2048 to RSA-8192 | OAEP-SHA512 padding | N/A (padding validation) |
| EC-256/384/521 | ECDH-ES + A256KW + AES-GCM | 64-bit ICV + 128-bit GCM tag |
| X25519, X448 | ECDH-ES + A256KW (Concat KDF, SHA-256) + AES-GCM | 64-bit ICV + 128-bit GCM tag |
| ML-KEM-512/768/1024 | Hybrid: KEM + AES-256-GCM | 128-bit |
| HQC-128/192/256 | Hybrid: KEM + AES-256-GCM | 128-bit |
| FrodoKEM-640/976/1344 | Hybrid: KEM + AES-256-GCM | 128-bit |
| BIKE-128/192/256 | Hybrid: KEM + AES-256-GCM | 128-bit |
| SABER variants | Hybrid: KEM + AES-256-GCM | 128-bit |
| NTRU variants | Hybrid: KEM + AES-256-GCM | 128-bit |
| CMCE variants | Hybrid: KEM + AES-256-GCM | 128-bit |
Signature Algorithms (Integrity by Design)
| Algorithm | Verification Mechanism |
|---|---|
| ML-DSA-44/65/87 | Lattice-based signature verification |
| SLH-DSA family | Hash-based signature verification |
| Falcon-512/1024 | NTRU lattice signature verification |
| XMSS/LMS | Stateful hash-based verification |
| RSA-PSS | PSS padding with salt recovery |
| ECDSA | Elliptic curve point verification |
| Ed25519 | Edwards-curve signature verification |
| SM2 | Chinese standard signature verification |
Security Guarantees
What ANKASecure© Guarantees
- Tamper Detection: Any modification to ciphertext is detected with probability 1 - 2^(-128)
- Authenticity: Ciphertext provably originated from a key holder
- No Silent Failures: Invalid integrity always raises an exception
- Audit Trail: All integrity failures are logged with correlation IDs
Attack Vectors Mitigated
| Attack Type | Mitigation |
|---|---|
| Bit-flip attacks | 128-bit authentication tag |
| Padding oracle | OAEP + constant-time validation |
| Chosen-ciphertext | IND-CCA2 secure algorithms |
| Replay attacks | IV/nonce uniqueness enforcement |
| Timing attacks | Constant-time comparisons |
| Truncation attacks | Tag covers entire ciphertext |
Standards Compliance
ANKASecure© integrity mechanisms comply with:
| Standard | Requirement | ANKASecure© Implementation |
|---|---|---|
| NIST SP 800-38D | GCM with 128-bit tag | All AES-GCM operations |
| NIST FIPS 197 | AES algorithm | Core symmetric cipher |
| NIST FIPS 203 | ML-KEM | Post-quantum KEM |
| RFC 7516 | JWE authenticated encryption | API output format |
| RFC 8439 | ChaCha20-Poly1305 | Alternative AEAD |
| ISO/IEC 19772 | Authenticated encryption | Architecture compliance |
Operational Considerations
Performance Impact
AEAD modes add minimal overhead compared to unauthenticated encryption:
| Operation | Additional Cost |
|---|---|
| GCM encryption | ~5-10% vs CTR mode |
| GCM decryption | ~5-10% + tag verification |
| Tag generation | Single GHASH operation |
| Tag verification | Single GHASH + comparison |
Error Handling
When integrity verification fails:
- Exception:
AEADBadTagException(Java) or equivalent - HTTP Response: 422 Unprocessable Entity
- Message: "Ciphertext integrity verification failed"
- Logging: WARN level with transaction ID (no sensitive data)
- No Partial Data: Entire operation fails atomically
Verification and Audit
Runtime Verification
Integrity is verified at multiple levels:
- Algorithm Catalog: Only AEAD algorithms are available
- Cipher Initialization: Tag length enforced at cipher setup
- Decryption:
doFinal()validates tag before returning data - JWE Processing: Tag extracted and verified per RFC 7516
Audit Capabilities
- All crypto operations logged with correlation IDs
- Integrity failures generate security alerts
- Usage metrics track authentication success/failure rates
Related Documentation
- Algorithm Catalog - Complete algorithm reference
- Performance Benchmarks - Algorithm performance data
- Key Management* - Key lifecycle and storage
- Encryption & Digital Signatures* - Implementation details