Encryption
Encryption protects data by transforming information with mathematical algorithms so it becomes unreadable to unauthorized parties.
Classification
- ComplexityHigh
- Impact areaTechnical
- Decision typeArchitectural
- Organizational maturityAdvanced
Technical context
Principles & goals
Use cases & scenarios
Compromises
- Key loss or compromise can lead to data loss or misuse.
- Incorrect implementation can cause a false sense of security.
- Incompatible or outdated algorithms break interoperability.
- Use well-established, standardized algorithms and libraries.
- Automate key rotation and certificate management.
- Separate roles for access to keys and data (least privilege).
I/O & resources
- Data classification and identification of sensitive fields
- Decision on key management architecture (central KMS/HSM)
- Threat model and compliance requirements
- Encrypted data-at-rest and in-transit
- Documented key policies and rotation schedule
- Audit and evidence material for compliance
Description
Encryption is a fundamental protection mechanism that renders data unreadable to unauthorized parties through mathematical algorithms. It covers symmetric and asymmetric ciphers, key management, and protocols for storage and transport. Encryption reduces attack surface but requires explicit architectural decisions regarding performance, availability, and regulatory compliance. These trade-offs depend on context.
✔Benefits
- Protects confidentiality and mitigates data leaks.
- Facilitates compliance with data protection regulations.
- Reduces risk from physical theft of storage media.
✖Limitations
- Performance overhead for encryption and decryption.
- Complexity of key management, especially rotation and backup.
- Encryption alone does not fix application logic vulnerabilities.
Trade-offs
Metrics
- Encryption latency
Measure of additional latency introduced by encryption/decryption processes.
- Key rotation frequency
Frequency at which keys are rotated or renewed.
- Number of encrypted records
Proportion or absolute number of encrypted data objects in the system.
Examples & implementations
Database encryption in banking
Banks encrypt customer data at rest and use HSMs for key management.
TLS protection for web APIs
APIs are encrypted via TLS with centralized certificate automation.
End-to-end in messenger apps
Messengers use asymmetric key pairs and ratchet-based sessions.
Implementation steps
Perform asset inventory and data classification
Select appropriate algorithms, modes, and key lengths
Integrate KMS, define rotation and backup
Adapt services and clients and perform tests
Establish monitoring, auditing and incident response
⚠️ Technical debt & bottlenecks
Technical debt
- Legacy encryption libraries need replacement.
- Insufficient automation for certificate and key management.
- Missing documentation of key hierarchy and responsibilities.
Known bottlenecks
Misuse examples
- Using MD5 or SHA1 for security-critical integrity checks.
- Transport encryption but storing sensitive data unencrypted.
- Storing keys on developer machines without access control.
Typical traps
- Skipping threat modeling leads to incorrect protection scope.
- Unprotected metadata can leak and enable inference.
- Incorrect key rotation can cause data loss.
Required skills
Architectural drivers
Constraints
- • Legal constraints for key retention and export control
- • Legacy systems without encryption support
- • Limited resources on edge or IoT devices