A payment card scheme requires at least the security strength of RSA with 3,072-bit keys. The card chip is too small for RSA keys of that length, so the engineer will use elliptic curve keys.
Choosing cryptography and retiring it in time
Choosing cryptography starts with the job: keeping a file secret, spotting a changed download, proving who signed a contract, or protecting a connection. Each job has a standard tool, and each tool has a strength that can be compared on one scale and a working life that ends when attacks improve. No background beyond the earlier cryptography is assumed. A security manager chooses methods, compares their strength, and replaces them before they fail.
By the end of this unit you will be able to:
- Choose a cryptographic method for a stated job: secrecy, integrity, proof of origin or a protected connection
- Explain what bits of security measure, and compare symmetric, RSA, elliptic curve and hash strengths on that scale
- Put in order the stages of the cryptographic life cycle and explain cryptographic agility
- Tell apart link encryption and end-to-end encryption
- Choose the right product family for email, web, network and disk protection
Four jobs at a veterinary practice
An illustrative example
The practice manager at a veterinary surgery has four tasks on her list. The reception laptop holds client records and goes home with a locum. The booking website takes card details. Laboratory results arrive by email and must be shown to come from the laboratory. Staff download a software update from the supplier's site.
The supplier of the booking system advises her to "use the strongest encryption for everything".
Is one strong encryption method the answer to all four tasks, or does each need a different tool?
Start from the job
Each method answers one question well. hides content. A detects accidental change. A detects deliberate change between parties who share a key. A signature proves who signed, to anyone.
| Job | Method | Why |
|---|---|---|
| Keep a laptop's files secret if it is lost | Full disk encryption with AES | Fast of everything at rest |
| Protect a web connection | TLS: key agreement, , then AES in an authenticated mode | Hybrid: public key to set up, symmetric for the data |
| Check a download was not damaged | A SHA-256 digest published on the supplier's site | Detects accidental change |
| Prove a file came from the supplier | The supplier's , checked with its certificate | and origin, provable to anyone |
| Detect tampering between two of one firm's systems | HMAC with a shared key | Faster than a signature when no third party needs proof |
| Store passwords | A salted, slow hash such as Argon2id or PBKDF2 | Recovery is not needed, and guessing is made expensive |
| Send a secret file to a stranger | Encrypt under the recipient's public key, in a digital envelope | No secret has to be shared first |
Only published, standard from well-tested libraries are chosen. A home-made algorithm relies on staying secret, which breaks Kerckhoffs's principle.
Common misconception
“The strongest encryption available is the right answer to every security need.”
Encryption gives confidentiality. It does not prove origin to a third party. Stored passwords need a slow one-way hash, because a key that could decrypt them is one more thing to steal.
Comparing strength in bits
of different kinds cannot be compared directly: a 3,072-bit RSA key is not 24 times stronger than a 128-bit AES key. Bits of security, also called security strength, give a common scale. A strength of n bits means the best known attack needs about 2 to the power n operations.
| Bits of security | Symmetric | RSA or Diffie-Hellman | Elliptic curve | Hash, collision |
|---|---|---|---|---|
| 80 or less | Two-key Triple DES | 1,024 | 160 to 223 | SHA-1 (below 80) |
| 112 | Three-key Triple DES | 2,048 | 224 to 255 | SHA-224 |
| 128 | AES-128 | 3,072 | 256 to 383 | SHA-256 |
| 192 | AES-192 | 7,680 | 384 to 511 | SHA-384 |
| 256 | AES-256 | 15,360 | 512 or more | SHA-512 |
Eighty bits is no longer considered enough. Elliptic curve keys stay short as strength rises, which is why they suit phones and smart cards.
Common misconception
“128 bits of security is half as strong as 256 bits.”
Each extra bit doubles the work. 256 bits needs 2 to the power 128 times the work of 128 bits: a number with 39 digits.
Algorithms age: the cryptographic life cycle
Attacks and computers improve, so every algorithm and key length has a working life. The cryptographic life cycle manages methods from choice to removal. The National Institute of Standards and Technology (NIST), the United States standards body, gives each method a status. Acceptable means safe to use. Deprecated means usable with some . Disallowed means no longer used to protect anything. Legacy use means only or verifying what was protected before.
- Select an acceptable algorithm and key length for the data's required protection life.
- Deploy it, and record where it is used in an .
- Monitor its status and new attacks.
- When it is deprecated, plan and fund its replacement.
- When it is disallowed, stop protecting new data with it; keep it only for legacy use.
- Retire it: re-protect old data with a current method and destroy the old keys.
| Algorithm | What happened |
|---|---|
| DES | Standard withdrawn in 2005; open to brute force |
| MD5 | Declared unacceptable for signatures in 2011 |
| SHA-1 | Disallowed for signatures from the end of 2013; to be phased out by 2030 |
| RC4 | Banned from TLS in 2015 |
| Triple DES | Disallowed for encryption after 2023; decryption for legacy use only |
Cryptographic agility is the ability to replace an algorithm in protocols, applications and devices without rebuilding them or stopping the business. Each key used with a method also has its own life, from generation to destruction.
Where the encryption sits: link or end to end
Link encryption protects data on one connection between two points, such as two routers. Everything on the link is encrypted, including the addresses. At each point the data is decrypted, handled, and encrypted again for the next link.
End-to-end encryption protects the data from the sender to the final recipient. Points in between pass it on without decrypting it, so the addresses that route it must stay readable.
| Point | Link encryption | End-to-end encryption |
|---|---|---|
| What is hidden | Content and addresses on the link | Content only |
| Readable at each point in between | Yes | No |
| Who runs it | The network operator | The sender and the recipient |
| Main weakness | Each intermediate point must be trusted | Who is talking to whom remains visible |
The two are often combined. A firm's link between offices may be encrypted by its network team, while a web session inside it is protected end to end by TLS.
Cryptography in everyday products
- TLS
- Security protects web and other connections between programs.
- IPsec
- Security protects all traffic between two networks or devices, often as a virtual private network.
- S/MIME
- Secure/Multipurpose Internet Mail Extensions sign and encrypt email using certificates from a .
- PGP
- Pretty Good signs and encrypts email and files, with users vouching for each other's keys.
- Disk and file encryption
- Protects data at rest on laptops, phones and , usually with AES.
Two newer techniques solve narrower problems. Homomorphic encryption allows calculations on encrypted data, so a service can process figures it can never read. A zero-knowledge proof convinces a verifier that a statement is true while revealing nothing else, such as proving a person is over 18 without giving the date of birth.
Worked example: The veterinary practice's four tasks
The practice manager decides on one method for each task on her list.
- Reception laptop: full disk encryption with AES-256, unlocked at start-up. A lost laptop reveals nothing.
- Booking website: TLS 1.3 with a certificate from a public certificate authority. The connection is protected and customers can see whose site it is.
- Laboratory results: the laboratory signs each result with S/MIME. The practice's mail program checks the signature against the laboratory's certificate.
- Software update: the supplier signs the installer, and the computer checks the code signature before running it. A published SHA-256 digest alone would catch a damaged download but not a substituted one.
- She records all four in the practice's cryptographic inventory, with the algorithm and the date each certificate expires.
Four jobs need four tools. "The strongest encryption for everything" would have hidden the laboratory results without proving where they came from.
A question, worked through
A security manager at a land registry learns that its archive of title deeds is signed with RSA keys of 1,024 bits and SHA-1. The deeds must remain provably genuine for decades. The archive software can change algorithms only through a costly supplier upgrade.
What should the security manager recommend FIRST?
Decide on your answer, then open the reasoning
- The deeds need long-lived proof of origin and integrity. The current method is rated at 80 bits or less and SHA-1 is disallowed for signatures.
- Rule out d. It adds more SHA-1, whose collision strength is below 80 bits, and a bare digest proves nothing about origin.
- Rule out c. Encryption hides content. It does not prove who issued a deed, and the deeds must be checkable by others.
- Between a and b: b compares key lengths across different kinds of algorithm. On the bits of security scale, RSA-1,024 is far weaker than AES-128.
- Option a replaces the method with one rated for decades and builds in agility so the next change is cheaper. It is the decision to make first.
Answer: A. Plan migration to signatures of at least 128-bit strength and require algorithm agility in the upgrade
Choosing between good answers
- A question compares key lengths of different algorithm types
- convert to bits of security first. RSA-3,072, a 256-bit elliptic curve key and AES-128 are all 128 bits.
- A scenario asks for proof of origin to an outside party
- choose a signature, not encryption or a bare hash.
- An algorithm in use is deprecated or disallowed
- choose planning its replacement, and stop applying new protection with a disallowed method.
- Intermediate network points must not be able to read the content
- choose end-to-end encryption. Link encryption is decrypted at each point.
- An option offers a proprietary or secret algorithm
- reject it. Choose a published standard from a tested library.
Check your understanding
3 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 3
What to remember
- Start from the job: encryption for secrecy, a hash for accidental change, an HMAC for tampering between key holders, a signature for provable origin.
- Bits of security put all methods on one scale: AES-128, RSA-3,072, a 256-bit elliptic curve key and SHA-256 collision resistance are each 128 bits.
- The cryptographic life cycle runs from selection through deployment, monitoring, deprecation and disallowance to retirement.
- Cryptographic agility is the ability to swap algorithms without rebuilding systems.
- Link encryption is decrypted at every point and hides addresses; end-to-end encryption is not, and leaves addresses visible.
Say it from memory
What is the cryptographic life cycle, and how are algorithms selected and retired?
It manages algorithms and keys from choice to removal. Select an acceptable algorithm and key length for the data's protection life, then deploy, inventory and monitor it. Plan replacement when it is deprecated. Stop new protection when it is disallowed, keeping legacy use only. Finally retire it and destroy its keys. Examples: DES, MD5, SHA-1, RC4, Triple DES. Cryptographic agility makes the replacement cheap.
Which method fits each job: detect accidental change, detect tampering between two of your own systems, prove origin to anyone, store passwords?
Accidental change: a SHA-256 digest. Tampering between two of one firm's systems: HMAC with a shared key. Proof of origin to anyone: a digital signature checked with a certificate. Stored passwords: a salted, slow hash such as Argon2id or PBKDF2.
Which RSA key length and elliptic curve key size give 128 bits of security, like AES-128?
An RSA or Diffie-Hellman key of 3,072 bits, and an elliptic curve key of 256 to 383 bits. SHA-256 gives the same strength against collisions. Eighty bits is no longer considered enough.
How does link encryption differ from end-to-end encryption in what it hides and where data is readable?
Link encryption protects one connection between two points and hides content and addresses on the link, but data is decrypted and readable at each point in between; the network operator runs it. End-to-end encryption hides content only, from sender to final recipient, so who is talking to whom stays visible.
How do S/MIME and PGP differ, and what do homomorphic encryption and a zero-knowledge proof allow?
S/MIME signs and encrypts email using certificates from a certificate authority. PGP signs and encrypts email and files, with users vouching for each other's keys. Homomorphic encryption allows calculations on encrypted data. A zero-knowledge proof convinces a verifier a statement is true while revealing nothing else.
Sources
- NIST SP 800-57 Part 1 Rev. 5: Recommendation for Key Management, NISTSecurity strength in bits, the comparable strengths of symmetric, RSA or Diffie-Hellman and elliptic curve methods, and 80 bits no longer considered sufficient.
- Hash Functions: Security Strengths of Approved Hash Functions, NISTHash collision strength as half the digest length, and SHA-1 collision strength below 80 bits.
- NIST SP 800-131A Rev. 2: Transitioning the Use of Cryptographic Algorithms and Key Lengths, NISTThe status terms acceptable, deprecated, disallowed and legacy use, and Triple DES disallowed for encryption after 2023 with decryption for legacy use.
- FIPS 46-3: Data Encryption Standard (DES), NISTDES standard withdrawn on 19 May 2005.
- RFC 6151: Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms, IETFMD5 no longer acceptable where collision resistance is required, such as digital signatures, from March 2011.
- NIST Retires SHA-1 Cryptographic Algorithm, NISTSHA-1 to be phased out by 31 December 2030.
- RFC 7465: Prohibiting RC4 Cipher Suites, IETFRC4 prohibited in every version of TLS from February 2015.
- NIST CSWP 39: Considerations for Achieving Cryptographic Agility: Strategies and Practices, NISTCryptographic agility as the capability to replace and adapt cryptographic algorithms in protocols, applications and infrastructure while preserving security and operations.
- Link encryption, NIST CSRC glossary, NISTLink encryption as encryption at the data link level protecting information between two points.
- End-to-end encryption, NIST CSRC glossary, NISTEnd-to-end encryption, in which data is encrypted through the network while routing information stays visible.
- RFC 8551: Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 Message Specification, IETFS/MIME signatures providing authentication, integrity and non-repudiation, and encryption providing confidentiality.
- RFC 4301: Security Architecture for the Internet Protocol, IETFIPsec protecting traffic at the IP layer between hosts and networks.
- Privacy-Enhancing Cryptography: Fully Homomorphic Encryption, NISTFully homomorphic encryption allowing arbitrary functions to be computed over encrypted data.
- Zero-knowledge proof, NIST CSRC glossary, NISTA zero-knowledge proof convincing a verifier that a statement is true while revealing nothing else.