0% found this document useful (0 votes)
15 views23 pages

Cns 19773

The document discusses classical encryption techniques, focusing on symmetric ciphers, which use a single key for both encryption and decryption. It explains key concepts such as ciphertext, enciphering, and various encryption methods including substitution techniques like the Caesar cipher, monoalphabetic ciphers, and polyalphabetic ciphers like the Vigenère cipher. Additionally, it introduces advanced ciphers such as the Vernam cipher and the One Time Pad, emphasizing their security features and operational mechanisms.

Uploaded by

Aritra Pain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views23 pages

Cns 19773

The document discusses classical encryption techniques, focusing on symmetric ciphers, which use a single key for both encryption and decryption. It explains key concepts such as ciphertext, enciphering, and various encryption methods including substitution techniques like the Caesar cipher, monoalphabetic ciphers, and polyalphabetic ciphers like the Vigenère cipher. Additionally, it introduces advanced ciphers such as the Vernam cipher and the One Time Pad, emphasizing their security features and operational mechanisms.

Uploaded by

Aritra Pain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

MODULE 2

Classical Encryption Techniques: A SYMMETRIC CIPHER MODEL:


Symmetric encryption, also referred to as conventional encryption or single-key encryption,
was the only type of encryption in use prior to the development of public key encryption in the
1970s.
Some basic terminologies used:
• ciphertext - the coded message
• cipher - algorithm for transforming plaintext to ciphertext
• key - info used in cipher known only to sender/receiver
• encipher (encrypt) - converting plaintext to ciphertext
• decipher (decrypt) - recovering ciphertext from plaintext
• cryptography - study of encryption principles/methods
• cryptanalysis (codebreaking) - the study of principles/ methods of deciphering
ciphertext without knowing key
• cryptology - the field of both cryptography and cryptanalysis

Fig.7 Simplified Model of Symmetric Encryption


A symmetric encryption scheme has five ingredients
A symmetric encryption scheme has five ingredients (Fig.7). Here the original message,
referred to as plaintext, is converted into apparently random nonsense, referred to as cipher
text. The encryption process consists of an algorithm and a key.
The key is a value independent of the plaintext. Changing the key changes, the output of the
algorithm. Once the cipher text is produced, it may be transmitted. Upon reception, the cipher
text can be transformed back to the original plaintext by using a decryption algorithm and the
same key that was used for encryption.
The security depends on several factors. First, the encryption algorithm must be powerful
enough that it is impractical to decrypt a message on the basis of cipher text alone. Beyond
that, the security depends on the secrecy of the key, not the secrecy of the algorithm.

Two requirements for secure use of symmetric encryption:


• A strong encryption algorithm
• A secret key known only to sender / receiver
• Y = EK(X)
• X = DK(Y)
assume encryption algorithm is known implies a secure channel to distribute key

Fig.8. conventional cryptosystem


A source produces a message in plaintext, X = [X1, X2, …, XM] where M are the
number of letters in the message. A key of the form K = [K1, K2, …, KJ] is generated. If the
key is generated at the source, then it must be provided to the destination by means of some
secure channel. With the message X and the encryption key K as input, the encryption
algorithm forms
the cipher text Y = [Y1, Y2, …, YN]. This can be expressed as Y = EK(X)
The intended receiver, in possession of the key, is able to invert the transformation: X = DK(Y)
An opponent, observing Y but not having access to K or X, may attempt to recover X or K or
both. It is assumed that the opponent knows the encryption and decryption algorithms. If the
opponent is interested in only this particular message, then the focus of effort is to recover X
by generating a plaintext estimate. Often if the opponent is interested in being able to read
future messages as well, in which case an attempt is made to recover K by generating an
estimate.
Substitution Encryption Techniques:
Substitution encryption technique is one type of classic encryption technique, A substitution
technique is one in which the letters of plaintext are replaced by other letters or by numbers or
symbols. If the plaintext is viewed as a sequence of bits, then substitution involves replacing
plaintext bit patterns with ciphertext bit patterns.
• (i)Caesar cipher (or) shift cipher
• The earliest known use of a substitution cipher and the simplest was by Julius Caesar.
• The Caesar Cipher is a type of shift cipher. Shift Ciphers work by using the modulo
operator to encrypt and decrypt messages. The Shift Cipher has a key K, which is
an integer from 0 to 25. We will only share this key with people that we want to see
our message
• The Caesar cipher involves replacing each letter of the alphabet with the letter standing
3 places further down the alphabet.
• e.g., Plain text: pay more mone Cipher text: SDB PRUH PRQHB
• Note that the alphabet is wrapped around, so that letter following „z‟ is „a‟.
• Note that the alphabet is wrapped around, so that the letter following Z is
A.
• We can define the transformation by listing all possibilities, as follows:
plain: a b c d e f g h i j k l m n o p q r s t u v w x y z
cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
• Let us assign a numerical equivalent to each letter:

For Encrypt each plaintext letter p, substitute the cipher text letter c such that
C = E(p) = (p+3) mod 26,
a shift may be any amount, so that general Caesar algorithm is
C = E (p) = (p+k) mod 26
where k takes on a value in the range 1 to 25.
The decryption algorithm is simply P = D(C) = (C-k) mod 26 (or) to Encrypt a message M.
Convert the letter into the number that matches its order in the alphabet starting from 0,
and call this number X, (A=0, B=1, C=2, ..., Y=24, Z=25).
Calcúlate: Y = (X + K) mod 26
Convert the number Y into a letter that matches its order in the alphabet starting from 0.
Example:
By using the Shift Cipher with key K=19 for our message.
We encrypt the message "KHAN", as follows

• So, after applying the Shift Cipher with key K=19 our message text "KHAN" gave
us cipher text "DATG".
• For every letter in the cipher text C, convert the letter into the number that matches its
order in the alphabet starting from 0, and call this number Y.
• If it is known that a given ciphertext is a Caesar cipher, then a brute-force
cryptanalysis is easily performed: Simply try all the 25 possible keys.
Monoalphabetic Ciphers:
With only 25 possible keys, the Caesar cipher is far from secure. A dramatic increase in the
key space can be achieved by allowing an arbitrary substitution. Before proceeding, the term
permutation can be defined.
A permutation of a finite set of elements S is an ordered sequence of all the elements of S,
with each element appearing exactly once.
For example, if S = {a, b, c}, there are six permutations of S:

abc, acb, bac, bca, cab, cba

In general, there are n! permutations of a set of n elements, because the first element can be
chosen in one of n ways, the second in n - 1 ways, the third in n – 2 ways, and so on.
plain: a b c d e f g h i j k l m n o p q r s t u v w x y z Caesar
cipher: d e f g h i j k l m n o p q r s T u v w x y z a b c

If, instead, the “cipher” line can be any permutation of the 26 alphabetic characters, then there
are 26! or greater than 4 * 1026 possible keys.
This is 10 orders of magnitude greater than the key space for DES and would
seem to eliminate brute-force techniques for cryptanalysis. Such an
approach is referred to as a mono alphabetic substitution cipher, because a
single cipher alphabet (mapping from plain alphabet to cipher alphabet) is
used per message.
Monoalphabetic ciphers are easy to break because they reflect the frequency data of the original
alphabet.
A countermeasure is to provide multiple substitutes known as homophones, for a single letter.
For example, the letter e could be assigned a number of different cipher symbols, such as 16,
74, 35, and 21, with each homophone assigned to a letter in rotation or randomly.
Playfair Cipher:

The best-known multiple-letter encryption cipher is the Playfair, which treats diagrams in the
plaintext as single units and translates these units into cipher text diagrams

he Playfair algorithm is based on the use of a 5 * 5 matrix of letters constructed using a


keyword. Here is an example, solved by Lord Peter Wimsey in Dorothy Sayers‟s Have His
Carcase
In this case, the keyword is monarchy. The matrix is constructed by filling in the letters of the
keyword (minus duplicates) from left to right and from top to bottom, and then filling in the
remainder of the matrix with the remaining letters in alphabetic order. The letters I and J
count as one letter.

Plaintext is encrypted two letters at a time, according to the following rules:

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

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.

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.

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

The Playfair cipher is a great advance over simple monoalphabetic ciphers. For one thing,
whereas there are only 26 letters, there are 26 * 26 = 676 digrams, so that identification of
individual digrams is more difficult. Furthermore, the relative frequencies of individual
letters exhibit a much greater range than that of digrams, making frequency analysis much
more difficult.
For these reasons, the Playfair cipher was for a long time considered unbreakable. It was used
as the standard field system by the British Army in World War I and still enjoyed
considerable use by the U.S. Army and other Allied forces during World War II.

Hill Cipher:

Another interesting multiletter cipher is the Hill cipher, developed by the mathematician
Lester Hill in 1929.

The Hill Algorithm

This encryption algorithm takes m successive plaintext letters and substitutes for them m
ciphertext letters. The substitution is determined by m linear equations in which each
character is assigned a numerical value (a = 0, b = 1,….., z = 25). For m = 3, the system can
be described as

c1 = (k11p1 + k21p2 + k31p3) mod 26 c2 = (k12p1 + k22p2 + k32p3) mod 26 c3 = (k13p1 + k23p2 +
k33p3) mod 26

This can be expressed in terms of row vectors and matrices:

݇11 ݇12 ݇13


ܿ1ܿ2ܿ3 = ‫݌‬1‫݌‬2‫݌‬3 ݇22 ݇23 ݉‫ ݀݋‬26
݇21
݇31 ݇32 ݇33

or

C = PK mod 26

Where C and P are row vectors of length 3 representing the plaintext and ciphertext, and K is
a 3 x 3 matrix representing the encryption key. Operations are performed mod 26.

Polyalphabetic ciphers
A polyalphabetic cipher is any cipher based on substitution, using multiple substitution
alphabets. The Vigenère cipher is probably the best-known example of a polyalphabetic
cipher.

Difference between monoalphabetic cipher and polyalphabetic cipher:


A monoalphabetic cipher is a substitution cipher in which the cipher alphabet is fixed
through the encryption process ..... A polyalphabetic cipher is a substitution cipher in which
the cipher alphabet changes during the encryption process.

Vigenere cipher:
� Vigenere Cipher is a method of encrypting alphabetic text. It uses a simple form
of polyalphabetic substitution. A polyalphabetic cipher is any cipher based on
substitution, using multiple substitution alphabets .The encryption of the original
text is done using the Vigenère square or Vigenère table.
• The table consists of the alphabets written out 26 times in different rows, each
alphabet shifted cyclically to the left compared to the previous alphabet,
corresponding to the 26 possible Caesar Ciphers.
• At different points in the encryption process, the cipher uses a different alphabet
from one of the rows.
• The alphabet used at each point depends on a repeating keyword

The Vigenère cipher can be expressed in the following manner. Assume a sequence of
plaintext letters P = p0, p1, p2, ...... ,p n-1 and a key consisting of the sequence of letters K = k0,
k1, k2, ...... , k m-1, where typically m <n. The sequence of ciphertext letters C = C0, C1, C2,
……, C n-1 is calculated as follows:

C = C0, C1, C2, …..,C n-1 = E(K, P) = E[(k0, k1, k2, ….., k m-1), (p0, p1, p2…., p n-1)]
= (p0 + k0) mod 26, (p1 + k1) mod 26, ……, (p m-1 + k m-1) mod 26, (pm+ k0) mod 26, (p m+1 +
k1) mod 26, ……. , (p 2m-1 + k

m-1) mod 26,…..

Thus, the first letter of the key is added to the first letter of the plaintext, mod 26, the second
letters are added, and so on through the first m letters of the plaintext. For the next m letters
of the plaintext, the key letters are repeated. This process continues until all of the plaintext
sequence is encrypted. A general equation of the encryption process is

Ci= (pi+ k i mod m) mod 26

A general equation for decryption is

pi= (Ci– k i mod m) mod 26

To encrypt a message, a key is needed that is as long as the message. Usually, the key is a
repeating keyword. For example, if the keyword is deceptive, the message “we are discovered
save yourself” is encrypted as

Key :deceptivedeceptivedeceptive plaintext : wearediscoveredsaveyourself

ciphertext : ZICVTWQNGRZGVTWAVZHCQYGLMGJ

The strength of this cipher is that there are multiple ciphertext letters for each plaintext letter,
one for each unique letter of the keyword. Thus, the letter frequency information is obscured.
However, not all knowledge of the plaintext structure is lost.

Vernam Cipher The ultimate defense against such a cryptanalysis is to choose a keyword that
is as long as the plaintext and has no statistical relationship to it. Such a system was
introduced by an AT&T engineer named Gilbert Vernam in 1918.

• The system can be expressed as:


where

pi= ith binary digit of plaintext

ki= ith binary digit of key

ci= ith binary digit of ciphertext

s= exclusive-or (XOR) operation


• Thus, the ciphertext is generated by performing the bitwise XOR of the plaintext and
the key. Because of the properties of the XOR, decryption simply involves the same
bitwise operation

One Time Pad Cipher


It is an unbreakable cryptosystem. It represents the message as a sequence of 0s and 1s. this
can be accomplished by writing all numbers in binary, for example, or by using ASCII. The
key is a random sequence of 0‟s
0 and 1‟s of same length ass the message. Once a key is used, it
is discarded and never used again. The system can be expressed as follows:
Ci = Pi Ki
Ci - ith binary digit of cipher text Pi - ith binary digit of plaintext
Ki - ith binary digit of key – exclusive OR opearaiton
Thus, the cipher text is generated by performing the bitwise XOR of the plaintext and the key.
Decryption uses the same key. Because of the properties of XOR, decryption simply involves
the same bitwise operation:
Pi = Ci Ki
e.g., plaintext = 0 0 1 0 1 0 0 1
Key = 1 0 1 0 1 1 0 0

ciphertext = 1 0 0 0 0 1 0 1
Advantage:
Encryption method is completely unbreakable for a ciphertext only attack.
Disadvantages
It requires a very long key which is expensive to produce and expensive to transmit.
Once a key is used, it is dangerous to reuse it for a second message; any knowledge on
the first message would give knowledge of the second.
STEGANOGRAPHY:
� Steganography is the technique of hiding secret data within an ordinary, non-secret,
non file
or message in order to avoid detection; the secret data is then extracted at its destination.
The use of steganography can be combined with encryption as an extra step for hiding
or protecting data.
� It stems from two Greek words, which are steganos, means covered
and graphia, means writing
� Examples,
1. Playing an audio track backwards to reveal a secret message
2. Playing a video at a faster frame rate (FPS) to reveal a hidden image
3. Embedding a message in the red, green, or blue channel of an RGB image
4. Hiding information within a file header or metadata
5. Embedding an image or message within a photo through the addition of digital noise

• As the image depicts, both cover file(X) and secret message(M) are fed into
steganographic encoder as input.
• Steganographic Encoder function, f(X,M,K) embeds the secret message into a cover
file.
• Resulting Stego Object looks very similar to your cover file, with no visible changes.
• This completes encoding. To retrieve the secret message, Stego Object is fed into
Steganographic Decoder.
� Steganography Techniques
� Depending on the nature of the cover object (actual object in which secret data is
embedded), steganography can be divided into five types:
1. Text Steganography
2. Image Steganography
3. Video Steganography
4. Audio Steganography
5. Network Steganography
� Text Steganography: Text Steganography is hiding information inside the text
files. Various techniques used to hide the data in the text are:
• Format Based Method
• Random and Statistical Generation
• Linguistic Method
� Image Steganography: Hiding the data by taking the cover object as the image is known
as image steganography. There are a lot of ways to hide information inside an image.
Common approaches include:
• Least Significant Bit Insertion
• Masking and Filtering
• Redundant Pattern Encoding
• Encrypt and Scatter
• Coding and Cosine Transformation
� Audio Steganography: In audio steganography, the secret message is embedded into an
audio signal which alters the binary sequence of the corresponding audio file. Different
methods of audio steganography include:
• Least Significant Bit Encoding
• Parity Encoding
• Phase Coding
• Spread Spectrum
� Video Steganography: In Video Steganography you can hide kind of data into digital
video format. Two main classes of Video Steganography include:
• embedding data in uncompressed raw video and compressing it later
• Embedding data directly into the compressed data stream
• Network Steganography (Protocol Steganography): It is the technique of embedding
information within network control protocols used in data transmission such TCP,
UDP, ICMP etc. For Example, you can hide information in the header of a
TCP/IP packet in some fields that are either optional.

Example:
(i) the sequence of first letters of each word of the overall message spells out the real (hidden)
message.
(ii) Subset of the words of the overall message is used to convey the hidden message.
Various other techniques have been used historically, some of them are:
Character marking – selected letters of printed or typewritten text are overwritten in pencil.
The marks are ordinarily not visible unless the paper is held to an angle to bright light.
Invisible ink – a number of substances can be used for writing but leave no visible trace until
heat or some chemical is applied to the paper.
Pin punctures – small pin punctures on selected letters are ordinarily not visible unless the
paper is held in front of the light.
Typewritten correction ribbon – used between the lines typed with a black ribbon, the
results of typing with the correction tape are visible only under a strong light.
Drawbacks of steganography
Requires a lot of overhead to hide a relatively few bits of information.
Once the system is discovered, it becomes virtually worthless.
TRANSPOSITION TECHNIQUES:
All the techniques examined so far involve the substitution of a cipher text symbol for a
plaintext symbol. A very different kind of mapping is achieved by performing some sort of
permutation on the plaintext letters. This technique is referred to as a transposition cipher.
Rail fence is simplest of such cipher, in which the plaintext is written down as a sequence of
diagonals and then read off as a sequence of rows.
Plaintext = meet at the school house
To encipher this message with a rail fence of depth 2, we write the message as
follows:
meatecolos
etthsHohue
The encrypted message is MEATECOLOSETTHSHOHUE
Row Transposition Ciphers--A more complex scheme is to write the message in a rectangle,
row by row, and read the message off, column by column, but permute the order of the columns.
The order of columns then becomes the key of the algorithm.
e.g., plaintext = meet at the school house
Key = 4 3 1 2 5 6 7
PT = m e e t a t t
heschoo
lhouse
CT = ESOTCUEEHMHLAHSTOETO
A pure transposition cipher is easily recognized because it has the same letter frequencies as
the original plaintext. The transposition cipher can be made significantly more secure by
performing more than one stage of transposition. The result is more complex permutation that
is not easily reconstructed.
FINITE FIELDS AND NUMBER THEORY:
� Finite fields have become increasingly important in cryptography.
� A number of cryptographic algorithms rely heavily on properties of finite fields, notably
the Advanced Encryption Standard (AES) and elliptic curve cryptography.
� Other examples include the message authentication code CMAC and the authenticated
encryption scheme GCM
� Groups, Rings, Fields, Modular arithmetic, Euclid’s algorithm
� Finite fields Euclid’s algorithm
� Polynomial Arithmetic
� Prime numbers-Fermat’s and Euler’s theorem
� Testing for primality
� The Chinese remainder theorem
� Discrete logarithms
� Widely used in cryptography to perform large calculations
� Some basic concepts are
� Prime Number: a number that is divisible only by itself and 1 (e.g. 2, 3, 5, 7, 11)
� Relative Prime Number: Two integers are relatively prime (or coprime) if there is no
integer greater than one that divides them both (that is, their greatest common divisor
is one). For example, 12 and 13, GCD (12,13) = 112 and 13 are relatively prime,
but 12 and 14 are not.,
� Modular
Congruent Modulo
� Modular : When we divide two integers we will have an equation that looks like the
following:
� A/B=Q remainder R
� A is the dividend
B is the divisor
Q is the quotient
R is the remainder
� Sometimes, we are only interested in what the remainder is when we divide A by B.
For these cases there is an operator called the modulo operator (abbreviated as mod).
� Using the same A, B, Q, and R as above, we would have: A mod B=R
� We would say this as A modulo B is equal to R. Where B is referred to as
the modulus.
Ex. 13/5= 2 remainder of 3 then, 13 mod 5 = 3
CONGRUENT MODULO:
� Consider two integers a and b
� a and b said to be congruent to n for
� a (mod n) = b (mod n) then
� a ≡ b (mod n) (OR) a (mod n) = b
� example:
� let a=73, b=4 and n=23
 find a mod n
� 73 mod 23 =4 (reminder of 73/23)
 find b mod n
� since 23 is larger than 4 then,
� 4 mod 23 = 4
 here 73 mod 23 = 4 and 4 mod 23=4, this can be written as
� 73 ≡ 4 (mod 23) ==> a ≡ b (mod n)
Properties of Congruences

Congruences have the following properties:

� Property 1: a ≡ b (mod n) if n is multiple of (a-b)


� Example: let a=30, b=10 and n=5
� a-b = 30-10 = 20
� Since 20 is multiple of 5 then 30 ≡ 10 (mod 5)
� Property 2: a (mod n) = b (mod n) ==> a ≡ b (mod n)
� Property 3: a mod n=b
� and b mod n=c,  b = c (mod n) sub it in a mod n
� then a mod n= c mod n and a ≡ c (mod n)
� Arithmetic Property: ((a mod n) + (b mod n))mod n= (a+b) mod n [same for -,*,/]
� Commutative Property: (a+b) mod n = (b+a) mod n [same for *]
� Associative Property: ((a + b)+c) mod n = (a+(b + c)) mod n
� Identity Property:
� (0+a) mod n = a mod n
� (1 * a) mod n = a mod n
Modular Arithmetic Operations

The (mod n)) operator maps all integers into the set of integers {0, 1, c, (n
( - 1)}. This
technique is known as modular arithmetic.

Modular arithmetic exhibits the following properties:

[(a mod n) + (b mod n)] mod n = (a + b) mod n

[(a mod n) - (b mod n)] mod n = (a - b) mod n

[(a mod n) (b mod n)]


)] mod n = (ab) mod n

First property:

Define (a mod n) = raand (b mod n) = rb. Then we can write a = ra+ jnfor some integer j and b
= rb+ knfor some integer k.

Then

(a + b) mod n = (ra+ jn+ rb+ kn)


kn mod n = (ra+ rb+ (k + j)n) mod n

= (ra+ rb) mod n

= [(a mod n) + (b mod n)]


)] mod n

Define (a mod n) = raand (b mod n) = rb. Then we can write a = ra+ jnfor some integer j and b
= rb+ knfor some integer k.

Then

(a + b) mod n = (ra+ jn+ rb+ kn)


kn mod n = (ra+ rb+ (k + j)n) mod n

= (ra+ rb) mod n

= [(a mod n) + (b mod n)]


)] mod n

Examples of the three properties:

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

Exponentiation is performed by repeated multiplication, as in ordinary arithmetic.

To find 117 mod 13,

112 = 121 = 4 ( mod 13)

114 =(112)2 = 42 = 3 ( mod 13)

117 = 11 × 4 × 3 = 132 = 2 (mod 13)

Thus, the rules for ordinary arithmetic involving addition, subtraction, and multiplication
carry over into modular arithmetic. The following table below provides an illustration of
modular addition and multiplication modulo 8

Both matrices are symmetric about the main diagonal in conformance to the commutative
property of addition and multiplication.
As in ordinary addition, there is an additive inverse, or negative, to each integer in modular
arithmetic.

In this case, the negative of an integer x is the integer y such that (x + y) mod 8 = 0.

To find the additive inverse of an integer in the left-hand


left hand column, scan across the
corresponding row of the matrix to find the value 0; the integer at the top of that column is
the additive inverse; thus, (2 + 6) mod 8 = 0. Similarly, the entries in the multiplication table
are straightforward.

In modular arithmetic mod 8, the multiplicative inverse of x is the integer y

such that (x y) mod 8 = 1 mod 8.

FERMAT’S AND EULER’S THEOREM


Two theorems that play important roles in public-key
public key cryptography are
Fermat‟s theorem and Euler‟s theorem.

Fermat’s Theorem
Fermat‟s theorem states the following:
fo If p is prime and a is a positive integer
ger
not divisible by p, then

Proof: Consider the set of positive integers less than p: {1, 2, c, p - 1} and
multiply each element by a, modulo p, to get the set X = {a mod p, 2a a mod
p, c, (p - 1)amod p}.
}. None of the elements of X is equal to zero because p
does not divide a. Furthermore, no two of the integers in X are equal.

• To see this, assume that ja ka(mod p), where 1 j < k p -


1. Because a is relatively prime top,
to Eliminate a from both
sides of the equation resulting in j k (mod p).
• This last equality is impossible, because j and k are both
positive integers less than p. Therefore, (p - 1) elements of
X are all positive integers with no two elements equal.
• We can conclude the X consists of the set of integers {1, 2,
…..,p - 1} in some order. Multiplying the numbers in both
sets (p and X) and taking the result mod p yields

• We can cancel the (p - 1)! term because it is


relatively prime to p. This yields Equation, which
completes the proof.

• An alternative form of Fermat‟s


Fermat theorem is also useful: If p is prime and
a is a positive integer, then

Euler’s Theorem
Euler‟s theorem states that for every a and n that are relatively prime:

Proof: The above equation is true if n is prime, because in that case,

(n) = (n- 1) and Fermat‟s theorem holds. However, it also holds for any integer n. (n) is
the number of positive integers less than n that are relatively primeto n.

Consider the set of such integers, labeled as

R = {x1, x2,……,Φ(݊)}

That is, each element xiof R is a unique positive integer less than n with gcd(x
gcd( i, n) = 1.

Now multiply each element by a, modulo n:

S = {(ax1 mod n), (ax2 mod n),…


),… , (ܽ‫)݊(߶ݔ‬mod n)}
The set S is a permutation of R, by the following line of reasoning:

Because a is relatively prime to n and xiis relatively prime to n, aximust also be relatively
prime to n. Thus, all the members of S are integers that are less than n and that are relatively
primeto n.

If aximod n = axjmod n, then xi = xj.

Therefore,
ϕn ϕn

(axi mod n) = xi
i=1 i=1

ϕn ϕn

৕ xi = ∑(axi mod n)
i=1 i=1

ϕn
(݊) × [∏ xi (݉‫݀݋‬
i=1 ݊)]
(݊) ≡ 1 ݉‫݊ ݀݋‬
which completes the proof. This is the same line of reasoning applied to the proof of
Fermat‟s theorem.

ϕ(n) 4
a=3; n=10; ϕ(10)= 4a = 3 = 81 = 1(mod 10) = 1(mod n) a=2; n=11;
ϕ(n) 10
ϕ(11)= 10a = 2 = 1024 = 1(mod 11) = 1(mod n)

As is the case for Fermat‟s theorem, an alternative form of the theorem is also useful:
ܽ߶ ݊ +1 ≡ ܽ ݉‫݊ ݀݋‬

CHINESE REMINDER THEOREM:

One of the most useful results of number theory is the Chinese remainder theorem (CRT).
In essence, the CRT says it is possible to reconstruct integers in a certain range from their
residues modulo a set of pairwise relatively prime moduli.

The CRT can be stated in several ways. Let

where A ZM,ai Zmi, and ai= A mod mi for 1 i k.


The CRT makes two assertions. The mapping of the above equation is a one-to-one
one
correspondence (called a bijection)
bijection between ZM and the Cartesian product
Zm1˟ Zm2 ˟….˟Zmk. That is, for every integer A such that 0≤A ≤M,, there is a unique k-tuple
(a1, a2,…., ak) with 0≤ ai < mi that represents it, and for every such k-tuple
tuple (a1,
( a2,….. ak),
there is a unique integer A in ZM.
Z
Operations performed on the elements of ZM
Z can be equivalently performed on the
corresponding k-tuples
tuples by performing the operation independently in each coordinate position
in the appropriate system.

FINITE FIELDS
Groups, Rings and Field:
Group:: A set of elements that is closed with respect to some operation.
Closed-> The result of the operation is also in the set
The operation obeys:
Obeys associative law: (a.b).c = a.(b.c)
Has identity e: e.a = a.e = a
Has inverses a-1: a.a-1 = e
Abelian Group: The operation is commutative
a.b = b.a
Example: Z8, + modular addition, identity =0
Cyclic Group
Exponentiation: Repeated application of operator
example: a3 = a.a.a
Cyclic Group: Every element is a power of some fixed element, i.e., b = ak
for some a and every b in group a is said to be a generator of the group
Example: {1, 2, 4, 8} with mod 12 multiplication, the generator is 2.
20=1, 21=2, 22=4, 23=8, 24=4, 25=8
Ring:
A group with two operations: addition and multiplication
The group is abelian with respect to addition: a+b=b+a
Multiplication and additions are both associative:
a+(b+c)=(a+b)+c
a.(b.c)=(a.b).c
Multiplication distributes over addition, a.(b+c)=a.b+a.c
Commutative Ring: Multiplication is commutative, i.e., a.b = b.a
Integral Domain: Multiplication operation has an identity and no zero divisors
Field:
An integral domain in which each element has a multiplicative inverse.

Polynomial Arithmetic
f(x) = anxn + an-1xn-1 + …+ a1x + a0 = Σ aixi
1. Ordinary polynomial arithmetic:
• Add, subtract, multiply, divide polynomials,
• Find remainders, quotient.
• Some polynomials have no factors and are prime.
2. Polynomial arithmetic with mod p coefficients
3. Polynomial arithmetic with mod p coefficients and mod m(x) operations
Polynomial Arithmetic with Mod 2 Coefficients
• All coefficients are 0 or 1, e.g.,
let f(x) = x3 + x2 and g(x)
g = x2 + x + 1
f(x) + g(x) = x3 + x + 1
f(x) x g(x) = x5 + x2
• Polynomial Division: f(x)
f = q(x) g(x) + r(x)
• can interpret r(x) as being a remainder
• r(x) = f(x) mod g(x)
• if no remainder, say g(x) divides f(x)
• if g(x) has no divisors other than itself & 1 say it is irreducible (or prime) polynomial
• Arithmetic modulo an irreducible polynomial form a finite field
• Can use Euclid‟s algorithm to find gcd and inverses.
Discrete Logarithm:
The inverse problem to exponential is to find the discreate logarithm of a number modulo P,
that is to find ݅
ܾ = ܽ݅ (݉‫)݌ ݀݋‬
Written as
݅ = ݈݀‫)݌ ݀݋݉( ܾܽ݃݋‬
If a is a primitive root then it always exists, otherwise it may not.
Eg. ‫݃݋݈ = ݔ‬3 4 ݉‫ ݀݋‬13 has no answer
‫݃݋݈ = ݔ‬2 3 ݉‫ ݀݋‬13 =4 by typing successive power

References

1. William Stallings, Cryptography and Network Security, 6th Edition, Pearson


Education, March 2013.
2. Behrouz A. Ferouzan, “Cryptography & Network Security”, Tata McGraw Hill, 2007.
3. Man Young Rhee, “Internet Security: Cryptographic Principles”, “Algorithms and
Protocols”, Wiley Publications, 2003.
4. Charles Pfleeger, “Security in Computing”, 4th Edition, Prentice Hall of India, 2006.

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