Contents
11.1 Cryptography.......................................................................................................................1
11.2 Graph Theory.......................................................................................................................6
______________________________________________________________________________
11.1 Cryptography
Cryptography is a study of encoding and decoding secret messages.
Definition
Ciphers: codes
Plaintext: uncoded messages
Cipher text: coded
 Substitution
ciphersmessages
replacing each letter of the alphabet by a different letter.
Enciphering:
Process
of converting from plaintext to cipher text
Hill Ciphers
Deciphering: Reverse process from cipher text to plaintext
 Sets of n plaintext letters are replaced by sets of n ciphers letters. Each letter is assigned a
numerical value as in Table 1.
A B C D E F G H I J
1 2 3 4 5 6 7 8 9 1
0
11
1
2
1
3
1
4
1
5
1
6
1
7
1
8
1
9
2
0
2
1
2
2
2
3
2
4
2
5
Table 1
In the simplest Hill ciphers, successive pairs of plaintext are transformed into ciphertext by the
following procedure:
Step 1: Choose a 2x2 matrix A to perform the encoding.
Step 2: Group successive plaintext letters into pairs and replace each plaintext letter by its
numerical value.
Step 3: Successively convert each plaintext letter pair into a column vector P and form the
product AP.
Step 4: Convert each ciphertext vector C = AP into its alphabetic equivalent using a modular
arithmetic.
Example 1
4 3
Obtain the Hill cipher of the message DARK NIGHT using the enciphering matrix 1 2 .
Solution
4 3
Let a matrix A is 1 2
DA RK NI GH TT
Thus,
4
1
4
1
3
2
3
2
corresponds to
4 19
1
6
18 105
11
40
4 3 14
1 2 9
4 3 7
1 2 8
4 3 20
1 2 20
83
32
4
1
18
11
14
9
7
8
20
20
1
or
14
5
or
6
52 0
23 or 23
140
60
10
or
8
2
Modular Arithmetic
Modular arithmetic is a technique of working with remainders.
Eg: mod (26): integers greater than 25 will be replaced by their remainders after division by 26.
Definition:
If m (modulus) is a positive integer and a and b are any integers, then a is equivalent to b
modulo m, written
a = b (mod m)
Finding
and Bases
for Eigenspaces
if a  b Eigenvectors
is an integer multiple
of m.
Remark
For any modulus 26, every integer a is equivalent to exactly one of the integers
zm {0,1, 2,..., 25} . This is called the set of residues modulo 26.
Theorem 11.16.1
For any integer a and modulus m, let
a
R = remainder of m . Then the residue r of a modulo m is given by
if a 0
r m R if a p 0 and R 0
0
if a p 0 and R 0
Definition:
If m (modulus) is a positive integer and a and b are any integers, then a is equivalent to b
modulo m, written
3
a = b (mod m)
if a  b is an integer multiple of m.
Example 2
Find the residue modulo 26 of
(a) 87
(b) 38
(c) 26
Solution
(a) Dividing 87 = 87 by 26 yields R=9, so r = 9.
Thus, 87 = 9 (mod 26)
(b) Dividing 38 = 38 by 26 yields R=12, so r = 26 12 = 14.
Thus, 38 = 14 (mod 26)
(c)
Definition:
If a is a number in Zm, then a number a1 in Zm is called a reciprocal or multiplicative
inverse of a modulo m if
aa 1 a 1a 1(mod m)
Example 3
15(7) = 105 = 1 (mod 26)
Table 2 lists the reciprocals modulo 26 for the reference.
a
a1
1
1
3
9
5
21
7
15
9
3
11
15
19
7
Table 2
17
23
19
11
21
5
23
17
25
25
Deciphering

Decipherment uses the inverse (mod 26) of the enciphering matrix in a Hill cipher.
If m is a positive integer, then a square matrix A with entries in Zm is said to be invertible
Let
a11
a21
p1
p
2
If p =
p = A1c.
a12
a22
Theorem 11.16.2
A square Matrix A with entries in Zm is invertible modulo m iff the residue of det(A)
modulo m has a reciprocal modulo m.
Corollary 11.16.3
A square matrix A with entries in Zm is invertible modulo m iff m and the residue of det(A)
modulo m have no common prime factors.
Corollary 11.6.4
A square matrix A with entries in Z26 is invertible modulo 26 iff the residue of det(A)
modulo 26 is not divisible by 2 or 13.
Remark:
If
a b
Decipher the following Hill 2cipher, which was enciphered by the matrix 3 5
KRWMBKYL
Solution
1 2
Let A
Deciphering K R W M B K Y L:
21 2
3 25
21 2
3 25
11
18
23
13
267
483
509
394
15
15
G
O
O
D
21 2
3 25
21 2
3 25
2
11
25
12
64
281
549
375
12
21
3
11
L
U
C
K
3. Pi Pj Pi is connected to Pj
Directed graphs can be presented as a line connecting Pi to Pj.

Pi Pj is denoted if Pi Pj and Pj Pi
Directed graphs may have separate component of vertices that are connected only among
themselves or maybe not connected to any other vertex.
Directed graph having n vertices can be represented by n x n matrix called vertex matrix
denoted by M=[mij] is defined for i, j = 1,2,,n as
1 if Pi Pj
0 otherwise
mij
Example 6
P2
[ ]
0 1 0
0 0 1
0 1 0
(1)
P1
P3
(2)
[ ]
0 1 0
0 0 1 1 1
0 0 0
1
0 0
0
1 0
(3)
P2
P3
(1)
0
1
0
0
1
0
1
0
0
1
1
1
0
(2)
0
1
1
0
1
0
0
1
0
0
0
0
0
1
1
1
0
0
1
0
0
1
1
0
Theorem 11.7.1:
Let M be the vertex of a directed graph and let m ij(r) be the (i,j)th element of Mr . Then
mij(r) is equal to the number of rstep connections from Pi to Pj.
The number of 1step connections is mij (either 0 or 1). The number of 2step
connections is calculated from the square of the vertex matrix M2.
M2 =
2
1 0
0 0 0
3
0 0
0
1 0
Example 8
[ ]
0
1
1
0
Consider M =
1
0
0
1
1
1
0
1
0
0
1
0
connections from P4 to P2 .
Solution
M2 =
M3 =
[ ][ ] [ ]
[ ][ ] [ ]
0
1
1
0
1
0
0
1
1
1
0
1
0
0
1
0
2
1
0
2
0
1
2
0
1
1
2
1
1
1
0
1
M 32 2 2,
0
1
1
0
0
1
1
0
1
0
0
1
1
0
0
1
1
1
0
1
1
1
0
1
0
0
1
0
0
0
1
0
1
2
4
1
2
1
0
2
0
1
2
0
1
1
2
1
3
2
0
3
3
3
2
3
1
1
2
1
1
1
0
1
M 42 3 3
CLIQUES
Definition
A subset S of a directed graph is called a clique if it satisfies the following three
conditions:
The subset S contains at least three vertices
For each pair of vertices Pi and Pj in S, both Pi Pj and Pj Pi
are true (Pi Pj )
There is no larger subset of the vertices that satisfies condition (ii) and contains S.
(The subset is a maximal set satisfying condition (ii))
Example 9
Cliques
{P1 , P3 , P4 }
P2
P3
Definition
A dominancedirected graph is a directed graph such that for any distinct pair of
vertices Pi and Pj , either Pi Pj or Pj Pi but not both. (One way directed)
Theorem
In any dominancedirected graph, there is at least one vertex from which there is a 1step
Definition
or 2step connection to any other vertex.
The power of a vertex Pi is the sum of the entries of the ith row of the matrix A = M + M2,
where M is the vertex matrix of the dominance directed graph.
10
Example 10
[ ]
0 0 1 1 0
1 0 1 0 1
Consider M =
0 0 0 1 0
0 1 0 0 0
1 0 1 1 0
Solution
0
1
M 2= 1
0 1 0
1 0 2
0 1 0
1 0 1
0 1 1
0 1 1 0
0 1 0 1
0 0 1 0
1 0 0 0
0 1 1 0
1
3
0
0
2
[ ]
0 0 1 1 0
1 0 1 0 1
0 0 0 1 0
0 1 0 0 0
1 0 1 1 0
0
1
0
1
0 1 1 0
0 1 0 1
0 0 1 0
1 0 0 0
0 1 1 0
[ ]
0 0 1 1 0
1 0 1 0 1
0 0 0 1 0
0 1 0 0 0
1 0 1 1 0
0
0
0
1
0
11
[ ]
0 0
1 0
0 0
A=M+M
0
1
1 1 0
0
1 0 1
0
0 1 0 +
1
0 0 0
1 1 0
0 1
1 0
0
0
0
1
0
0
1
0
0
0 +
0
1
1
0
1
1
0
0
1
1
0
1
0
1
1
0
1
0
1
0
2
0
1
1
2
3
1
0
3
0
1
0
1
0 0+1+0+1+0 = 2
1
3
0
0
2
0
0
0
1
0
0 0
0
0
0
0 0
0 0
0
0
0
2
1
1
1
0
1
1
1
1
3
0
1
2
0 0
Power of P1 is 4
Power of P2 is 9
Power of P3 is 2
Exercise:
1.
Power of P4 is 4
Power of P5 is 7
Let
0 1 1 1
1 0 0 0
M
0 1 0 1
0 1 1 0
12
(i)
(sem2, 06/07)
Construct a vertexmatrix of the dominancedirected graph shown and find the power of the
vertex P1 and P5.
(sem1, 04/05)
3.
(i)
(ii)
(iii)
Let M =
0
1
1
1
0
1
0
1
1
1
0
0
0
0
0
1
1
0
0
1
0
0
0
0
0
(sem1,04/05)
13