Unit V

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

MANAKULA VINAYAGAR INSTITUTE OF TECHNOLOGY

Kalitheerthal kuppam, Madagadipet-605107

DEPARTMENT ELECTRONICS AND COMMUNICATION ENGINEERING

Lecture Notes on

DIGITAL COMMUNICATION

UNIT-I

Year III Semester VI

1
DIGITAL COMMUNICATION
ENCRYPTION AND DECRYPTION

MODEL ENCRYPTOR-DECRYPTOR (MODEL OF A CRYPTOGRAPHIC CHANNEL)

 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

 PLAIN TEXT: A message before encryption is called plain text (M).


 CIPHER TEXT: A message ( plain text) M is encrypted by the use of an invertible transformation, E k, that
produces cipher text.
 CIPHER TEXT, C = EK (M)
 The cipher text is transmitted over an insecure or public channel.
1
 When an authorized receiver obtains C, he decrypts it with the inverse transformation DK  E K , to obtain
original plain text.

DK (C )  E K1 [ 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.

CLASSICAL ENCRYPTION TECHNIQUES {CLASSIC CIPHERS]:


1. CEASER CIPHER:It is used by Julius Ceasar during the Gallic wars. Each plain text letter is
replaced with a new letter obtained by an alphabetic shift. This type of encryption transformation is
shown below. It uses a 3-end- around shift of the alphabet. The decryption key is simply the number
of alphabetic shifts. The code is changed by choosing a new key.

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.

3. TRITHEMIUS PROGRESSIVE KEY: It is an example of a poly alphabetic cipher. The row


labeled shift 0 is identical to the usual arrangement of the alphabet.
EXAMPLE: one method of using such an alphabet is to select the first cipher character from first
row, the second cipher character from second row, and so on.

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.

DATA ENCRYPTION STANDARD (DES):


 The data encryption standard (DES) is certainly the best known, and the most widely used, secret- key crypto
algorithm; the term algorithm is used to describe a sequence of computations.
 The basic DES algorithm can be used for both data encryption and data authentication.

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.

 (Ri-1)E  Ki = B1, B2, --------B8.


 Each of the eight 6-bit blocks, Bj, is then used as an input to the S box function.
 Thus the input 48 bits are transformed by the s-box to 32- bits.
 The S-box is then permuted using P-table which is shown below.

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.

CDMA spread spectrum generation


 To decode the signal and receive the original data, the CDMA signal is first demodulated from the carrier to
reconstitute the high speed data stream. This is multiplied with the spreading code to regenerate the original
data. When this is done, then only the data with that was generated with the same spreading code is
regenerated, all the other data that is generated from different spreading code streams is ignored.

CDMA spread spectrum decoding


 The use of CDMA spread spectrum is a powerful principle and using this CDMA technique, it is possible to
transmit several sets of data independently on the same carrier and then reconstitute them at the receiver
without mutual interference. In this way a base station can communicate with several mobiles on a single
channel. Similarly several mobiles can communicate with a single base station, provided that in each case an
independent spreading code is used.

CDMA spread spectrum encode / decode process

 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.

CDMA spreading gain

 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.

 RSA involves a public key and a private key.

 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:

1. Choose two distinct prime numbers p and q.


 For security purposes, the integers p and q should be chosen at random, and should be of similar bit-
length. Prime integers can be efficiently found using a primality test.
2. Compute n = pq.
 n is used as the modulus for both the public and private keys. Its length, usually expressed in bits, is
the key length.
3. Compute φ(n) = φ(p)φ(q) = (p − 1)(q − 1) = n - (p + q -1), where φ is Euler's totient function.
4. Choose an integer e such that 1 < e <φ(n) and gcd(e, φ(n)) = 1; i.e., e and φ(n) are co-prime.
 e is released as the public key exponent.
 e having a short bit-length and small Hamming weight results in more efficient encryption – most
commonly 216 + 1 = 65,537. However, much smaller values of e (such as 3) have been shown to be less
secure in some settings.[5]
5. Determine d as d ≡ e−1 (mod φ(n)); i.e., d is the multiplicative inverse of e (modulo φ(n)).

 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.

1. Choose two distinct prime numbers, such as


and
2. Compute n = pq giving

3. Compute the totient of the product as φ(n) = (p − 1)(q − 1) giving

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,

Worked example for the modular multiplicative inverse:

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

For instance, in order to encrypt m = 65, we calculate

To decrypt c = 2790, we calculate

Both of these calculations can be computed efficiently using the square-and-multiply


algorithm for modular exponentiation. In real-life situations the primes selected would
be much larger; in our example it would be trivial to factor n, 3233 (obtained from the
freely available public key) back to the primes p and q. Given e, also from the public
key, we could then compute d and so acquire the private key.

Practical implementations use the Chinese remainder theorem to speed up the


calculation using modulus of factors (mod pq using mod p and mod q).

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy