Unit II: Chapter 1: Key Management Overview
Unit II: Chapter 1: Key Management Overview
Overview:
Public-key encryption schemes are secure only if the authenticity of the public key is assured. A
public-key certificate scheme provides the necessary security.
A simple public-key algorithm is Diffie-Hellman key exchange. This protocol enables two users to
establish a secret key using a public-key scheme based on discrete logarithms. The protocol is secure
only if the authenticity of the two participants can be established.
Elliptic curve arithmetic can be used to develop a variety of elliptic curve cryptography (ECC)
schemes, including key exchange, encryption, and digital signature.
For purposes of ECC, elliptic curve arithmetic involves the use of an elliptic curve equation defined
over a finite field. The coefficients and variables in the equation are elements of a finite field.
Schemes using Zp and GF(2m) have been developed.
Key Management
public announcement
public-key authority
public-key certificates
Public Announcement
eg. append PGP keys to email messages or post to news groups or email list
A greater degree of security can be achieved by maintaining a publicly available dynamic directory of public
keys. Maintenance and distribution of the public directory would have to be the responsibility of some
trusted entity or organization (Bellow Figure). Such a scheme would include the following elements:
1. The authority maintains a directory with a {name, public key} entry for each participant.
2. Each participant registers a public key with the directory authority. Registration would have to be in
person or by some form of secure authenticated communication.
3. A participant may replace the existing key with a new one at any time, either because of the desire to
replace a public key that has already been used for a large amount of data, or because the
corresponding private key has been compromised in some way.
4. Participants could also access the directory electronically. For this purpose, secure, authenticated
communication from the authority to the participant is mandatory.
Public-Key Authority
then users interact with directory to obtain any desired public key securely
usually with other info such as period of validity, rights of use etc
B generates a session key K sends it to A encrypted using the supplied public key
problem is that an opponent can intercept and impersonate both halves of protocol
rationale
by Diffie & Hellman in 1976 along with the exposition of public key concepts
note: now know that Williamson (UK CESG) secretly proposed the concept in 1970
value of key depends on the participants (and their private and public key information)
security relies on the difficulty of computing discrete logarithms (similar to factoring) – hard
Diffie-Hellman Setup
KAB is used as session key in private-key encryption scheme between Alice and Bob
if Alice and Bob subsequently communicate, they will have the same key as before, unless they
choose new public-keys
Diffie-Hellman Example
users could create random private/public D-H keys each time they communicate
users could create a known private/public D-H key and publish in a directory, then consulted and
used to securely communicate with them
both of these are vulnerable to a meet-in-the-Middle Attack
majority of public-key crypto (RSA, D-H) use either integer or polynomial arithmetic with very large
numbers/polynomials
y2 = x3 + ax + b
Elliptic curve cryptography uses curves whose variables & coefficients are finite
• best in software
binary curves E2m(a,b) defined over GF(2n)
• best in hardware
ECC Diffie-Hellman
can do key exchange analogous to D-H
decrypt Cm compute:
Pm+kPb–nB(kG) = Pm+k(nBG)–nB(kG) = Pm
ECC Security
compared to factoring, can use much smaller key sizes than with RSA etc
Review Questions
1 What are two different uses of public-key cryptography related to key distribution?
2 List four general categories of schemes for the distribution of public keys.
5 What are the requirements for the use of a public-key certificate scheme?
9 What is the sum of three points on an elliptic curve that lie on a straight line?
Chapter2: Introduction to Number Theory
Overview:
A prime number is an integer that can only be divided without remainder by positive and negative
values of itself and 1. Prime numbers play a critical role both in number theory and in cryptography.
Two theorems that play important roles in public-key cryptography are Fermat's theorem and Euler's
theorem.
An important requirement in a number of cryptographic algorithms is the ability to choose a large
prime number. An area of ongoing research is the development of efficient algorithms for
determining if a randomly chosen large integer is a prime number.
Discrete logarithms are fundamental to a number of public-key algorithms. Discrete logarithms are
analogous to ordinary logarithms, but operate over modular arithmetic.
Prime Numbers
Prime Factorisation
note that factoring a number is relatively hard compared to multiplying the factors together to
generate the number
two numbers a, b are relatively prime if have no common divisors apart from 1
eg. 8 & 15 are relatively prime since factors of 8 are 1,2,4,8 and of 15 are 1,3,5,15 and 1 is the
only common factor
conversely can determine the greatest common divisor by comparing their prime factorizations and
using least powers
Fermat's Theorem
ap-1 = 1 (mod p)
also ap = p (mod p)
reduced set of residues is those numbers (residues) which are relatively prime to n
eg for n=10,
number of elements in reduced set of residues is called the Euler Totient Function ø(n)
to compute ø(n) need to count number of residues to be excluded
eg.
ø(37) = 36
Euler's Theorem
aø(n) = 1 (mod n)
eg.
a=3;n=10; ø(10)=4;
hence 34 = 81 = 1 mod 10
a=2;n=11; ø(11)=10;
Primality Testing
ie. divide by all numbers (primes) in turn less than the square root of the number
but some composite numbers, called pseudo-primes, also satisfy the property
can use a slower deterministic primality test
algorithm is:
4. for j = 0 to k – 1 do
6. return ("composite")
Probabilistic Considerations
hence if repeat test with different random a then chance n is prime after t tests is:
Prime Distribution
prime number theorem states that primes occur roughly every (ln n) integers
so in practice need only test 0.5 ln(n) numbers of size n to locate a prime
since computational cost is proportional to size, this is faster than working in the full modulus M
to compute A(mod M)
Primitive Roots
Discrete Logarithms
the inverse problem to exponentiation is to find the discrete logarithm of a number modulo p
whilst exponentiation is relatively easy, finding discrete logarithms is generally a hard problem
Summary
have considered:
prime numbers
Primality Testing
Discrete Logarithms
Key Terms
bijection Euler's theorem order
Review Questions
4 The Miller-Rabin test can determine if a number is not prime but cannot determine if a number is
prime. How can such an algorithm be used to test for primality?
Overview:
In a distributed environment, encryption devices can be placed to support either link encryption or
end-to-end encryption. With link encryption, each vulnerable communications link is equipped on
both ends with an encryption device. With end-to-end encryption, the encryption process is carried
out at the two end systems.
Even if all traffic between users is encrypted, a traffic analysis may yield information of value to an
opponent. An effective countermeasure is traffic padding, which involves sending random bits during
periods when no encrypted data are available for transmission.
Key distribution is the function that delivers a key to two parties who wish to exchange secure
encrypted data. Some sort of mechanism or protocol is needed to provide for the secure distribution
of keys.
Key distribution often involves the use of master keys, which are infrequently used and are long
lasting, and session keys, which are generated and distributed for temporary use between two parties.
A capability with application to a number of cryptographic functions is random or pseudorandom
number generation. The principle requirement for this capability is that the generated number stream
be unpredictable.
link encryption
end-to-end encryption
end-to-end protects data contents over entire path and provides authentication
as move higher less information is encrypted but it is more secure though more complex with
more entities and keys
often secure system failure due to a break in the key distribution scheme
if A & B have communicated previously can use previous key to encrypt a new key
if A & B have secure communications with a third party C, C can relay key between A & B
Key Hierarchy
session key
temporary key
hierarchies of KDC’s required for large networks, but must trust each other
use of automatic key distribution on behalf of users, but must trust system
Random Numbers
note that an attacker can reconstruct sequence given a small number of values
for cryptographic applications, can use a block cipher to generate random numbers
often for creating session keys from master key
Counter Mode
Xi = EKm[i]
Xi = EKm[Xi-1]
xi = xi-12 mod n
eg. radiation counters, radio noise, audio noise, thermal noise in diodes, leaky capacitors,
mercury discharge tubes etc
Published Sources
Summary
Review Questions
1 For a user workstation in a typical business environment, list potential locations for confidentiality
attacks.
5 List ways in which secret keys can be distributed to two communicating parties.
7 What is a nonce?
Overview:
Asymmetric encryption is a form of cryptosystem in which encryption and decryption are performed
using the different keysone a public key and one a private key. It is also known as public-key
encryption.
Asymmetric encryption transforms plaintext into ciphertext using a one of two keys and an
encryption algorithm. Using the paired key and a decryption algorithm, the plaintext is recovered
from the ciphertext.
Asymmetric encryption can be used for confidentiality, authentication, or both.
The most widely used public-key cryptosystem is RSA. The difficulty of attacking RSA is based on
the difficulty of finding the prime factors of a composite number.
Private-Key Cryptography
hence does not protect sender from receiver forging a message & claiming is sent by sender
Public-Key Cryptography
key distribution – how to have secure communications in general without having to trust a
KDC with your key
digital signatures – how to verify a message comes intact from the claimed sender
public invention due to Whitfield Diffie & Martin Hellman at Stanford Uni in 1976
Public-Key Cryptography
a public-key, which may be known by anybody, and can be used to encrypt messages, and
verify signatures
a private-key, known only to the recipient, used to decrypt messages, and sign (create)
signatures
is asymmetric because
those who encrypt messages or verify signatures cannot decrypt messages or create
signatures
Public-Key Characteristics
it is computationally infeasible to find decryption key knowing only algorithm & encryption
key
either of the two related keys can be used for encryption, with the other used for decryption
(for some algorithms)
Public-Key Cryptosystems
Public-Key Applications
some algorithms are suitable for all uses, others are specific to one
Applications for Public-Key Cryptosystems
Diffie-Hellman No No Yes
DSS No Yes No
like private key schemes brute force exhaustive search attack is always theoretically possible
security relies on a large enough difference in difficulty between easy (en/decrypt) and hard
(cryptanalyse) problems
more generally the hard problem is known, but is made hard enough to be impractical to break
RSA
RSA Use
computes: M = Cd mod n
note that the message M must be smaller than the modulus n (block if needed)
in RSA have:
n=p.q
ø(n)=(p-1)(q-1)
= M1.(1)k = M1 = M mod n
5. Determine d: de=1 mod 160 and d < 160 Value is d=23 since 23x7=161= 10x160+1
encryption:
decryption:
Exponentiation
and multiplying in the ones that are needed to compute the result
c = 0; f = 1
for i = k downto 0
do c = 2 x c
f = (f x f) mod n
if bi == 1 then
c=c+1
f = (f x a) mod n
return f
Efficient Encryption
Efficient Decryption
only owner of private key who knows values of p & q can use this technique
RSA Security
The defense against the brute-force approach is the same for RSA as for other cryptosystems, namely, use a
large key space. Thus, the larger the number of bits in d, the better. However, because the calculations
involved, both in key generation and in encryption/decryption, are complex, the larger the size of the key, the
slower the system will run.
Timing Attacks
countermeasures
Constant exponentiation time: Ensure that all exponentiations take the same amount of time
before returning a result. This is a simple fix but does degrade performance.
Random delay: Better performance could be achieved by adding a random delay to the
exponentiation algorithm to confuse the timing attack. Kocher points out that if defenders
don't add enough noise, attackers could still succeed by collecting additional measurements to
compensate for the random delays.
Blinding: Multiply the ciphertext by a random number before performing exponentiation.
This process prevents the attacker from knowing what ciphertext bits are being processed
inside the computer and therefore prevents the bit-by-bit analysis essential to the timing
attack.
Summary
have considered:
Key Terms
chosen ciphertext attack (CCA) public key cryptography
Review Questions