SlideShare a Scribd company logo
1 of 8
Download to read offline
Two More Examples of a Known Plaintext Attack
Here are two examples of cryptanalyzing a Hill cipher with a known plaintext
attack. Each example is done by hand – without using Mathematica. In example
one, there is no need to reduce the modulus; in example two the modulus must be
reduced.
Example one:
Ciphertext: FAGQQ ILABQ VLJCY QULAU STYTO JSDJJ PODFS
ZNLUH KMOW
We are assuming that this message was encrypted using a 2 2× Hill cipher and that
we have a crib. We believe that the message begins “a crib.”
ac ri
[1, 3] [18, 9]
[6, 1] [7, 17]
FA GQ
We could either solve for the key or the key inverse. To solve for the key, we
would solve
1 6
3 1
a b
c d
     
=     
     
and
18 7
9 17
a b
c d
     
=     
     
To solve for the key inverse, we would solve
6 1
1 3
e f
g h
     
=     
     
and
7 18
17 9
e f
g h
     
=     
     
We will solve for the key.
1 6
3 1
a b
c d
     
=     
     
represents two linear equations:
3 6
3 1
a b
c d
+ =
+ =
and
18 7
9 17
a b
c d
     
=     
     
represents
18 9 7
18 9 17
a b
c d
+ =
+ =
Now we solve the following linear congruences mod 26.
3 6
18 9 7
a b
a b
+ =

+ =
and
3 1
18 9 17
c d
c d
+ =

+ =
We will solve the pair of congruences
3 6
18 9 7
a b
a b
+ =

+ =
first.
To eliminate an unknown, multiply congruence 1 by 3
3 9 18
18 9 7
a b
a b
+ =

+ =
and subtract congruence 2 from congruence 1.
15 11a− =
Modulo 26, -15 is 11.
11 11a =
Divide by 11 to obtain a.
1a =
Now substitute this in congruence 1.
1 3 6b+ =
3 5b =
The multiplicative inverse of 3 is 9 modulo 26.
9 3 9 5 45 19mod 26b b= × = × = =
So, the key looks like
1 19
c d
 
 
 
Now solve the system
3 1
18 9 17
c d
c d
+ =

+ =
3 9 3
18 9 17
c d
c d
+ =

+ =
15 14c =
7 15 7 14 98 20mod 26c c= × = × = =
20 3 1d+ =
3 19 7mod 26d =− =
9 3 9 7 63 11mod 26d d= × = × = =
The key is
1 19
20 11
 
 
 
.
Example two:
We are assuming that we have a ciphertext message was that encrypted using a
2 2× Hill cipher and that we have a crib. We believe that ciphertext UKJN
corresponds to plaintext word.
wo rd
[23, 15] [18, 4]
[21, 11] [10, 14]
UK JN
The two systems of congruences are:
23 15 21
18 4 10
a b
a b
+ =

+ =
and
23 15 11
18 4 14
c d
c d
+ =

+ =
We will solve the system on the left.
To eliminate an unknown, multiply congruence number 1 by 4 and congruence
number 2 by 15 both modulo 26.
14 8 6
10 8 20
a b
a b
+ =

+ =
Subtract the second congruence from the first.
4 14 12mod 26a =− =
This congruence corresponds to the equation 4 12 26a k= + , 4a is 12 plus a multiple
of 26. Notice that 2 divides the coefficient of a, the constant 12, and the modulus
26. We reduce the modulus by dividing by 2.
2 6 13a k= +
and we have a congruence modulo 13.
2 6mod13a =
This congruence does not have a common factor among the coefficient, the
constant, and the modulus.
Here are the multiplicative inverses of the integers modulo 13:
Number 1 2 3 4 5 6 7 8 9 10 11 12
Multiplicative inverse 1 7 9 10 8 11 2 5 3 4 6 12
To find a, multiply 2 6mod13a = by the multiplicative inverse of 2, which is 7.
7 2 7 6 42 3mod13a a= × = × = =
So, a is 3 modulo 13. But, there are two integers mod 26 that are 3 mod 13,
namely, 3 and 3 + 13 = 16. So, there are two possible values for a.
If a = 3,
18 3 4 10b× = =
54 4 10b+ =
2 4 10b+ =
4 8mod 26b =
2 4mod13b =
7 2 7 4 26 2mod13b b= × = × = =
So, b=2 or b = 2+13 = 15 modulo 16.
If a = 16,
18 16 4 10b× + =
288 4 10b+ =
2 4 10b+ =
which yields the same solutions for b.
Here are the 4 possible solutions for a and b.
3 2
3 15
16 2
16 15
a b
a b
a b
a b
= =
= =
= =
= =
Now solve
23 15 11
18 4 14
c d
c d
+ =

+ =
.
14 8 18
10 8 2
a b
a b
+ =

+ =
4 16mod 26c =
2 8mod13c =
7 2 14 7 8 56 4mod13c c c= × = = × = =
So, c = 4 or c = 4 + 13 = 17 modulo 26.
If c = 4,
18 4 4 14d× + =
20 4 14d+ =
4 6 20mod 26d =− =
2 10mod13d =
7 2 7 10 5mod13d d= × = × =
So, d = 5 or d = 5 + 13 = 18 modulo 26.
If c = 17,
18 17 4 14d× + =
20 4 14d+ =
and we are led to the same solutions for d.
4 5
4 18
17 5
17 18
c d
c d
c d
c d
= =
= =
= =
= =
There are 16 possible 2 2× matrices that could be the key.
3 2 3 2 3 2 3 2
4 5 4 18 17 5 17 18
3 15 3 15 3 15 3 15
4 5 4 18 17 5 17 18
16 2 16 2 16 2 16 2
4 5 4 18 17 5 17 18
16 15 16 15 16 15 16 15
4 5 4 18 17 5 17 18
       
       
       
       
       
       
       
       
       
       
       
       
First, calculate the determinant of each. Any matrix that does not have an
invertible determinant modulo 26 (i.e., the determinant is not one of 1, 3, 5, 7, 9,
11, 15, 17, 19, 21, 23, 25 modulo 26) can be eliminated. Then try to decipher the
messages with each of the remaining messages. The matrix that yields plaintext is
the key.

More Related Content

What's hot

Applications of Matrices
Applications of MatricesApplications of Matrices
Applications of Matricessanthosh kumar
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsMohamed Loey
 
Introduction to NP Completeness
Introduction to NP CompletenessIntroduction to NP Completeness
Introduction to NP CompletenessGene Moo Lee
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
 
Matrix multiplication
Matrix multiplicationMatrix multiplication
Matrix multiplicationBobby Bloch
 
finding Min and max element from given array using divide & conquer
finding Min and max element from given array using  divide & conquer finding Min and max element from given array using  divide & conquer
finding Min and max element from given array using divide & conquer Swati Kulkarni Jaipurkar
 
Tips & Tricks in mathematics
Tips & Tricks in mathematicsTips & Tricks in mathematics
Tips & Tricks in mathematicsrithikkapoor7
 
Backtracking Algorithm.ppt
Backtracking Algorithm.pptBacktracking Algorithm.ppt
Backtracking Algorithm.pptSalmIbrahimIlyas
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Deepak John
 
August 18, 2016
August 18, 2016August 18, 2016
August 18, 2016khyps13
 
Eucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomialsEucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomialsSWAMY J S
 
Lecture01a correctness
Lecture01a correctnessLecture01a correctness
Lecture01a correctnessSonia Djebali
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematicsasad faraz
 
Calendars- Aptitude
Calendars- Aptitude Calendars- Aptitude
Calendars- Aptitude Pawan Mishra
 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy methodTech_MX
 

What's hot (20)

Applications of Matrices
Applications of MatricesApplications of Matrices
Applications of Matrices
 
Problem solving and design
Problem solving and designProblem solving and design
Problem solving and design
 
ELEMENTARY NUMBER THEORY.pptx
ELEMENTARY NUMBER THEORY.pptxELEMENTARY NUMBER THEORY.pptx
ELEMENTARY NUMBER THEORY.pptx
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
 
Introduction to NP Completeness
Introduction to NP CompletenessIntroduction to NP Completeness
Introduction to NP Completeness
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Matrix multiplication
Matrix multiplicationMatrix multiplication
Matrix multiplication
 
finding Min and max element from given array using divide & conquer
finding Min and max element from given array using  divide & conquer finding Min and max element from given array using  divide & conquer
finding Min and max element from given array using divide & conquer
 
Tips & Tricks in mathematics
Tips & Tricks in mathematicsTips & Tricks in mathematics
Tips & Tricks in mathematics
 
Multiplying Fractions
Multiplying FractionsMultiplying Fractions
Multiplying Fractions
 
Backtracking Algorithm.ppt
Backtracking Algorithm.pptBacktracking Algorithm.ppt
Backtracking Algorithm.ppt
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4
 
August 18, 2016
August 18, 2016August 18, 2016
August 18, 2016
 
Eucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomialsEucledian algorithm for gcd of integers and polynomials
Eucledian algorithm for gcd of integers and polynomials
 
Apt maths shortcuts
Apt maths shortcutsApt maths shortcuts
Apt maths shortcuts
 
Lecture01a correctness
Lecture01a correctnessLecture01a correctness
Lecture01a correctness
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematics
 
Calendars- Aptitude
Calendars- Aptitude Calendars- Aptitude
Calendars- Aptitude
 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy method
 
Strassen.ppt
Strassen.pptStrassen.ppt
Strassen.ppt
 

Similar to Known plaintext attack of hill cipher

X ch 1 real numbers
X  ch 1  real numbersX  ch 1  real numbers
X ch 1 real numbersAmruthaKB2
 
Lesson 8: Rational Functions
Lesson 8: Rational FunctionsLesson 8: Rational Functions
Lesson 8: Rational FunctionsKevin Johnson
 
Chapter3.4
Chapter3.4Chapter3.4
Chapter3.4nglaze10
 
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docxSection 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docxbagotjesusa
 
Produccion escrita unidad_i_matematica_
Produccion escrita unidad_i_matematica_Produccion escrita unidad_i_matematica_
Produccion escrita unidad_i_matematica_GustavoSarmiento18
 
123a ppt-all-2
123a ppt-all-2123a ppt-all-2
123a ppt-all-2math123a
 
WCS Specialist Maths An Introduction to Matrices PowerPoint
WCS Specialist Maths An Introduction to Matrices PowerPointWCS Specialist Maths An Introduction to Matrices PowerPoint
WCS Specialist Maths An Introduction to Matrices PowerPointKingp18
 
1.basic of fractions
1.basic of fractions1.basic of fractions
1.basic of fractionsDreams4school
 
Linear Equations and Inequalities in One Variable
Linear Equations and Inequalities in One VariableLinear Equations and Inequalities in One Variable
Linear Equations and Inequalities in One Variablemisey_margarette
 
Matrices Questions & Answers
Matrices Questions & AnswersMatrices Questions & Answers
Matrices Questions & AnswersSantoshTamadaddi
 
Least Common Multiple
Least Common MultipleLeast Common Multiple
Least Common MultipleKathy Favazza
 
Quadratic trig equations
Quadratic trig equationsQuadratic trig equations
Quadratic trig equationsJJkedst
 
Business Math Chapter 3
Business Math Chapter 3Business Math Chapter 3
Business Math Chapter 3Nazrin Nazdri
 
Solving equations one & two step
Solving equations   one & two stepSolving equations   one & two step
Solving equations one & two stepchrystal_brinson
 
Quadratic equations
Quadratic equationsQuadratic equations
Quadratic equationsdebmegh
 

Similar to Known plaintext attack of hill cipher (20)

Matrix.pptx
Matrix.pptxMatrix.pptx
Matrix.pptx
 
X ch 1 real numbers
X  ch 1  real numbersX  ch 1  real numbers
X ch 1 real numbers
 
Lesson 8: Rational Functions
Lesson 8: Rational FunctionsLesson 8: Rational Functions
Lesson 8: Rational Functions
 
Chapter3.4
Chapter3.4Chapter3.4
Chapter3.4
 
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docxSection 0.7 Quadratic Equations from Precalculus Prerequisite.docx
Section 0.7 Quadratic Equations from Precalculus Prerequisite.docx
 
Produccion escrita unidad_i_matematica_
Produccion escrita unidad_i_matematica_Produccion escrita unidad_i_matematica_
Produccion escrita unidad_i_matematica_
 
123a ppt-all-2
123a ppt-all-2123a ppt-all-2
123a ppt-all-2
 
WCS Specialist Maths An Introduction to Matrices PowerPoint
WCS Specialist Maths An Introduction to Matrices PowerPointWCS Specialist Maths An Introduction to Matrices PowerPoint
WCS Specialist Maths An Introduction to Matrices PowerPoint
 
1.basic of fractions
1.basic of fractions1.basic of fractions
1.basic of fractions
 
P1-Chp2-Quadratics.pptx
P1-Chp2-Quadratics.pptxP1-Chp2-Quadratics.pptx
P1-Chp2-Quadratics.pptx
 
Linear Equations and Inequalities in One Variable
Linear Equations and Inequalities in One VariableLinear Equations and Inequalities in One Variable
Linear Equations and Inequalities in One Variable
 
Lesson 1 matrix
Lesson 1 matrixLesson 1 matrix
Lesson 1 matrix
 
Matrices Questions & Answers
Matrices Questions & AnswersMatrices Questions & Answers
Matrices Questions & Answers
 
Least Common Multiple
Least Common MultipleLeast Common Multiple
Least Common Multiple
 
Quadratic trig equations
Quadratic trig equationsQuadratic trig equations
Quadratic trig equations
 
Vivek
VivekVivek
Vivek
 
Business Math Chapter 3
Business Math Chapter 3Business Math Chapter 3
Business Math Chapter 3
 
Solving equations one & two step
Solving equations   one & two stepSolving equations   one & two step
Solving equations one & two step
 
Quadratic equations
Quadratic equationsQuadratic equations
Quadratic equations
 
Jeancarlos freitez
Jeancarlos freitezJeancarlos freitez
Jeancarlos freitez
 

Recently uploaded

Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxpriyankatabhane
 
TOTAL CHOLESTEROL (lipid profile test).pptx
TOTAL CHOLESTEROL (lipid profile test).pptxTOTAL CHOLESTEROL (lipid profile test).pptx
TOTAL CHOLESTEROL (lipid profile test).pptxdharshini369nike
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsssuserddc89b
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaPraksha3
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzohaibmir069
 
Temporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of MasticationTemporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of Masticationvidulajaib
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555kikilily0909
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxEran Akiva Sinbar
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRlizamodels9
 
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |aasikanpl
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
Cytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptxCytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptxVarshiniMK
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett SquareIsiahStephanRadaza
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxNandakishor Bhaurao Deshmukh
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trssuser06f238
 

Recently uploaded (20)

Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
 
TOTAL CHOLESTEROL (lipid profile test).pptx
TOTAL CHOLESTEROL (lipid profile test).pptxTOTAL CHOLESTEROL (lipid profile test).pptx
TOTAL CHOLESTEROL (lipid profile test).pptx
 
TOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physicsTOPIC 8 Temperature and Heat.pdf physics
TOPIC 8 Temperature and Heat.pdf physics
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tantaDashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
Dashanga agada a formulation of Agada tantra dealt in 3 Rd year bams agada tanta
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
Hot Sexy call girls in Moti Nagar,🔝 9953056974 🔝 escort Service
Hot Sexy call girls in  Moti Nagar,🔝 9953056974 🔝 escort ServiceHot Sexy call girls in  Moti Nagar,🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Moti Nagar,🔝 9953056974 🔝 escort Service
 
zoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistanzoogeography of pakistan.pptx fauna of Pakistan
zoogeography of pakistan.pptx fauna of Pakistan
 
Temporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of MasticationTemporomandibular joint Muscles of Mastication
Temporomandibular joint Muscles of Mastication
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
‏‏VIRUS - 123455555555555555555555555555555555555555
‏‏VIRUS -  123455555555555555555555555555555555555555‏‏VIRUS -  123455555555555555555555555555555555555555
‏‏VIRUS - 123455555555555555555555555555555555555555
 
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptxTwin's paradox experiment is a meassurement of the extra dimensions.pptx
Twin's paradox experiment is a meassurement of the extra dimensions.pptx
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
 
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
Call Us ≽ 9953322196 ≼ Call Girls In Lajpat Nagar (Delhi) |
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
Cytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptxCytokinin, mechanism and its application.pptx
Cytokinin, mechanism and its application.pptx
 
Module 4: Mendelian Genetics and Punnett Square
Module 4:  Mendelian Genetics and Punnett SquareModule 4:  Mendelian Genetics and Punnett Square
Module 4: Mendelian Genetics and Punnett Square
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 tr
 

Known plaintext attack of hill cipher

  • 1. Two More Examples of a Known Plaintext Attack Here are two examples of cryptanalyzing a Hill cipher with a known plaintext attack. Each example is done by hand – without using Mathematica. In example one, there is no need to reduce the modulus; in example two the modulus must be reduced. Example one: Ciphertext: FAGQQ ILABQ VLJCY QULAU STYTO JSDJJ PODFS ZNLUH KMOW We are assuming that this message was encrypted using a 2 2× Hill cipher and that we have a crib. We believe that the message begins “a crib.” ac ri [1, 3] [18, 9] [6, 1] [7, 17] FA GQ
  • 2. We could either solve for the key or the key inverse. To solve for the key, we would solve 1 6 3 1 a b c d       =            and 18 7 9 17 a b c d       =            To solve for the key inverse, we would solve 6 1 1 3 e f g h       =            and 7 18 17 9 e f g h       =            We will solve for the key. 1 6 3 1 a b c d       =            represents two linear equations: 3 6 3 1 a b c d + = + = and 18 7 9 17 a b c d       =            represents 18 9 7 18 9 17 a b c d + = + = Now we solve the following linear congruences mod 26.
  • 3. 3 6 18 9 7 a b a b + =  + = and 3 1 18 9 17 c d c d + =  + = We will solve the pair of congruences 3 6 18 9 7 a b a b + =  + = first. To eliminate an unknown, multiply congruence 1 by 3 3 9 18 18 9 7 a b a b + =  + = and subtract congruence 2 from congruence 1. 15 11a− = Modulo 26, -15 is 11. 11 11a = Divide by 11 to obtain a. 1a = Now substitute this in congruence 1. 1 3 6b+ = 3 5b = The multiplicative inverse of 3 is 9 modulo 26. 9 3 9 5 45 19mod 26b b= × = × = = So, the key looks like 1 19 c d      
  • 4. Now solve the system 3 1 18 9 17 c d c d + =  + = 3 9 3 18 9 17 c d c d + =  + = 15 14c = 7 15 7 14 98 20mod 26c c= × = × = = 20 3 1d+ = 3 19 7mod 26d =− = 9 3 9 7 63 11mod 26d d= × = × = = The key is 1 19 20 11       . Example two: We are assuming that we have a ciphertext message was that encrypted using a 2 2× Hill cipher and that we have a crib. We believe that ciphertext UKJN corresponds to plaintext word. wo rd [23, 15] [18, 4] [21, 11] [10, 14] UK JN The two systems of congruences are: 23 15 21 18 4 10 a b a b + =  + = and 23 15 11 18 4 14 c d c d + =  + = We will solve the system on the left.
  • 5. To eliminate an unknown, multiply congruence number 1 by 4 and congruence number 2 by 15 both modulo 26. 14 8 6 10 8 20 a b a b + =  + = Subtract the second congruence from the first. 4 14 12mod 26a =− = This congruence corresponds to the equation 4 12 26a k= + , 4a is 12 plus a multiple of 26. Notice that 2 divides the coefficient of a, the constant 12, and the modulus 26. We reduce the modulus by dividing by 2. 2 6 13a k= + and we have a congruence modulo 13. 2 6mod13a = This congruence does not have a common factor among the coefficient, the constant, and the modulus. Here are the multiplicative inverses of the integers modulo 13: Number 1 2 3 4 5 6 7 8 9 10 11 12 Multiplicative inverse 1 7 9 10 8 11 2 5 3 4 6 12 To find a, multiply 2 6mod13a = by the multiplicative inverse of 2, which is 7. 7 2 7 6 42 3mod13a a= × = × = = So, a is 3 modulo 13. But, there are two integers mod 26 that are 3 mod 13, namely, 3 and 3 + 13 = 16. So, there are two possible values for a. If a = 3, 18 3 4 10b× = =
  • 6. 54 4 10b+ = 2 4 10b+ = 4 8mod 26b = 2 4mod13b = 7 2 7 4 26 2mod13b b= × = × = = So, b=2 or b = 2+13 = 15 modulo 16. If a = 16, 18 16 4 10b× + = 288 4 10b+ = 2 4 10b+ = which yields the same solutions for b. Here are the 4 possible solutions for a and b. 3 2 3 15 16 2 16 15 a b a b a b a b = = = = = = = = Now solve 23 15 11 18 4 14 c d c d + =  + = . 14 8 18 10 8 2 a b a b + =  + = 4 16mod 26c = 2 8mod13c =
  • 7. 7 2 14 7 8 56 4mod13c c c= × = = × = = So, c = 4 or c = 4 + 13 = 17 modulo 26. If c = 4, 18 4 4 14d× + = 20 4 14d+ = 4 6 20mod 26d =− = 2 10mod13d = 7 2 7 10 5mod13d d= × = × = So, d = 5 or d = 5 + 13 = 18 modulo 26. If c = 17, 18 17 4 14d× + = 20 4 14d+ = and we are led to the same solutions for d. 4 5 4 18 17 5 17 18 c d c d c d c d = = = = = = = = There are 16 possible 2 2× matrices that could be the key.
  • 8. 3 2 3 2 3 2 3 2 4 5 4 18 17 5 17 18 3 15 3 15 3 15 3 15 4 5 4 18 17 5 17 18 16 2 16 2 16 2 16 2 4 5 4 18 17 5 17 18 16 15 16 15 16 15 16 15 4 5 4 18 17 5 17 18                                                                                                 First, calculate the determinant of each. Any matrix that does not have an invertible determinant modulo 26 (i.e., the determinant is not one of 1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25 modulo 26) can be eliminated. Then try to decipher the messages with each of the remaining messages. The matrix that yields plaintext is the key.