Unit V
Unit V
Unit V
Lecture Notes on
DIGITAL COMMUNICATION
UNIT-I
1
DIGITAL COMMUNICATION
ENCRYPTION AND DECRYPTION
CRYPTOGRAPHY:is the study of different ways to protect messages from unauthorized interception.
Encipher orencrypt is performed at transmitter.
Encryption is the transformation of messages at the transmitter.
Decipher or decrypt refers to the inverse transformation performed at the receiver.
The two primary reasons for using cryptosystems in communications are
1. PRIVACY-To prevent unauthorized persons from extracting the information from the channel
(EAVES DROPPING).
2. AUTHENTICATION-To prevent unauthorized persons from injecting information into the channel
(SPOOFING).
The model of a cryptographic channel is shown below
DK (C ) E K1 [ E K (M )]
“K” is a set of symbols or characters called key, which identify a specific encryption transformation E K from a
family of cryptographic transformation.
Originally, the security of crypto systems depends on the secrecy of the entire encryption process.
2
DIGITAL COMMUNICATION
Encryption schemes are of two types.
1. BLOCK ENCRYPTION
2. DATA STREAM OR SIMPLY STREAM ENCRYPTION
BLOCK ENCRYPTION: with block encryption, the plain text is segmented into blocks of fixed size, each
block is encrypted independently from others.
DATA STREAM ENCRYPTION: with data stream encryption, there is no fixed block size. Each plain text
bit, Mi is encrypted with the ith element Ki of a sequence of symbols generated with the key.
PERIODIC & NON PERIODIC ENCRYPTION: The encryption is periodic if the key stream repeats itself
after P-characters for some fixed P. Otherwise it is non periodic.
Successful cryptosystems are classified into two groups.
1. UNCONDITIONALLY SECURE
2. COMPUTATIONALLY SECURE
A system is said to be unconditionally secure when the amount of information available to the cryptanalyst is
insufficient to determine the encryption and decryption transformations, no matter how much computing
power a cryptanalyst has available.
One such system called a “one time pad” involves encrypting a message with a random key that is used one
time only. The key is never reused.
Computational security for x years, which means that under circumstances favorable to the cryptanalyst, the
system security could be broken in a period of x- years, but could not be broken in less than x-years.
CLASSIC THREATS:
1. CIPHER TEXT ONLY ATTACK: It is the weakest threat on a system. In this attack, the
cryptanalyst might have some knowledge of the general system and the language used in the message,
but the only significant data available to him is the encrypted transmission intercepted from the public
channel.
2. PLAIN TEXT ATTACK: It is a serious threat to a system. It involves the knowledge of the plain
text and knowledge of its cipher text counterpart.
3. CHOSEN PLAIN TEXT ATTACK: When the cryptanalyst is in the position of selecting the plain
text, the threat is termed a chosen plain text attack. Such an attack was used by the united states to
learn more about the Japanese crypto systems during world war II.
3
DIGITAL COMMUNICATION
2. POLYBIUS SQUARE: It is an another classic cipher system which is shown below. Letters I and J
are first combined and treated as a single character. Here the alphabet is arranged in a 5 x 5 array.
Encryption of any character is accomplished by choosing the appropriate row-column or column-row
number pair. The code is changed by a rearrangement of the letters in the 5x5 array.
There are several ways to select the Thrithimius progressive key. One way is called Vigenere key
method, employs a key word. For example, the key word is “TYPE”. The key indicates the row
choices for encryption and decryption of each successive character of the message.
4
DIGITAL COMMUNICATION
Name four factors needed for a secure network?
Privacy: The sender and the receiver expect confidentiality.
Authentication: The receiver is sure of the sender’s identity and that an imposter has
not sent the message.
Integrity: The data must arrive at the receiver exactly as it was sent.
Non-Reputation: The receiver must able to prove that a received message came from a specific sender.
5
DIGITAL COMMUNICATION
It is the standard crypto algorithm for data storage and mail systems, electronic fund transfers, and electronic
business data interchange.
The DES algorithm is a strong block cipher that operates on 64 bit blocks of plain text data and uses a 56 bit
key-it is designed in accordance with shannon’s methods of diffusion and confusion.
Essentially the same algorithm is used for encryption and decryption.
From a system input – output point of view, DES can be regarded as a block encryption system with an
alphabet size of 264 symbols, which is shown below.
The encryption algorithm starts with an initial permutation (IP) of the 64 plain text bits.
After this initial permutation, the heart of the encryption algorithm consists of 16 iterations using the standard
building block (SBB).
6
DIGITAL COMMUNICATION
The standard building block uses 48 bits of key to transform the 64 bit input data bits into 64 output data bits,
designated as 32 left half bits and 32 right half bits.
The output of each building block becomes the input to the next building block.
The input right half 32 bits (Ri-1) are copied unchanged to become the output left half 32 bits (Li).
The Ri-1 bits are also extended and transformed into 48 bits with the E-Table, then added with the 48 bits key
using the summer.
7
DIGITAL COMMUNICATION
DATA ENCRYPTION STANDARD
STREAM ENCRYPTION:
A stream encryption system uses a random key stream, ie the key sequence never repeats.
Thus perfect secrecy can be achieved for an infinite number of messages since each message would
be encrypted with a different portion of the random key stream.
8
DIGITAL COMMUNICATION
Stream encryption techniques use pseudo random (PN) sequences. However these sequences are
deterministic.
These techniques are popular because encryption and decryption algorithms are readily implemented
with feedback shift registers.
Key generation using a linear feedback shift register is shown below.
A shift register can be converted into a pseudo random sequence generator by including a feedback loop.
The initial state of the stages (X4,X3,X2,X1) is 1000, the next stage is triggered by clock pulses would be
1000, 0100, 0010, 1001,1100,and so on.
SYNCHRONOUS AND SELF SYNCHRONOUS STREAM ENCRYPTION SYSTEMS: In the
synchronous stream encryption systems, the key stream is generated independently of the message.
In this type a lost character during transmission necessitates a resynchronization of the transmitter and
receiver key generators.
In a self synchronous stream cipher each key character is derived from a fixed number, N, of the preceding
cipher text characters giving rise to the name cipher feedback.
In this system the cipher text character is lost during transmission, the error propagates forward for n
characters but the system resynchronizes itself after n correct cipher text characters are received.
9
DIGITAL COMMUNICATION
CDMA SPREAD SPECTRUM BASICS
CDMA is based around the use of direct sequence spread spectrum techniques.
Essentially CDMA is a form of spread spectrum transmission which uses spreading codes to spread the signal
out over a wider bandwidth then would normally be required.
By using CDMA spread spectrum technology, many users are able to use the same channel and gain access to
the system without causing undue interference to each other.
Although as the number of users increases care has to be taken to ensure that interference levels do not rise to
the extent that performance falls, it is still possible to provide access to a large number of different users and
allow them access.
The key element of code division multiple access CDMA is its use of a form of transmission known as direct
sequence spread spectrum, DSSS.
Direct sequence spread spectrum is a form of transmission that looks very similar to white noise over the
bandwidth of the transmission.
However once received and processed with the correct descrambling codes, it is possible to extract the
required data.
When transmitting a CDMA spread spectrum signal, the required data signal is multiplied with what is known
as a spreading or chip code data stream. The resulting data stream has a higher data rate than the data itself.
Often the data is multiplied using the XOR (exclusive OR) function.
10
DIGITAL COMMUNICATION
CDMA spreading
Each bit in the spreading sequence is called a chip, and this is much shorter than each information bit. The
spreading sequence or chip sequence has the same data rate as the final output from the spreading multiplier.
The rate is called the chip rate, and this is often measured in terms of a number of M chips / sec.
The baseband data stream is then modulated onto a carrier and in this way the overall the overall signal is
spread over a much wider bandwidth than if the data had been simply modulated onto the carrier. This is
because, signals with high data rates occupy wider signal bandwidths than those with low data rates.
In order to visualise how the CDMA spread spectrum process operates, the easiest method is to show an
example of how the system actually operates in terms of data bits, and how the data is recovered from the
CDMA spread spectrum signal.
11
DIGITAL COMMUNICATION
The first part of the process is to generate the CDMA spread spectrum signal. Take as an example that the data
to be transmitted is 1001, and the chip or spreading code is 0010. For each data bit, the complete spreading
code is used to multiple the data, and in this way, for each data bits, the spread or expanded signal consists of
four bits.
1 0 0 1 Data to be transmitted
0010 0010 0010 0010 Chip or spreading code
1101 0010 0010 1101 Resultant spread data output
With the signal obtained and transmitted, it needs to be decoded within the remote receiver:
1101 0010 0010 1101 Incoming CDMA signal
0010 0010 0010 0010 Chip or spreading code
1111 0000 0000 1111 Result of de-spreading
1 0 0 1 Integrated output
NB: 1 x 1 = 0 1x0=1
In this way it can be seen that the original data is recovered exactly by using the same spreading or chip code.
Had another code been used to regenerate the CDMA spread spectrum signal, then it would have resulted in a
random sequence after de-spreading. This would have appeared as noise in the system.
The spreading code used in this example was only four bits long. This enabled the process to be visualized
more easily. Commonly spreading codes may be 64 bits, or even 128 bits long to provide the required
performance.
The bandwidth of the CDMA spread spectrum signal will be much wider than the original data stream. To
quantify the increase in bandwidth, a term known as the spreading gain is used. If the bandwidth of the CDMS
spread spectrum signal is W and the input data bit length or period 1/R then the CDMA spreading gain can be
defined:
Spreading gain = W / R
It is found that the larger the spreading gain of the CDMA spread spectrum signal, the more effective the
performance of the system is. This is because the wanted signal becomes larger. In the example shown above,
the spreading gain is four, as seen by the fact that four "1"s are generated for each required data bit. Data
produced by other dispreading codes would appear as noise and can be discarded as it would be lower in
value.
The principle behind CDMA spread spectrum communications is relatively straightforward. The same code
must be sued within generation and decoding of the CDMA spread spectrum signal to enable the data to pass
unchanged through the system. The use of a different code in transmission and reception results in a signal
similar in character to noise being generated and this can be discarded.
12
DIGITAL COMMUNICATION
RSA ALGORITHM
RSA is one of the first practicable public-key cryptosystems and is widely used for secure data transmission.
In such acryptosystem, the encryption key is public and differs from the decryption key which is kept secret.
In RSA, this asymmetry is based on the practical difficulty of factoring the product of two large prime
numbers, the factoring problem.
RSA stands for Ron Rivest, Adi Shamir and Leonard Adleman, who first publicly described the algorithm in
1977.Clifford Cocks, an English mathematician, had developed an equivalent system in 1973, but it was
not declassified until 1997.
A user of RSA creates and then publishes a public key based on the two large prime numbers, along with an
auxiliary value.
The prime numbers must be kept secret. Anyone can use the public key to encrypt a message, but with
currently published methods, if the public key is large enough, only someone with knowledge of the prime
numbers can feasibly decode the message.
Breaking RSA encryption is known as the RSA problem. It is an open question whether it is as hard as the
factoring problem.
The public key can be known by everyone and is used for encrypting messages. Messages encrypted with the
public key can only be decrypted in a reasonable amount of time using the private key.
The keys for the RSA algorithm are generated the following way:
This is more clearly stated as: solve for d given d⋅e ≡ 1 (mod φ(n))
This is often computed using the extended Euclidean algorithm. Using the pseudocode in the Modular
integers section, inputs a and n correspond to eand φ(n), respectively.
d is kept as the private key exponent.
13
DIGITAL COMMUNICATION
The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the
modulus n and the private (or decryption) exponent d, which must be kept secret. p, q, and φ(n) must also be kept
secret because they can be used to calculate d.
An alternative, used by PKCS#1, is to choose d matching de ≡ 1 (mod λ) with λ = lcm(p − 1, q − 1), where
lcm is the least common multiple. Using λ instead of φ(n) allows more choices for d. λ can also be defined
using the Carmichael function, λ(n).
The ANSI X9.31 standard prescribes, IEEE 1363 describes, and PKCS#1 allows, that p and q match
additional requirements: being strong primes, and being different enough that Fermat factorization fails.
Encryption[edit]
Alice transmits her public key (n, e) to Bob and keeps the private key d secret. Bob then wishes to send
message M to Alice.
He first turns M into an integer m, such that 0 ≤ m < n by using an agreed-upon reversible protocol known as
a padding scheme. He then computes the ciphertext ccorresponding to
This can be done efficiently, even for 500-bit numbers, using Modular exponentiation. Bob then
transmits c to Alice.
Note that at least nine values of m will yield a ciphertext c equal to m,[note 1] but this is very unlikely to occur
in practice.
Decryption[edit]
Alice can recover m from c by using her private key exponent d via computing
Given m, she can recover the original message M by reversing the padding scheme.
(In practice, there are more efficient methods of calculating cd using the precomputed values below.)
A worked example[edit]
Here is an example of RSA encryption and decryption. The parameters used here are artificially small,
but one can also use OpenSSL to generate and examine a real keypair.
14
DIGITAL COMMUNICATION
4. Choose any number 1 < e < 3120 that is coprime to 3120. Choosing a prime number for e leaves
us only to check that e is not a divisor of 3120.
Let
5. Compute d, the modular multiplicative inverse of e (mod φ(n)) yielding,
The public key is (n = 3233, e = 17). For a padded plaintext message m, the encryption function is
The private key is (n = 3233, d = 2753). For an encrypted ciphertext c, the decryption function is
The values dp, dq and qinv, which are part of the private key are computed as follows:
Here is how dp, dq and qinv are used for efficient decryption. (Encryption is efficient
by choice of public exponent e)
15
DIGITAL COMMUNICATION
RSA Algorithm Example
Choose p = 3 and q = 11
Compute n = p * q = 3 * 11 = 33
Compute φ(n) = (p - 1) * (q - 1) = 2 * 10 = 20
Choose e such that 1 < e <φ(n) and e and n are coprime. Let e = 7
Compute a value for d such that (d * e) % φ(n) = 1. One solution is d = 3 [(3 * 7) % 20 = 1]
Public key is (e, n) => (7, 33)
Private key is (d, n) => (3, 33)
The encryption of m = 2 is c = 27 % 33 = 29
The decryption of c = 29 is m = 293 % 33 = 2
16
DIGITAL COMMUNICATION