Coding & Decoding — Lecture 8
Introduction
Cryptography is the technique of coding and decoding messages. We can do it by many ways. Here
we will discuss this topic by using a standard substitution scheme and a square matrix A.
Standard Substitution Scheme
We will use the following standard substitution scheme for Coding and Decoding:
A→1 B→2 C→3 D→4 E→5 F→6 G→7
H→8 I→9 J→10 K→11 L→12 M→13 N→14
O→15 P→16 Q→17 R→18 S→19 T→20 U→21
V→22 W→23 X→24 Y→25 Z→26
2×2 Matrix Examples
Q#1 — Coding (2×2 Matrix)
Using the Standard Sub. Scheme and the matrix:
A = [ 5 3 ]
[ 2 1 ]
Code the message: WORK HARD
Solution:
Using the Sub. Scheme, the message WORK HARD converts to:
W→23 O→15 R→18 K→11 H→8 A→1 R→18 D→4
First of all, break it into column matrices:
[ 23 ] [ 18 ] [ 8 ] [ 18 ]
[ 15 ] [ 11 ] [ 1 ] [ 4 ]
Now we will multiply every column matrix with given A:
Multiplication 1:
, A [ 23 ] = [ 5 3 ] [ 23 ]
[ 15 ] [ 2 1 ] [ 15 ]
= [ (5×23)+(3×15) ] = [ 115+45 ] = [ 160 ]
[ (2×23)+(1×15) ] [ 46+15 ] [ 61 ]
Multiplication 2:
A [ 18 ] = [ 5 3 ] [ 18 ]
[ 11 ] [ 2 1 ] [ 11 ]
= [ (5×18)+(3×11) ] = [ 90+33 ] = [ 123 ]
[ (2×18)+(1×11) ] [ 36+11 ] [ 47 ]
Multiplication 3:
A [ 8 ] = [ 5 3 ] [ 8 ]
[ 1 ] [ 2 1 ] [ 1 ]
= [ (5×8)+(3×1) ] = [ 40+3 ] = [ 43 ]
[ (2×8)+(1×1) ] [ 16+1 ] [ 17 ]
Multiplication 4:
A [ 18 ] = [ 5 3 ] [ 18 ]
[ 4 ] [ 2 1 ] [ 4 ]
= [ (5×18)+(3×4) ] = [ 90+12 ] = [ 102 ]
[ (2×18)+(1×4) ] [ 36+4 ] [ 40 ]
∴ Transmitted message is: 160 61 123 47 43 17 102 40
Q#2 — Decoding (2×2 Matrix)
Decode the message 160 61 123 47 43 17 102 40 by using the Standard Sub. scheme and Inverse
of A.
Step 1: Find A⁻¹
A = [ 5 3 ]
[ 2 1 ]
|A| = (5×1) − (2×3) = 5 − 6 = −1
adj(A) = [ 1 −3 ]
[ −2 5 ]
A⁻¹ = (1/|A|) · adj(A) = (1/−1) [ 1 −3 ] = [ −1 3 ]