Encryption: confidentiality, integrity and key management
How encryption differs from hashing and signatures, where it protects data, and why key management and authenticated protocols matter.

On this page
Encryption protects the confidentiality of information by transforming plaintext into ciphertext using a key. It is one part of a secure system: it does not replace access control, reliable backups, key management or protection of the application using the data.
Understanding encryption
The algorithm describes the transformation; the key supplies the secret material needed for a particular operation. Decryption recovers plaintext when the correct key and other required parameters are available. Security depends on the complete construction and implementation, not on keeping the algorithm secret.
Historical substitution ciphers and wartime machines illustrate how cryptography developed. Modern applications should use established protocols and maintained libraries rather than adapting historical techniques or designing their own cipher.
Symmetric and asymmetric cryptography
Symmetric encryption uses a shared secret key. AES is a block cipher used within modes of operation; it is not a complete file or messaging protocol on its own. Symmetric constructions are generally suitable for bulk data.
Asymmetric cryptography uses a public/private key pair. Depending on the scheme, it can support encryption or digital signatures. RSA is one example. Public keys still need authentication: receiving a key does not establish who owns it. Private keys require protection and lifecycle management.
Systems often combine techniques. A protocol can establish shared secrets with public-key mechanisms and use symmetric authenticated encryption for application data. Use the protocol's supported mechanisms rather than inventing that combination yourself.
Hashing is a different operation
A cryptographic hash maps data to a fixed-size digest. It is not encryption and has no decryption key. Hashes are not mathematically unique; collision resistance means that finding a matching pair should be computationally difficult.
A digest can detect a changed download when the expected digest comes from a trusted source. An attacker who can replace both the file and its advertised digest can bypass that check. Authentication requires additional mechanisms, such as a message authentication code or digital signature.
Confidentiality, integrity and identity
Encryption alone does not necessarily detect modifications. Prefer an established authenticated-encryption construction when the use case requires both confidentiality and integrity. Its requirements for keys, nonces and authentication tags are part of the security design.
A digital signature supports verification of origin and integrity under a trusted public key. It does not make repudiation impossible in every context: compromised keys, identity verification and operational procedures still matter. Authentication and authorisation remain separate responsibilities.
Protecting data in practice
- In transit: use maintained TLS implementations and validate the peer's identity. Encryption without certificate validation does not establish a trusted connection.
- At rest: choose encryption appropriate to the threat model and protect keys separately from the encrypted data. Consider who can decrypt, rotate keys, restore backups and access a running application.
- In use: a compromised application may read plaintext or invoke legitimate decryption. Disk or database encryption does not solve that problem by itself.
- During recovery: encryption is not ransomware prevention. Maintain tested, appropriately isolated recovery copies and control privileged access.
Encryption can support a compliance program, but selecting an algorithm does not by itself establish compliance with a law or standard. Avoid collecting sensitive information that the system does not need.
Tradeoffs and future work
Key distribution, rotation, availability and recovery are operational concerns alongside performance. Hardware acceleration may help, but measure the actual workload rather than assuming encryption is the bottleneck.
Post-quantum migration and computation over encrypted data address different problems. Follow relevant standards and protocol guidance instead of treating an emerging technique or a blockchain as a general solution for secure key storage.
References
Written by Alex Hovy.
← Back to BlogsContinue reading
Replacing an identity server: ASP.NET Core Identity and OpenIddict
Migration considerations for user management, OAuth/OpenID Connect contracts, credentials and operations, with clear distinctions between identity products.
Authorisation: resource permissions and trusted enforcement
Design understandable access rules, enforce object-level permissions and account for service boundaries, caching and revocation.
Authentication: passwords, MFA, sessions and tokens
Separate identity verification from permissions, and understand the responsibilities around passwords, MFA, sessions, JWT validation and account recovery.