You are on page 1of 72

INTRODUCTION TO

COMMUNICATIONS

COURSE no. 4

Assoc. Prof. Luminiţa SCRIPCARIU

10/24/2018 Luminita Scripcariu 1


FROM THE PREVIOUS COURSE

 LOSS COMPRESSION TECHNIQUES


 ADC
 PCM, DPCM, ADPCM, DELTA
 DCT
 JPEG, MPEG
 RSA Encryption Algorithm

* What do the abbreviations above mean?


10/24/2018 Luminita Scripcariu 2
QUESTION 1
The operation that rounds the samples’
values of a signal to a finite set of levels
is called:
 quantization
 sampling
 filtering
 coding

10/24/2018 Luminita Scripcariu 3


QUESTION 1
The operation that rounds the samples’
values of a signal to a finite set of levels
is called:
 quantization
 sampling
 filtering
 coding

10/24/2018 Luminita Scripcariu 4


QUESTION 2
The operation of ‘reading’ the signal at
discrete moments is called:
 quantization
 sampling
 filtering
 coding

10/24/2018 Luminita Scripcariu 5


QUESTION 2
The operation of ‘reading’ the signal at
discrete moments is called:
 quantization
 sampling
 filtering
 coding

10/24/2018 Luminita Scripcariu 6


QUESTION 3
In order to maintain a constant
quantization SNR, the quantum must be:
 Adapted to the signal
 Increased
 Decreased
 Constant

10/24/2018 Luminita Scripcariu 7


QUESTION 3
In order to maintain a constant
quantization SNR, the quantum must be:
 Adapted to the signal
 Increased
 Decreased
 Constant

10/24/2018 Luminita Scripcariu 8


QUESTION 4
Nyquist frequency is equal to:
 The maximum frequency of the signal
spectrum
 The maximum frequency’s double value
of the signal spectrum
 The signal’s bandwidth
 The cut-off frequency’s double value of
the pre-sampling LPF

10/24/2018 Luminita Scripcariu 9


QUESTION 4
Nyquist frequency is equal to:
 The maximum frequency of the signal
spectrum
 The maximum frequency’s double value
of the signal spectrum
 The signal’s bandwidth
 The cut-off frequency’s double value of
the pre-sampling LPF

10/24/2018 Luminita Scripcariu 10


QUESTION 5
DCT is used for:
 lossless compression algorithms
 loss compression algorithms
 error-correction techniques
 equalizing techniques

10/24/2018 Luminita Scripcariu 11


QUESTION 5
DCT is used for:
 lossless compression algorithms
 loss compression algorithms
 error-correction techniques
 equalizing techniques

10/24/2018 Luminita Scripcariu 12


QUESTION 6
What can be used for audio compression?
 JPEG
 MPEG-1
 MPEG-2
 MPEG-4

10/24/2018 Luminita Scripcariu 13


QUESTION 6
What can be used for audio compression?
 JPEG
 MPEG-1
 MPEG-2
 MPEG-4

10/24/2018 Luminita Scripcariu 14


QUESTION 7
Which of the following algorithms are
used for HDTV?
 JPEG
 MPEG-1
 MPEG-2
 MPEG-4

10/24/2018 Luminita Scripcariu 15


QUESTION 7
Which of the following algorithms are
used for HDTV?
 JPEG
 MPEG-1
 MPEG-2
 MPEG-4

10/24/2018 Luminita Scripcariu 16


QUESTION 8
Which of the following algorithms are used
for 3D image compression?
 JPEG
 MPEG-1
 MPEG-2
 MPEG-4

10/24/2018 Luminita Scripcariu 17


QUESTION 8
Which of the following algorithms are used
for 3D image compression?
 JPEG
 MPEG-1
 MPEG-2
 MPEG-4

10/24/2018 Luminita Scripcariu 18


QUESTION 9
Which of the following algorithms mark the
multimedia files with a digital signature ?
 MPEG-1
 MPEG-2
 MPEG-4
 MPEG-7

10/24/2018 Luminita Scripcariu 19


QUESTION 9
Which of the following algorithms mark the
multimedia files with a digital signature ?
 MPEG-1
 MPEG-2
 MPEG-4
 MPEG-7

10/24/2018 Luminita Scripcariu 20


10. PROPOSED EXERCISE
A sinusoidal signal having 5V amplitude (A)
and 10kHz frequency is uniformly quantized
with 5 quantization bits. Calculate:
1. The quantum value: q (V, mV)
2. The quantization noise power: Nq (W, mW)
3. The dB value of the quantization SNR: S/Nq (dB).
* Tip: S = A2/2.

10/24/2018 Luminita Scripcariu 21


DATA CODING TECHNIQUES
• COMPRESSION
• ENCRYPTION
• ERROR-CORRECTION
• LINE CODING

10/24/2018 Luminita Scripcariu 22


BASICS OF ENCRYPTION
• Encryption – Decryption algorithms

• Cryptografic Algorithms

• Plaintext

• Ciphertext

• Key

• Cryptanalysis

• Cryptographic Attacks
10/24/2018 Luminita Scripcariu 23
Cryptographic Techniques
• Symmetric-key techniques – use private keys
 DES, TDES, IDEA, AES, RC4
 substitution techniques
 transposition techniques
• Asymmetric-key techniques – Public-Key
Cryptography use public encryption keys but
private decryption keys
e.g. RSA, El Gamal, Backpack Algorithm
10/24/2018 Luminita Scripcariu 24
Acronyms
• DES – Data Encryption Standard
• TDES = 3DES – Triple DES
• AES – Advanced Encryption Standard
• IDEA – International Data Encryption
Algorithm
• RC - Rivest Cipher 4
• RSA – Rivest, Shamir, Adleman

10/24/2018 Luminita Scripcariu 25


Public-Key Cryptographic System
(PKCS)

10/24/2018 Luminita Scripcariu 26


RSA
• Rivest, Shamir, Adleman
• Public key (PK) algorithm
• Used for digital signature
• Applied on decimal values (e.g. ASCII codes
of the characters)
• It has some weaknesses.
• The keys must be well analyzed in order to
avoid weak keys.
10/24/2018 Luminita Scripcariu 27
RSA Algorithm Design
• Choose 2 prime numbers, p and q.
• Calculate the PK component n:
n  pq
• Compute the Euler’ totient function:
(n)  ( p  1)( q  1)
• Calculate the exponent e (the second PK
component), so that e and the Euler’ totient
function are coprime:
gcd[ e, (n)]  1, 2  e  (n)
10/24/2018 Luminita Scripcariu 28
RSA Algorithm
• Encrypts the decimal value of the message
block corresponding to:
C  M (mod n), M  n
e

• Decryption is made using the decryption


exponent, d:
D  C (mod n)
d

• The private exponent, d, is the modular


multiplicative inverse of e (modulo Φ(n)) :
d  e  1 (mod (n))
10/24/2018 Luminita Scripcariu 29
Remarks

• Long messages are split into short blocks


and separately encoded, block-by-block.

• The encryption key length is the length of n


expressed in bits (e.g. RSA-1024).

10/24/2018 Luminita Scripcariu 30


Example:
p=5, q=11, M=5
n=?
(n)=?
e=?
d=?
C=?
10/24/2018 Luminita Scripcariu 31
Solved Exercise

The bit-sequence 00000111 is encrypted by


RSA algorithm with the PK (3, 391).
Calculate the encrypted binary sequence.

10/24/2018 Luminita Scripcariu 32


Answer Key
Input: 00000111

m=7, e=3, n=391

(3,391) is the public key

c=m^e (mod-n)=7^3 = 343 (mod-391)

Output: 101010111
10/24/2018 Luminita Scripcariu 33
PROPOSED EXERCISE
Let us consider p=3, q=7 and the RSA algorithm.
1. Calculate the component n of the PK, the
Euler’s totient function and the encryption
exponent e.
2. Encrypt the decimal value M = 3 using RSA
algorithm.
3. Convert the encrypted value in binary form.

10/24/2018 Luminita Scripcariu 34


Remarks
• If the number of bits used to express the
input value of RSA in binary form is b, than
the number of bits used to express the
output value of RSA in binary form is b+1.
• Number b must obey the condition
2^(b+1)<=n.

10/24/2018 Luminita Scripcariu 35


How robust is the RSA algorithm?

Its robustness is based on the difficulty of


factorizing large numbers with at least 300
ciphers from 0 to 9.

10/24/2018 Luminita Scripcariu 36


PRIVATE-KEY CRYPTOSYSTEM

C=EKe (M) , M=DKd (C)=E-1 (C)


Ke=Kd

10/24/2018 Luminita Scripcariu 37


Private-Key Encryption
Algorithms

• DES – binary, 64-bit key

• TDES – binary, 128-bit key

• AES – applied on bytes, 128-bit,


192-bit or 256-bit keys
10/24/2018 Luminita Scripcariu 38
DES
DATA ENCRYPTION STANDARD
• Symmetric-key cryptosystem
• Binary encryption algorithm
• 64-bit key
Steps:
• Initial Permutation
• 48-bit Subkeys Schedule
• 16 encryption iterations
• Final Permutation

10/24/2018 Luminita Scripcariu 39


1. Initial Permutation

10/24/2018 Luminita Scripcariu 40


2. SUBKEY SCHEDULE
• From the initial 64-bit private key, 8 parity
bits are removed so a 56-bit sequence is
obtained.
• 16 subkeys are extracted from the 56-bit
sequence.
• A subkey is 48 bits long.
• Usually a bit from the initial key is used in
14 subkeys.

10/24/2018 Luminita Scripcariu 41


3. Encryption Iterations

10/24/2018 Luminita Scripcariu 42


One Encryption Iteration

Li 1  Ri Ri 1  Li  f ( Ri , Ki )
Feistel function (f) expands the half-block data sequence from
32 bits to 48 bits, applies the subkey and compresses the
result back to 32 bits with 8 shift-boxes (called S-boxes).
10/24/2018 Luminita Scripcariu 43
4. FINAL PERMUTATION

10/24/2018 Luminita Scripcariu 44


DES EXAMPLE
• Plaintext: Mihaela

• ASCII Codes:

77 105 104 97 101 108 97

• Ciphertext:

48 162 42 254 11 11 117 127

• Displayed Message: 0¢*þ••u•

10/24/2018 Luminita Scripcariu 45


Remark

Permutation is a transposition function.

It changes the positions of the elements


without changing their values.

10/24/2018 Luminita Scripcariu 46


Exercise
• Apply the permutation vector [3 1 2 4] on
the character sequence [e t t i].

• Apply the inverted permutation on the


resulted sequence and check the result.

10/24/2018 Luminita Scripcariu 47


Answer Key
• [3 1 2 4] = [c3, c1, c2, c4]
• [e t t i] = [c1, c2, c3, c4] becomes [t e t i]

• [2 3 1 4] = [c2, c3, c1, c4]


• [t e t i] becomes [e t t i].

10/24/2018 Luminita Scripcariu 48


PROPOSED EXERCISE
• Permutate the character sequence:

[t e l e c o m]

using the permutation vector [2 5 4 3 1 7 6].

• What is the inverted permutation vector?

10/24/2018 Luminita Scripcariu 49


Remark
• DES is vulnerable to brute force attack
due to the short encryption key.

10/24/2018 Luminita Scripcariu 50


TDES
• 3DES
• Triple DES – 128-bit key

• DES is applied three times, one after


another:
E – E - E or E – D – E,
using the key combination k1 – k2 – k1.

10/24/2018 Luminita Scripcariu 51


Encryption Algorithms’
Performances
Are evaluated by:
• The length of the encryption key

• The processing time

• Robustness

10/24/2018 Luminita Scripcariu 52


AES

10/24/2018 Luminita Scripcariu 53


AES

• Advanced Encryption Standard

• Defined on finite algebraic fields, called


Galois Fields, with 256 elements
expressed as 8-bit numbers

• This field is denoted GF(28).

10/24/2018 Luminita Scripcariu 54


Galois Field (GF)
• Algebraic finite field

• The elements can be expressed on a


specific number of bits (m)

• 2m elements => GF(2m)


• Internal operations of addition and
multiplication.

10/24/2018 Luminita Scripcariu 55


Galois Fields Applications

• Design of binary codes on GF(2)

• Design of AES algorithm on GF(256)

• Design of error-correction codes on large


GFs with multibit symbols.

10/24/2018 Luminita Scripcariu 56


GALOIS FIELD
• The field elements can be expressed in
binary, decimal, polynomial or exponential
form.
• Do not make any confusion with the
algebraic fields Zn (e.g Z15 which operates
modulo-15 and some elements cannot be
inverted!)

10/24/2018 Luminita Scripcariu 57


GF Arithmetic
• Addition: modulo-2, bit-by-bit.
• Multiplication: the polynomials of the
elements are multiplied modulo-p(x)
• p(x) – m-order primitive polynomial,
irreducible in binary field.
Example: GF(4), m = 2, p(x) = x^2+x+1
GF(4) = {0,1,2,3} = {00,01,10,11} =
= {0, 1, x, x+1} = {0, 1 , 2, 2^2}
10/24/2018 Luminita Scripcariu 58
GF(8)

• GF(8) = {0, 1, 2, 3, 4, 5, 6, 7}
• p(x)=x3 +x +1
• m=3 (3-bit symbols)

10/24/2018 Luminita Scripcariu 59


GF(8) Elements
Decimal Binary
Exponential
Values Values Polynomials
Form
(integers)
0 000 0 0

1 001 1 1

2 010 x α

3 011 x+1 α3

4 100 x2 α2

5 101 x2+1 α6

6 110 x2+x α4

7 111 x2+x+1 α5

10/24/2018 Luminita Scripcariu 60


Particular Feature of GFs

• Any symbol of GF(2^m), raised to power


of N = 2^m-1, is equal to 1!

10/24/2018 Luminita Scripcariu 61


Remarks
• Multiplication, division and raising to power
of numbers is easier done using the
exponential form of the elements!

• Multiplication in GF(2m) can be done by


addition of the exponents mod(2m -1).

10/24/2018 Luminita Scripcariu 62


Inverse of an Element
• b*b-1 = 1
The multiplication’s results of any two elements of
GF(8):
PGF8 = [ 0 0 0 0 0 0 0 0;
0 1 2 3 4 5 6 7;
0 2 4 6 3 1 7 5;
0 3 6 5 7 4 1 2;
0 4 3 7 6 2 5 1;
0 5 1 4 2 7 3 6;
0 6 7 1 5 3 2 4;
0 7 5 2 1 6 4 3];
10/24/2018 Luminita Scripcariu 63
PROPOSED EXERCISE

• Calculate in GF(8):

(1+3*5+6^2)/7

10/24/2018 Luminita Scripcariu 64


Other Arithmetical Operations
defined in GF
• Subtraction: a-b = a+(-b) (-b = oposite of b)
• Division: a/b = a*b-1
• The kth root: a1/k = aq
• (q,k) complementary values
• qk mod(N)=1. It exists if m and N are prime
numbers.
• Matrix operations, determinant of matrices.
• n-DFT, n-IDFT if and only if n divides N.
10/24/2018 Luminita Scripcariu 65
DFT, IDFT

10/24/2018 Luminita Scripcariu 66


7-DFT
C  7  DFT (c)  Omega7  c

10/24/2018 Luminita Scripcariu 67


Remark
• All the arithmetic operations between
matrices and vectors are done by obeying
the rules of the Galois field, not like in the
case of decimal numbers!

10/24/2018 Luminita Scripcariu 68


Example

Calculate 7-DFT of the vector [0,1,2,3,4,5,6]


in GF(8).

10/24/2018 Luminita Scripcariu 69


W7 Matrix
Omega7 = [1 1 1 1 1 1 1;
1 2 4 3 6 7 5;
1 4 6 5 2 3 7;
1 3 5 4 7 2 6;
1 6 2 7 4 5 3;
1 7 3 2 5 6 4;
1 5 7 6 3 4 2];

10/24/2018 Luminita Scripcariu 70


Answer Key

C  7  DFT (c)  Omega7  c


C = [0 1 2 3 4 5 6]

C = [7 4 4 7 0 3 3]

10/24/2018 Luminita Scripcariu 71


PROPOSED EXERCISE

• Calculate 7-DFT of the vector


[0,1,0,2,0,3,0] in GF(8).

10/24/2018 Luminita Scripcariu 72

You might also like