An Introduction to Hill Ciphers
description
Transcript of An Introduction to Hill Ciphers
![Page 1: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/1.jpg)
An Introduction to Hill CiphersUsing Linear Algebra
Brian Worthington
University of North Texas
MATH 2700.002
5/10/2010
![Page 2: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/2.jpg)
Hill CiphersCreated by Lester S. Hill in 1929Polygraphic Substitution CipherUses Linear Algebra to Encrypt
and Decrypt
![Page 3: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/3.jpg)
Simple Substitution CiphersWork by substituting one letter
with another letter.Easy to crack using Frequency
Analysis
![Page 4: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/4.jpg)
Letter to Letter SubstitutionA B C D E F G H I J K L MQ W E R T Y U I O P A S D
N O P Q R S T U V W X Y ZF G H J K L Z X C V B N M
Unencrypted = HELLO WORLD
Encrypted = ITSSG VKGSR
![Page 5: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/5.jpg)
Polygraphic Substitution CiphersEncrypts letters in groupsFrequency analysis more difficult
![Page 6: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/6.jpg)
Hill CiphersPolygraphic substitution cipherUses matrices to encrypt and
decryptUses modular arithmetic (Mod
26)
![Page 7: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/7.jpg)
Modular ArithmeticFor a Mod b, divide a by b and
take the remainder.14 ÷ 10 = 1 R 414 Mod 10 = 424 Mod 10 = 4
![Page 8: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/8.jpg)
Modulus Theorem
![Page 9: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/9.jpg)
Modulus Examples
![Page 10: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/10.jpg)
Modular InversesInverse of 2 is ½ (2 · ½ = 1)Matrix Inverse: AA-1= IModular Inverse for Mod m: (a · a-1)
Mod m = 1For Modular Inverses, a and m
must NOT have any prime factors in common
![Page 11: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/11.jpg)
Modular Inverses of Mod 26A 1 2 5 7 9 11 15 17 19 21 23 25A-1 1 9 21 15 3 19 7 23 11 5 17 25
Example – Find the Modular Inverse of 9 for Mod 26
9 · 3 = 27
27 Mod 26 = 1
3 is the Modular Inverse of 9 Mod 26
![Page 12: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/12.jpg)
Hill Cipher MatricesOne matrix to encrypt, one to
decryptMust be n x n, invertible matricesDecryption matrix must be
modular inverse of encryption matrix in Mod 26
![Page 13: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/13.jpg)
Modularly Inverse MatricesCalculate determinant of first matrix
A, det AMake sure that det A has a modular
inverse for Mod 26 Calculate the adjugate of A, adj AMultiply adj A by modular inverse of
det ACalculate Mod 26 of the result to get BUse A to encrypt, B to decrypt
![Page 14: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/14.jpg)
Modular Reciprocal Example
![Page 15: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/15.jpg)
EncryptionAssign each letter in alphabet a
number between 0 and 25Change message into 2 x 1 letter
vectorsChange each vector into 2 x 1
numeric vectorsMultiply each numeric vector by
encryption matrixConvert product vectors to
letters
![Page 16: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/16.jpg)
Letter to Number SubstitutionA B C D E F G H I J K L M0 1 2 3 4 5 6 7 8 9 10 11 12
N O P Q R S T U V W X Y Z13 14 15 16 17 18 19 20 21 22 23 24 25
![Page 17: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/17.jpg)
Change Message to VectorsMessage to encrypt = HELLO
WORLD
![Page 18: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/18.jpg)
Multiply Matrix by Vectors
![Page 19: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/19.jpg)
Convert to Mod 26
![Page 20: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/20.jpg)
Convert Numbers to Letters
HELLO WORLD has been encrypted to SLHZY ATGZT
![Page 21: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/21.jpg)
DecryptionChange message into 2 x 1 letter
vectorsChange each vector into 2 x 1
numeric vectorsMultiply each numeric vector by
decryption matrixConvert new vectors to letters
![Page 22: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/22.jpg)
Change Message to VectorsMessage to encrypt = SLHZYATGZT
![Page 23: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/23.jpg)
Multiply Matrix by Vectors
![Page 24: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/24.jpg)
Convert to Mod 26
![Page 25: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/25.jpg)
Convert Numbers to Letters
SLHZYATGZT has been decrypted to HELLO WORLD
![Page 26: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/26.jpg)
ConclusionCreating valid
encryption/decryption matrices is the most difficult part of Hill Ciphers.
Otherwise, Hill Ciphers use simple linear algebra and modular arithmetic
![Page 27: An Introduction to Hill Ciphers](https://reader033.fdocuments.us/reader033/viewer/2022061608/56816337550346895dd3c5f9/html5/thumbnails/27.jpg)
Questions?