An Introduction to Hill Ciphers Using Linear Algebra Brian Worthington University of North Texas MATH 2700.002 5/10/2010.

Slides:



Advertisements
Similar presentations
Mod arithmetic.
Advertisements

390 Codes, Ciphers, and Cryptography
Data encryption with big prime numbers
Section 3.8: More Modular Arithmetic and Public-Key Cryptography
What is Elliptic Curve Cryptography?
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
An Introduction to Cryptography TEA fellows February 9, 2012 Dr. Kristen Abernathy.
Announcements: Please use pencil on quizzes if possible Please use pencil on quizzes if possible Knuth quotes, part 1 Knuth quotes, part 1Questions?Today:
Announcements: We’ll attempt to grade Friday’s quizzes by end of day on Friday and leave outside my office We’ll attempt to grade Friday’s quizzes by end.
ENGG2013 Unit 11 Row-Rank Feb,
Classical Cryptography 1. Introduction: Some Simple Cryptosystems.
Creating Secret Messages. 2 Why do we need to keep things secret? Historically, secret messages were used in wars and battles For example, the Enigma.
CC3.12 Erdal KOSE Privacy & Digital Security Encryption.
Windows Core Security1© 2006 Microsoft Corp Cryptography: Helping Number Theorists Bring Home the Bacon Since 1977 Dan Shumow SDE Windows Core Security.
Announcements: Assignment 2 finalized Assignment 2 finalizedQuestions?Today: Wrap up Hill ciphers Wrap up Hill ciphers One-time pads and LFSR One-time.
Cryptography at The University of South Carolina Douglas B. Meade
Unit 2 Common Fractions. 2 FRACTION A fraction is a value that shows the number of equal parts taken of a whole quantity or unit  Fractions can be expressed.
Section 2.9 The Hill Cipher; Matrices
Using Matrices to Solve a 3-Variable System
Using Matrices to Solve a System of Equations. Multiplicative Identity Matrix The product of a square matrix A and its identity matrix I, on the left.
Introduction to Cryptography
CSE 504 Discrete Mathematics & Foundations of Computer Science
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
Mathematics of Cryptography Modular Arithmetic, Congruence,
Diffusion and Confusion Two properties that a good cryptosystem should have: Diffusion: change of one character in the plaintext results in several characters.
Section 4.3: Fermat’s Little Theorem Practice HW (not to hand in) From Barr Text p. 284 # 1, 2.
MAT 1000 Mathematics in Today's World Winter 2015.
Computer System Security CSE 5339/7339
Section 2.1: Shift Ciphers and Modular Arithmetic The purpose of this section is to learn about modular arithmetic, which is one of the fundamental mathematical.
4.5 Solving Systems using Matrix Equations and Inverses.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
Systems of Equations as Matrices and Hill Cipher.
Lesson 4.7. Identity Matrix:  If you multiply a matrix by an identity matrix (I) the result is the same as the original matrix.  If Matrix A is a square.
Section 2.1: Shift Ciphers and Modular Arithmetic Practice HW from Barr Textbook (not to hand in) p.66 # 1, 2, 3-6, 9-12, 13, 15.
Holt Algebra Matrix Inverses and Solving Systems A matrix can have an inverse only if it is a square matrix. But not all square matrices have inverses.
Chapter 9 Matrices and Determinants Copyright © 2014, 2010, 2007 Pearson Education, Inc Multiplicative Inverses of Matrices and Matrix Equations.
Using Inverse Matrices in Real Life
1 Ch. 4 Linear Models & Matrix Algebra Matrix algebra can be used: a. To express the system of equations in a compact manner. b. To find out whether solution.
Chapter The Integers and Division Division
Cryptography Lecture 2: Classic Ciphers Piotr Faliszewski.
CRYPTOGRAPHY AND THE MATH MAJOR Dr. Mihai Caragiu Mathematics Department Ohio Northern University.
Elements of Coding and Encryption Continuation 1.
Introduction to Ciphers Breno de Medeiros. Cipher types From “Cipher”, Wikipedia article.
Some Number Theory Modulo Operation: Question: What is 12 mod 9?
Announcements: Matlab tutorial linked to in syllabus Matlab tutorial linked to in syllabusQuestions?Today: Block ciphers, especially Hill Ciphers Modular.
CSCI 391: Practical Cryptology Substitution Monoalphabetic Ciphers.
Mathematical Concepts in Cryptography 355 Brian Tafel, Mark Shippy Raymond Fuller, and Mireya.
MAT 1000 Mathematics in Today's World Winter 2015.
What use are prime numbers? ?. o All the primes, apart from 2, are odd numbers. o 1 is not a prime number. Why? o There are infinitely many prime numbers!
4.4 Identity and Inverse Matrices
Cryptography and Coding Theory
RSA Encryption © 2014 Project Lead The Way, Inc.Computer Science and Software Engineering.
Fermat’s Little Theorem The RSA Cryptosystem will require exponentiation to decrypt messages. Exponentiation Notation Example 1: Compute Exponentials Example.
Unit 2 Modular Arithmetic and Cryptography IT Disicipline ITD1111 Discrete Mathematics & Statistics STDTLP 1 Unit 2 Modular Arithmetic and Cryptography.
Notes Over 4.4 Finding the Inverse of 2 x 2 Matrix.
2.5 – Determinants and Multiplicative Inverses of Matrices.
Lecture 2-3 Basic Number Theory and Algebra. In modern cryptographic systems, the messages are represented by numerical values prior to being encrypted.
Cryptography Cryptography is the use of mathematics to encode messages and prevent them from being read by anyone who doesn’t know the code. One way that.
Warm UP: Review of Inequalities What do each of the symbols represent: 1. > 2. < Greater Than 2. Less than 3. Less than or equal to 4. Greater.
3.8B Solving Systems using Matrix Equations and Inverses.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.
Investigating Identity and Inverse Matrices QUESTION: What are some properties of identity and inverse matrices? 1 Let A =, B =, and C=. Consider the 2.
Using Matrices to Solve a 3-Variable System
Affine Cipher.
Classical Polygraphic Ciphers
M3: Encryption r By Andrew Stringer.
Applications of Inverse Matrices
Solving Linear Systems Using Inverse Matrices
Hill Cipher The Hill Cipher uses matrix multiplication to encrypt a message. First, you need to assign two numbers to each letter in the alphabet and also.
Lecture 2-3 Basic Number Theory and Algebra
Presentation transcript:

An Introduction to Hill Ciphers Using Linear Algebra Brian Worthington University of North Texas MATH /10/2010

Hill Ciphers Created by Lester S. Hill in 1929 Polygraphic Substitution Cipher Uses Linear Algebra to Encrypt and Decrypt

Simple Substitution Ciphers Work by substituting one letter with another letter. Easy to crack using Frequency Analysis

Letter to Letter Substitution ABCDEFGHIJKLM QWERTYUIOPASD NOPQRSTUVWXYZ FGHJKLZXCVBNM Unencrypted = HELLO WORLD Encrypted = ITSSG VKGSR

Polygraphic Substitution Ciphers Encrypts letters in groups Frequency analysis more difficult

Hill Ciphers Polygraphic substitution cipher Uses matrices to encrypt and decrypt Uses modular arithmetic (Mod 26)

Modular Arithmetic For a Mod b, divide a by b and take the remainder. 14 ÷ 10 = 1 R 4 14 Mod 10 = 4 24 Mod 10 = 4

Modulus Theorem

Modulus Examples

Modular Inverses Inverse of 2 is ½ ( 2 · ½ = 1 ) Matrix Inverse: AA -1 = I Modular Inverse for Mod m : (a · a -1 ) Mod m = 1 For Modular Inverses, a and m must NOT have any prime factors in common

Modular Inverses of Mod 26 A A Example – Find the Modular Inverse of 9 for Mod 26 9 · 3 = Mod 26 = 1 3 is the Modular Inverse of 9 Mod 26

Hill Cipher Matrices One matrix to encrypt, one to decrypt Must be n x n, invertible matrices Decryption matrix must be modular inverse of encryption matrix in Mod 26

Modularly Inverse Matrices Calculate determinant of first matrix A, det A Make sure that det A has a modular inverse for Mod 26 Calculate the adjugate of A, adj A Multiply adj A by modular inverse of det A Calculate Mod 26 of the result to get B Use A to encrypt, B to decrypt

Modular Reciprocal Example

Encryption Assign each letter in alphabet a number between 0 and 25 Change message into 2 x 1 letter vectors Change each vector into 2 x 1 numeric vectors Multiply each numeric vector by encryption matrix Convert product vectors to letters

Letter to Number Substitution ABCDEFGHIJKLM NOPQRSTUVWXYZ

Change Message to Vectors Message to encrypt = HELLO WORLD

Multiply Matrix by Vectors

Convert to Mod 26

Convert Numbers to Letters HELLO WORLD has been encrypted to SLHZY ATGZT

Decryption Change message into 2 x 1 letter vectors Change each vector into 2 x 1 numeric vectors Multiply each numeric vector by decryption matrix Convert new vectors to letters

Change Message to Vectors Message to encrypt = SLHZYATGZT

Multiply Matrix by Vectors

Convert to Mod 26

Convert Numbers to Letters SLHZYATGZT has been decrypted to HELLO WORLD

Conclusion Creating valid encryption/decryption matrices is the most difficult part of Hill Ciphers. Otherwise, Hill Ciphers use simple linear algebra and modular arithmetic

Questions?