Cryptography Lecture 1 Notes
Cryptography Lecture 1 Notes
— Confidentiality
o Data confidentiality
Assures that private or confidential information is not made available of
disclosed to unauthorised individuals
o Privacy
Assures that individuals control or influence what information related
to them may be collected and stored and by whom and to whom that
information may be disclosed
— Integrity
o Data integrity
Assures that information and programs are changed only in a specified
and authorised manner
o System integrity
Assures that a system performs its intended function in an unimpaired
manner free from deliberate or inadvertent authorised manipulation of
the system
— Availability
o Assures that systems work promptly and service is not denied to authorised
users
SECURITY ATTACKS
— Classification means (X.800 and RFC 4949) = passive attacks & active attacks
o Passive attacks: attempts to learn or make use of info from the system but does
not affect system resources. E.g. sniff wireless signals
o Active attacks: attempts to alter system resources to affect their operation. E.g.
man-in-the-middle attack
PASSIVE ATTACKS
— In nature of eavesdropping on, or monitoring of, transmissions
— Goal of the opponent is to obtain info that is being transmitted
— Two types of passive attacks are:
o The release of message contents
o Traffic analysis
ACTIVE ATTACKS
— Involves some modification of the data stream or the creation of a false stream
— Difficult to prevent because of the wide variety of potential physical, software, and
network vulnerabilities
— Goal is to detect attacks and to recover from any disruption or delays caused by them
— Some types:
o Masquerade:
Takes place when one entity pretends to be a different entity
Usually includes one of the other forms of active attack
o Replay:
Involves the passive capture of a data unity and its subsequent
retransmission to produce an unauthorised effect
o Modification of messages:
Some portion of a legitimate message is altered, or messages are
delayed or reordered to produce an unauthorised effect
o Denial of service:
Prevents or inhibits the normal use or management of communications
facilities
SECURITY MECHANISMS (X.800)
— Specific Security Mechanisms: may be incorporated into the appropriate protocol
layer in order to provide some of the OSI security services
o Encipherment: use of mathematical algorithms to transform data into a form
that is not readily intelligible. The transformation and subsequent recovery of
the data depend on an algorithm and zero or more encryption keys
o Digital Signature: data appended to, or a cryptographic transformation of, a
data unit that allows a recipient of the data unit to prove the source and integrity
of the data unit and protect against forgery (e.g., by the recipient)
o Access Control: variety of mechanisms that enforce access rights to resources
o Data Integrity: variety of mechanisms used to assure the integrity of a data
unit or stream of data units
o Authentication Exchange: mechanism intended to ensure the identity of an
entity by means of information exchange
o Traffic Padding: insertion of bits into gaps in a data stream to frustrate traffic
analysis attempts
o Routing Control: enables selection of particular physically secure routes for
certain data and allows routing changes, especially when a breach of security is
suspected
oNotarisation: use of a trusted third-party to assure certain properties of a data
exchange
— Pervasive Security Mechanisms: mechanisms that are not specific to any particular
OSI security service or protocol layer
o Trusted Functionality: that which is perceived to be correct with respect to
some criteria (e.g., as established by a security policy)
o Security Label: the marking bound to a resource (which may be a data unit)
that names or designates the security attributes of that resource
o Event Detection: detection of security-related events
o Security Audit Trail: data collected and potentially used to facilitate a security
audit, which is an independent review and examination of system records and
activities
o Security Recovery: deals with requests from mechanisms, such as event
handling and management functions, and takes recovery actions
MODEL FOR NETWORK SECURITY
CRYPTOGRAPHIC SYSTEMS
— Substitution & Transposition = the types of operations used for transforming plaintext
to ciphertext
— Symmetric, single-key, secret key, conventional encryption & Asymmetric, two-key, or
public-key encryption = the number of keys used
— Block cipher & Stream cipher = the way in which the plaintext is processed
SYMMETRIC ENCRYPTION
— also called conventional encryption or single-key encryption
— only type of encryption used prior to development of public-key encryption in 1970s
— remains by far the most widely used of the two types of encryption
o DES (Data Encryption Standard)
o AES (Advanced Encryption Standard)
(Figure.2.1.)
SUBSTITUITION TECHNIQUE
— Letters of plaintext are replaced by other letters or by numbers or symbols
— If plaintext viewed as sequence of bits: then substitution involves replacing plaintext bit
patterns with ciphertext bit patterns
CAESAR CIPHER
— Simplest and earliest known use of a substitution cipher
— Used by Julius Caesar
— Method: replace each letter of the alphabet with the letter standing three places further
down the alphabet | Note: Alphabet wrapped around (letter A follows after Z)
— E.g. meet (PHHW)
CASESAR CIPHER ALGORITHM
MONOALPHABETIC CIPHER
— permutation:
o of a finite set of elements S is an ordered sequence of all the elements of S, with
each element appearing exactly once
o if the ‘cipher’ line can be any permutation of the 26 alphabetic characters, then
there are 26! or greater than 4 x 1026 possible keys
this is orders of magnitude greater than the key space for DES
this approach is referred to as a monoalphabetic substitution cipher
because a single cipher alphabet is used per message
MONOAPLHABETIC CIPHERS
— easy to break because they reflect the frequency data of the original alphabet
— digram: two-letter combination. Most common is ‘th’
— trigram: three-letter combination. Most frequent is ‘the’
— countermeasure: provide multiple substitutes (homophones) for a single letter
PLAYFAIR CIPHER
— best known multiple-letter encryption cipher
— treats digrams in the plaintext as single units and translates these units into ciphertext
digrams
— based on the use of a 5 x 5 matrix of letters constructed using a keyword
— used as the standard file system by the British Army in WW1 and the U.S Army and
other Allied Forces during WW2
PLAYFAIR KEY MATRIX
— fill in letters of keyword (minus duplicates) from left to right and from top to bottom,
then fill in the remainder of the matrix with the remaining letters in alphabetic order
— using the keyword ‘MONARCHY’:
1. repeating the plaintext letters that are in the same pair are separated with a
filler letter, such as x, so that balloon would be treated as ‘ba lx lo on’
2. two plaintext letters that fall in the same row of the matrix are each
replaced by the letter to the right, with the first element of the row
circularly following the last. For example, ‘ar’ is encrypted as ‘RM’
3. two plaintext letters that fall in the same column are each replaced by the
letter beneath, with the top element of the column circularly following the
last. For example, ‘mu’ is encrypted as CM
4. otherwise, each plaintext letter in a pair is replaced by the letter that lies in
its own row and the column occupied by the other plaintext letter. Thus,
‘hs’ becomes ‘BP’ and ‘ea’ becomes ‘IM’ or (JM, as the encipherer) wishes
ROTOR MACHINES
— Enigma in WW2
— Multiple stages of encryption
o Each cylinder has 26 input pins and 26 output pins, with internal wiring that
connects each input pin to a unique output pin
o There are 26 * 26 * 26 = 17,576 different substitution alphabets
— Significance of rotor machine today is that it points the way to the most widely used
cipher: the Data Encryption Standard (DES)
STREAM CIPHER
— Encrypts a digital data stream one bit or one byte at a time
o Examples:
Autokeyed Vigenère cipher
Vernam cipher
— In the ideal case a one-time pad version of the Vernam cipher would be used, in which
the keystream is as long as the plaintext bit stream
o If the cryptographic keystream is random, then this cipher is unbreakable by
any means other than acquiring the keystream
Keystream must be provided to both users in advance via some
independent and secure channel
This introduces insurmountable logistical problems if the intended data
traffic is very large
— For practical reasons the bit-stream generator must be implemented as an algorithmic
procedure so that the cryptographic bit stream can be produced by both users
o It must be computationally impractical to predict future portions of the bit
stream based on previous portions of the bit stream
o The two users need only share the generating key and each can produce the
keystream
BLOCK CIPHER
— Stream cipher: encrypt bit by bit
— Block cipher: encrypt block by block
— A block of plaintext is treated as a whole and used to produce a ciphertext block of
equal length
— Typically a block size of 64 or 128 bits is used
— As with a stream cipher, the two users share a symmetric encryption key
— The majority of network-based symmetric cryptographic applications make use of
block ciphers
DES EXAMPLE
— Plaintext: 02468aceeca86420
— Key: 0f1571c947d9e859
— Ciphertext: da02ce3a89ecac3b
— Note: DES subkeys are shown as eight 6-bit values in hex format
AVALANCHE EFFECT IN DES: CHANGE IN PLAINTEXT
PROPERTIES OF CONGRUENCE
— Congruences have the following properties:
1. a = b (mod n) if n|(a – b)
2. a = b (mod n) implies b = a (mod n)
3. a = b (mod n) and b = c (mod n) imply a = c (mod n)
— To demonstrate the first point, if n|(a - b), then (a - b) = kn for some k
o So we can write a = b + kn
o Therefore, (a mod n) = (remainder when b + kn is divided by n) = (remainder
when b is
o divided by n) = (b mod n)
23 = 8 (mod 5) because 23 - 8 = 15 = 5 * 3
- 11 = 5 (mod 8) because - 11 - 5 = - 16 = 8 * (- 2)
81 = 0 (mod 27) because 81 - 0 = 81 = 27 * 3
MODULAR ARITHMETIC
— Modular arithmetic exhibits the following properties:
1. [(a mod n) + (b mod n)] mod n = (a + b) mod n
2. [(a mod n) - (b mod n)] mod n = (a - b) mod n
3. [(a mod n) * (b mod n)] mod n = (a * b) mod n
— We demonstrate the first property:
— Define (a mod n) = ra and (b mod n) = rb. Then we can write a = ra + jn for some integer
j and b = rb + kn for some integer k. Then
o (a + b) mod n = (ra + jn + rb + kn) mod n
o = (ra + rb + (k + j)n) mod n
o = (ra + rb) mod n
o = [(a mod n) + (b mod n)] mod n
11 mod 8 = 3; 15 mod 8 = 7
[(11 mod 8) + (15 mod 8)] mod 8 = 10 mod 8 = 2
(11 + 15) mod 8 = 26 mod 8 = 2
[(11 mod 8) - (15 mod 8)] mod 8 = - 4 mod 8 = 4
(11 - 15) mod 8 = - 4 mod 8 = 4
[(11 mod 8) * (15 mod 8)] mod 8 = 21 mod 8 = 5
(11 * 15) mod 8 = 165 mod 8 = 5
ADDITION MODULO 8 AND MULTIPLICATION MODULO 8
PROPERTIES OF MODULAR ARITHMETIC FOR INTEGERS IN Zn
GCD
— Because we require that the greatest common divisor be positive, gcd(a,b) = gcd(a,-b) =
gcd(-a,b) = gcd(-a,-b)
— In general, gcd(a,b) = gcd(| a |, | b |)
gcd(60, 24) = gcd(60, - 24) = 12
— Also, because all nonzero integers divide 0, we have gcd(a,0) = | a |
— We stated that two integers a and b are relatively prime if their only common positive
integer factor is 1;
o This is equivalent to saying that a and b are relatively prime if gcd(a,b) = 1
FIELDS
— A field F , sometimes denoted by {F, +,* }, is a set of elements with two binary
operations, called addition and multiplication, such that for all a, b, c in F the following
axioms are obeyed:
o (A1–M6)
F is an integral domain; that is, F satisfies axioms A1 through A5 and
M1 through M6
o (M7) Multiplicative inverse:
For each a in F, except 0, there is an element a-1 in F such that aa-1 =
(a-1 )a = 1
— In essence, a field is a set in which we can do addition, subtraction, multiplication,
and division without leaving the set. Division is defined with the following rule: a /b
= a (b-1 )
POLYNOMIAL DIVISION
— We can write any polynomial in the form:
o f(x) = q(x) g(x) + r(x)
— r(x) can be interpreted as being a remainder
— So r(x) = f(x) mod g(x)
— If there is no remainder, we can say g(x) divides f(x)
o Written as g(x) | f(x)
o We can say that g(x) is a factor of f(x)
o Or g(x) is a divisor of f(x)
— A polynomial f(x) over a field F is called irreducible if and only if f(x) cannot be
expressed as a product of two polynomials, both over F, and both of degree lower than
that of f(x)
o An irreducible polynomial is also called a prime polynomial
EXAMPLE OF POLYNOMIAL ARITHMETIC OVER GF(2)
ARITHMETIC IN GF(23)
POLYNOMIAL GCD
— The polynomial c(x) is said to be the greatest common divisor of a(x) and b(x) if the
following are true:
o c(x) divides both a(x) and b(x)
o Any divisor of a(x) and b(x) is a divisor of c(x)
— An equivalent definition is:
o gcd[a(x), b(x)] is the polynomial of maximum degree that divides both a(x) and
b(x)
— The Euclidean algorithm can be extended to find the greatest common divisor of two
polynomials whose coefficients are elements of a field
EXTENDED EUCLID [(X8 + X4 + X3 + X + 1), (X7 + X + 1)]
COMPUTATIONAL CONSIDERATIONS
— Since coefficients are 0 or 1, they can represent any such polynomial as a bit string
— Addition becomes XOR of these bit strings
— Multiplication is shift and XOR
— Modulo reduction is done by repeatedly substituting highest power with remainder of
irreducible polynomial (also shift and XOR)
in GF(23) have (x2+1) is 1012 & (x2+x+1) is 1112
so addition is
(x2+1) + (x2+x+1) = x
101 XOR 111 = 0102
and multiplication is
(x+1)·(x2+1) = x·(x2+1) + 1·(x2+1)= x3+x+x2+1 = x3+x2+x+1
011·101 = (101)<<1 XOR (101)<<0 = 1010 XOR 101 = 11112
USING A GENERATOR
— A generator g of a finite field F of order q (contains q elements) is an element whose
first q-1 powers generate all the nonzero elements of F
o The elements of F consist of 0, g0, g1, . . . ., gq-2
— Consider a field F defined by a polynomial f(x)
o An element b contained in F is called a root of the polynomial if f(b) = 0
— Finally, it can be shown that a root g of an irreducible polynomial is a generator of the
finite field defined on that polynomial
GENERATOR FOR GF(23) DEFINED ON X3 + X + 1
— Let us consider the finite field GF(23), defined over the irreducible polynomial x3 + x +
1,
— Generator g satisfies
f(g)=g3+g+1=0
— Then we have
g3 = -g-1=g+1
g4 = g(g3)=g(g+1)= g2 +g
g5 = g(g4)=g(g2 +g)= g3 + g2 = g2 +g+1
g6 = g(g5)=g(g2 +g+1)= g3+g2+g= g2 +g+g+1= g2 +1
g7 = g(g6)=g(g2 +1)= g3+g=g+g+1=1=g0
GF(23) ARITHMETIC USING GENERATOR FOR THE POLYNOMIAL (X3 + X + 1)
TWO WEEKS TO AES
FINITE FIELD ARITHMETIC
— In Advanced Encryption Standard (AES) all operations performed on 8-bit bytes
— The arithmetic operations of addition, multiplication, and division are performed over
the finite field GF(28)
— Field = a set in which we can do addition, subtraction, multiplication, and division
without leaving the set
— Division is defined with the following rule:
o a / b = a (b-1)
— An example of a finite field (one with a finite number of elements) is the set Z p
consisting of all the integers {0, 1, . . . . , p - 1}, where p is a prime number and in
which arithmetic is carried out modulo p
— Virtually all encryption algorithms, both conventional and public-key, involve
arithmetic operations on integers.
— Why finite field? Why polynomial arithmetic?
AES PARAMETERS
TRANSFORMATION
S-BOX RATIONALE
— The S-box is designed to be resistant to known cryptanalytic attacks
— The Rijndael developers sought a design that has a low correlation between input bits
and output bits and the property that the output is not a linear mathematical function of
the input
— The nonlinearity is due to the use of the multiplicative inverse
SHIFT-ROW TRANSFORMATION
MIXCOLUMN RATIONALE
— Coefficients of a matrix based on a linear code with maximal distance between code
words ensures a good mixing among the bytes of each column
— The mix column transformation combined with the shift row transformation ensures
that after a few rounds all output bits depend on all input bits
ADDROUNDKEY TRANSFORMATION
— The 128 bits of State are bitwise XOR with the 128 bits of the round key
— Operation is viewed as a columnwise operation between the 4 bytes of a State column
and one word of the round key
o Can also be viewed as a byte-level operation
— Rationale:
o Is as simple as possible and affects every bit of State
o The complexity of the round key expansion plus the complexity of the other
stages of AES ensure security
KEY EXPANSION
— Takes as input a four-word (16 byte) key and produces a linear array of 44 words (176
bytes)
— This is sufficient to provide a four-word round key for the initial AddRoundKey stage
and each of the 10 rounds of the cipher
— Key is copied into the first four words of the expanded key
— The remainder of the expanded key is filled in four words at a time
— Each added word w[i] depends on the immediately preceding word, w[i – 1], and the
word four positions back, w[i – 4]
— In three out of four cases a simple XOR is used
— For a word whose position in the w array is a multiple of 4, a more complex function is
used
KEY EXPANSION RATIONALE
— The Rijndael developers designed the expansion key algorithm to be resistant to
known cryptanalytic attacks
— Inclusion of a round-dependent round constant eliminates the symmetry between the
ways in which round keys are generated in different rounds
— The specific criteria that were used are:
o Knowledge of a part of the cipher key or round key does not enable calculation
of many other round-key bits
o An invertible transformation
o Speed on a wide range of processors
o Usage of round constants to eliminate symmetries
o Diffusion of cipher key differences into the round keys (each key bit affects
many round key bits)
o Enough nonlinearity to prohibit the full determination of round key differences
from cipher key differences only
o Simplicity of description
AES EXAMPLE
AVALANCHE EFFECT
— Change in plaintext:
o One-bit difference
0123456789abcdeffedcba9876543210 to
0023456789abcdeffedcba9876543210
AVALANCHE EFFECT (2)
SUMMARY
— Finite field arithmetic
— AES structure
o General structure
o Detailed structure
— AES key expansion
o Key expansion algorithm
o Rationale
— AES transformation functions
o Substitute bytes
o ShiftRows
o MixColumns
o AddRoundKey
— AES implementation
o Equivalent inverse cipher
o Implementation aspects
DOUBLE DES
— Given a plaintext P and two encryption keys K1 and K2 , ciphertext C is generated as
o C = E(K2 , E(K1 , P ))
— Decryption requires that the keys be applied in reverse order:
o P = D(K1 , D(K2 , C ))
— For DES, this scheme apparently involves a key length of 56 * 2 = 112 bits, resulting in
a dramatic increase in cryptographic strength
MEET-IN-THE-MIDDLE ATTACK
— The use of double DES results in a mapping that is not equivalent to a single DES
encryption
— The meet-in-the-middle attack algorithm will attack this scheme and does not depend
on any particular property of DES but will work against any block encryption cipher
— Given a known pair, (P, C), the attack proceeds as follows:
o First, encrypt P for all possible values of K1 and store results in a sorted table
o Next, decrypt C using all possible values of K2
o As each decryption, check the table for a match.
o If a match occurs, then test the two resulting keys against a new known
plaintext–ciphertext pair
o If the two keys produce the correct ciphertext, accept them as the correct keys.
CBC PROPERTIES
— Identical plaintexts result in identical ciphertexts when the same plaintext is enciphered
using the same key and IV. Changing at least one of [k, IV, m0] affects this.
— Rearrangement of ciphertext blocks affects decryption. As ciphertext part c j depends on
all of [p0, p1, · · · , pj].
— Error propagation:
o Bit error in ciphertext cj affects deciphering of cj and cj+1. Recovered block pj
typically results in random bits.
o Bit errors in recovered block pj+1 are precisely where cj was in error
o Attacker can cause predictable bit changes in pj+1 by altering cj.
— Bit recovery:
o CBC is self-synchronising if a bit error occurs in cj but not cj+1, then cj+2
correctly decrypts to pj+2.
CIPHER FEEDBACK MODE
— For AES, DES, or any block cipher, encryption is performed on a block of b bits In the
case of DES b = 64; In the case of AES b = 128
CTR PROPERTIES
— Identical plaintext results in identical ciphertext when the same plaintext is enciphered
using the same key and IV/Couter.
o Chaining Dependencies: (Same as a stream cipher) The key stream is plaintext
independent.
o Error propagation: (Same as a stream cipher) Bit errors in ciphertext blocks
cause errors in the same position in the plaintext.
o Error recovery: (Same as a stream cipher) Recovers from bit errors, but not bit
loss(misalignment of key stream)
o Throughput: Both encryption and decryption can be randomly accessed and/or
parallelised: the best we could hope for.
o IV must change: Otherwise it becomes a two-time pad
ADVANTAGES OF CTR
— Can do in parallel
o Hardware efficiency
o Software efficiency
— Pre-processing
— Random access
o Blocks can be encrypted/decrypted independently
— Provable security
o As secure as other modes
— Simplicity
o Encryption algorithm only
FEEDBACK CHARACTERISTICS OF MODES OF OPERATION
— The input registers are updated according to the output register
— Both OFB and CTR produce output that is independent of both the plaintext and the
ciphertext.
— If the last block has less than 128 bits, the last two blocks use a cipher-text-stealing
technique instead of padding.
SUMMARY
— Multiple encryption and triple DES
o Double DES
o Triple DES with two keys
o Triple DES with three keys
— Electronic code book
— Cipher block chaining mode
— Cipher feedback mode
— Output feedback mode
— Counter mode
— XTS-AES mode for block-oriented storage devices
o Storage encryption requirements
o Operation on a single block
o Operation on a sector
RANDOM NUMBERS
— A number of network security algorithms and protocols based on cryptography make
use of random binary numbers:
o Generation of a bit stream for symmetric stream encryption
o Session key generation
o Generation of keys for the RSA public-key encryption algorithm
o Key distribution and reciprocal authentication schemes
RANDOMNESS
— The generation of a sequence of allegedly random numbers being random in some well-
defined statistical sense has been a concern.
— Two criteria are used to validate that a sequence of numbers is random:
o Uniform distribution:
The frequency of occurrence of ones and zeros should be
approximately equal.
o Independence:
No one subsequence in the sequence can be inferred from the others.
PSEUDORANDOM NUMBERS
— Cryptographic applications typically make use of algorithmic techniques for random
number generation.
— These algorithms are deterministic and therefore produce sequences of numbers that
are not statistically random.
— If the algorithm is good, the resulting sequences will pass many tests of randomness and
are referred to as pseudorandom numbers.
TRNG / PRNG / PRF
PRNG REQUIREMENTS
— The basic requirement when a PRNG or PRF is used for a cryptographic application is
that an adversary who does not know the seed is unable to determine the
pseudorandom string.
— The requirement for secrecy of the output of a PRNG or PRF leads to specific
requirements in the areas of:
o Randomness
o Unpredictability
o Characteristics of the seed
RANDOMNESS
— The generated bit stream needs to appear random even though it is deterministic.
— There is no single test that can determine if a PRNG generates numbers that have the
characteristic of randomness
o If the PRNG exhibits randomness on the basis of multiple tests, then it can be
assumed to satisfy the randomness requirement.
— NIST SP 800-22 specifies that the tests should seek to establish three characteristics:
o Uniformity: # 1= #0
o Scalability: sub-sequences are random as well
o Consistency: consistent across seeds
UNPREDICTABILITY
— A stream of pseudorandom numbers should exhibit two forms of unpredictability:
— Forward unpredictability:
o If the seed is unknown, the next output bit in the sequence should be
unpredictable in spite of any knowledge of previous bits in the sequence.
— Backward unpredictability:
o It should not be feasible to determine the seed from knowledge of any
generated values. No correlation between a seed and any value generated from
that seed should be evident; each element of the sequence should appear to be
the outcome of an independent random event whose probability is ½.
— The same set of tests for randomness also provides a test of unpredictability.
o A random sequence will have no correlation with a fixed value (the seed)
SEED REQUIREMENTS
— The seed that serves as input to the PRNG must be secure and unpredictable.
— The seed itself must be a random or pseudorandom number.
— Typically the seed is generated by TRNG.
GENERATION OF SEED INPUT TO PRNG
— PRN is much longer than TRN.
— TRNG may produce a binary string with some bias.
— TRNG may be not fast enough.
PRNG DESIGN
— Algorithms fall into two categories:
o Purpose-built algorithms:
Algorithms designed specifically and solely for the purpose of
generating pseudorandom bit streams.
Example RC4 in WEP
o Algorithms based on existing cryptographic algorithms:
Have the effect of randomizing input data.
LINEAR CONGRUENTIAL GENERATOR
— An algorithm first proposed by Lehmer that is parameterized with four numbers:
o m the modulus m>0
o a the multiplier 0 < a< m
o c the increment 0≤ c < m
o X0 the starting value, or seed 0 ≤ X0 < m
— The sequence of random numbers {Xn} is obtained via the following iterative equation.
— Xn+1 = (aXn + c) mod m
— If m , a , c , and X0 are integers, then this technique will produce a sequence of integers
with each integer in the range 0 ≤ Xn < m
— The selection of values for a , c , and m is critical in developing a good random number
generator m is typically near to or equal to 231.
SKEW
— A TRNG may produce an output that is biased in some way, such as having more ones
than zeros or vice versa.
o Deskewing algorithms
o Methods of modifying a bit stream to reduce or eliminate the bias.
o One approach is to pass the bit stream through a hash function such as MD5
or SHA-1
o RFC 4086 recommends collecting input from multiple hardware sources and
then mixing these using a hash function to produce random output.
— Operating systems typically provide a built-in mechanism for generating random
numbers:
o Linux uses four entropy sources: mouse and keyboard activity, disk I/O
operations, and specific interrupts.
o Bits are generated from these four sources and combined in a pooled buffer.
o When random bits are needed the appropriate number of bits are read from the
buffer and passed through the SHA-1 hash function
COMPARISON OF PRNGs AND TRNGs
STREAM CIPHERS
STRENGTH OF RC4
SUMMARY
— Principles of pseudorandom number generation
o The use of random numbers
o TRNGs, PRNGs, and PRFs
o PRNG requirements
o Algorithm design
— Pseudorandom number generators
o Linear congruential generators
o Blum Blum Shub generator
— Pseudorandom number generation using a block cipher.
o PRNG using block cipher modes of operation.
o ANSI X9.17 PRNG
— Stream ciphers
— RC4
o Initialization of S
o Stream generation
o Strength of RC4
— True random number generators
o Entropy sources
o Comparison of PRNGs and TRNGs
o Skew