Public-Key Distribution Schemes (PKDS) - Where The Scheme Is Used To Securely
Public-Key Distribution Schemes (PKDS) - Where The Scheme Is Used To Securely
Public-Key Distribution Schemes (PKDS) - Where The Scheme Is Used To Securely
Security of RSA
· The security of the RSA scheme rests on the difficulty of factoring the modulus of the
scheme R
· best known factorization algorithm (Brent-Pollard) takes:
· This leads to R having a length of 200 digits (or 600 bits) given that modern computers
perform 1-100 MIPS the above can be divided by 106 to get a time in seconds
o nb: currently 1e+14 operations is regarded as a limit for computational feasability
and there are 3e+13 usec/year
· but most (all!!) computers can't directly handle numbers larger than 32-bits (64-bits on the
very newest)
· hence need to use multiple precision arithmetic libraries to handle numbers this large
Multi-Precision Arithmetic
· involves libraries of functions that work on multiword (multiple precision) numbers
· classic references are in Knuth vol 2 - "Seminumerical Algorithms"
o multiplication digit by digit
o do exponentiation using square and multiply[6]
· are a number of well known multiple precision libraries available - so don't reinvent the
wheel!!!!
· can use special tricks when doing modulo arithmetic, especially with the modulo reductions
Faster Modulo Reduction
* Chivers (1984) noted a fast way of performing modulo reductions whilst doing multi-precision
arithmetic calcs
then
ie: this implies that the MSD of a number can be removed and its remainder mod m added to the
remaining digits will result in a number that is congruent mod m to the original.
* Chivers algorithm for reducing a number is thus:
1. Construct an array R = (bd, 2.bd, ... , (b-1).bd)(mod m)
2. FOR i = n-1 to d do
WHILE A[i] != 0 do
j = A[i];
A[i] = 0;
A = A + bi-d.R[j];
END WHILE
END FOR
where A[i] is the ith character of number A
R[j] is the jth integer residue from the array R
n is the number of symbols in A
d is the number of symbols in the modulus
Speeding up RSA - Alternate Multiplication Techniques
· conventional multiplication takes O(n2) bit operations, faster techniques include:
· the Schonhage-Strassen Integer Multiplication Algorithm:
o breaks each integer into blocks, and uses them as coefficients of a polynomial
o evaluates these polynomials at suitable points, & multiplies the resultant values
o interpolates these values to form the coefficients of the product polynomial
o combines the coefficients to form the product of the original integer
o the Discrete Fourier Transform, and the Convolution Theorem are used to speed up
the interpolation stage
o can multiply in O(n log n) bit operations
· the use of specialized hardware because:
o conventional arithmetic units don't scale up, due to carry propogation delays
o so can use serial-parallel carry-save, or delayed carry-save techniques with O(n)
gates to multiply in O(n) bit operations,
o or can use parallel-parallel techniques with O(n2) gates to multiply in O(log n) bit
operations
M = M1 mod p M = M2 mod q
has a unique solution by the CRT, given by:
p.u mod q = 1
Primality Testing and RSA
· The first stage of key-generation for RSA involves finding two large primes p, q
· Because of the size of numbers used, must find primes by trial and error
· Modern primality tests utilize properties of primes eg:
o an-1 = 1 mod n where GCD(a,n)=1
o all primes numbers 'n' will satisfy this equation
o some composite numbers will also satisfy the equation, and are called pseudo-
primes.
· Most modern tests guess at a prime number 'n', then take a large number (eg 100) of
numbers 'a', and apply this test to each. If it fails the number is composite, otherwise it is is
probably prime.
· There are a number of stronger tests which will accept fewer composites as prime than the
above test. eg:
ElGamal
· A variant of the Diffie-Hellman key distribution scheme, allowing secure exchange of
messages
· published in 1985 by ElGamal in
T. ElGamal, "A Public Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms",
IEEE Trans. Information Theory, vol IT-31(4), pp469-472, July 1985.
· like Diffie-Hellman its security depends on the difficulty of factoring logarithms
· Key Generation
o select a large prime p (~200 digit), and
o [[alpha]] a primitive element mod p
o A has a secret number xA
o B has a secret number xB
o A and B compute yA and yB respectively, which are then made public
§ yA = [[alpha]]xA mod p
§ yB = [[alpha]]xB mod p
· to encrypt a message M into ciphertext C,
o selects a random number k, 0 <= k <= p-1
o computes the message key K
§ K = yBk mod p
o computes the ciphertext pair: C = {c1,c2}
§ C1 = [[alpha]]k mod p C2 = K.M mod p
· to decrypt the message
o extracts the message key K
§ K = C1xB mod p = [[alpha]]k.xB mod p
o extracts M by solving for M in the following equation:
§ C2 = K.M mod p
Other Public-Key Schemes
· a number of other public-key schemes have been proposed, some of the better known being:
o Knapsack based schemes
o McEleice's Error Correcting Code based schems
· ALL of these schemes have been broken
· the only currently known secure public key schemes are those based on exponentiation
(all of which are patented in North America)
· it has proved to be very difficult to develop secure public key schemes
· this in part is why they have not been adopted faster, as their theorectical advantages might
have suggested
AUTHENTICATION REQUIREMENTS
In the context of communication across a network, the following attacks can be identified:
Disclosure – releases of message contents to any person or process not possessing the
appropriate cryptographic key.
Traffic analysis – discovery of the pattern of traffic between parties.
Masquerade – insertion of messages into the network fraudulent source.
Content modification – changes to the content of the message, including
insertion deletion, transposition and modification.
Sequence modification – any modification to a sequence of messages between parties,
including insertion, deletion and reordering.
Timing modification – delay or replay of messages.
AUTHENTICATION FUNCTIONS
Any message authentication or digital signature mechanism can be viewed as having fundamentally
two levels. At the lower level, there may be some sort of function that produces an authenticator: a
value to be used to authenticate a message. This lower layer function is then used as primitive in a
higher-layer authentication protocol that enables a receiver to verify the authenticity of a message.
The different types of functions that may be used to produce an authenticator
are as follows:
Message encryption – the cipher text of the entire message serves as its
authenticator.
Message authentication code (MAC) – a public function of the message and a secret
key that produces a fixed length value serves as the authenticator.
Hash function – a public function that maps a message of any length into a fixed length
hash value, which serves as the authenticator.
Message encryption
Message encryption by itself can provide a measure of authentication. The analysis differs
from symmetric and public key encryption schemes.
Suppose the message can be any arbitrary bit pattern. In that case, there is no way to determine
automatically, at the destination whether an incoming message is the ciphertext of a legitimate
message. One solution to this problem is to force the plaintext to have some structure that is easily
recognized but that cannot be replicated without recourse to the encryption function. We could, for
example, append an error detecting code, also known as Frame Check Sequence (FCS) or checksum
to each message before encryption
‘A’ prepares a plaintext message M and then provides this as input to a function F that produces an
FCS. The FCS is appended to M and the entire block is then encrypted. At the destination, B
decrypts the incoming block and treats the result as a message with an appended FCS. B applies the
same function F to attempt to reproduce the FCS. If the calculated FCS is equal to the incoming
FCS, then the message is considered authentic.
In the internal error control, the function F is applied to the plaintext, whereas in external error
control, F is applied to the ciphertext (encrypted message).