Asymmetric Cryptography Summary
Asymmetric Cryptography
- Ciphers Taxonomy:
- Symmetric (one key)
- Asymmetric (two keys)
- Asymmetric Ciphers: Encryption and decryption keys are different.
- Keys are related, but deriving one from the other is computationally infeasible.
- Each participant needs a key pair (private and public).
- Also known as public key cryptography.
- Security depends on:
- Algorithm strength
- Key size
- Confidentiality of the private key.
Key Distribution
- Key distribution is simpler than symmetric ciphers.
- Each participant:
- Creates an asymmetric key pair.
- Publishes the public key.
- Keeps the private key secret.
- If there are n participants, n key pairs are needed.
- Ways to obtain public keys:
- Directly from the owner.
- Website.
- Public keyserver.
Confidentiality Using Asymmetric Ciphers
- To send a confidential message to Bob, Alice:
- Needs Bob's public key.
- Encrypts the message using Bob's public key.
- Sends the ciphertext to Bob.
- Bob recovers the message using his private key.
- Anyone knowing Bob's public key can encrypt messages for him; only Bob can decrypt them.
- Analogy: Bob's public key is like an unlocked padlock he gives out; his private key is the key to that padlock.
- Process:
- Bob creates a public/private key pair.
- Alice gets Bob's public key.
- Alice encrypts her message using Bob's public key.
- Alice sends the ciphertext to Bob.
- Bob decrypts the ciphertext using his private key.
- Notation:
- Encryption: C=E(P,KRpub)
- Decryption: P=D(C,KRpriv)
- KRpub (Recipient's public key) used for encryption
- KRpriv (Recipient's private key) used for decryption
Real-World Usage
- Reporting vulnerabilities or communicating with news reporters where confidentiality is needed but a shared secret key for symmetric encryption is unavailable.
- Organizations provide a public key for asymmetric encryption.
ElGamal Cryptosystem
- Relies on the difficulty of discrete logarithms.
- Designed for encryption, not key agreement, unlike Diffie-Hellman.
- Ciphertext is twice the length of the plaintext.
- Ciphertext is randomized.
- multiple encryptions produce different ciphertexts.
- System parameters p and g (same as Diffie-Hellman).
- Alice:
- Picks random integer a as private key
- Publishes public key: K<em>A</em>Pub=gamodp
- Bob (to encrypt message m):
- Encodes m as a number
- Picks random integer r and computes: grmodp, (K<em>A</em>Pub)r=garmodp, and m×garmodp
- Sends ciphertext (grmodp,m×garmodp)
- Alice (to recover message):
- Computes shared secret: (gr)a=garmodp
- Recovers m=(m×garmodp)/(garmodp)
RSA Cryptosystem
- Based on the difficulty of factoring large integers using modular arithmetic.
- Used for encryption (confidentiality) and digital signatures (integrity, authentication).
- Breaking RSA is as hard as factoring the modulus.
- Key Generation:
- Choose two large primes p and q.
- Calculate n=pq.
- Choose public exponent e (where e > 1 and (p−1)(q−1) have no common factors).
- Calculate private exponent d using secret knowledge of p and q.
- Public key is (n,e). Private key is d.
- Encryption:
- Encode plaintext as integers: 1≤m≤n
- Encrypt: c=memodn
- Decryption: m=cdmodn
- Key sizes: 1024, 2048, 4096 bits.
Elliptic Curve Cryptography
- Uses algebraic group defined on points on an elliptic curve.
- Based on Elliptic Curve Discrete Logarithm Problem.
- Smaller key size and ciphertext size compared to RSA for the same security level.
- AES Key Size (Symmetric key) | RSA Key Size | Elliptic curve Key Size
- <80 | 1024 | 160-223
- 128 | 3072 | 256-383
- 192 | 7680 | 384-511
- 256 | 15360 | 512+
Hybrid Cryptosystems
- Asymmetric ciphers simplify key distribution.
- Combination:
- Asymmetric cipher encrypts a short message.
- A randomly chosen shared secret key for a symmetric cipher.
- Symmetric cipher encrypts the bulk data with that key.
Summary
- Asymmetric cryptography uses key pairs (private and public).
- Solves the key distribution problem.
- Can provide confidentiality.
- Asymmetric ciphers are slower than symmetric.
- Hybrid systems combine the advantages of both.