1 Introduction to Codes, Ciphers, and Cryptography Michael A. Karls Ball State University.

Slides:



Advertisements
Similar presentations
Using Cryptography to Secure Information. Overview Introduction to Cryptography Using Symmetric Encryption Using Hash Functions Using Public Key Encryption.
Advertisements

1 Codes, Ciphers, and Cryptography-Ch 1 Michael A. Karls Ball State University.
Computer Science 101 Data Encryption And Computer Networks.
CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
22C:19 Discrete Structures Integers and Modular Arithmetic
BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
Public Key Encryption Algorithm
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
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.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
Public Key Cryptography
Public Encryption: RSA
RSA Exponentiation cipher
8: Network Security8-1 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key: K r e.g., key is knowing substitution.
Encryption. Introduction Computer security is the prevention of or protection against –access to information by unauthorized recipients –intentional but.
Codes, Ciphers, and Cryptography-RSA Encryption
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
1 The Mathematics of Star Trek Lecture 9: Cryptography.
Department of Mathematics and Statistics
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.
Introduction to Modular Arithmetic and Public Key Cryptography.
MATH 224 – Discrete Mathematics
RSA Public Key Algorithm. RSA Algorithm history  Invented in 1977 at MIT  Named for Ron Rivest, Adi Shamir, and Len Adleman  Based on 2 keys, 1 public.
MAT 1000 Mathematics in Today's World Winter 2015.
RSA and its Mathematics Behind
CS110: Computers and the Internet Encryption and Certificates.
T TT The Cryptography Istituto Tecnico Industriale “E.Divini” San Severino Marche.
Cryptography: RSA & DES Marcia Noel Ken Roe Jaime Buccheri.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
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.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
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.
Midterm Review Cryptography & Network Security
Public Key Encryption CS432 – Security in Computing Copyright © 2005, 2008 by Scott Orr and the Trustees of Indiana University.
Day 37 8: Network Security8-1. 8: Network Security8-2 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key:
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Section 4.4: The RSA Cryptosystem Practice HW Handwritten and Maple Exercises p at end of class notes.
Elements of Coding and Encryption Continuation 1.
The RSA Algorithm. Content Review of Encryption RSA An RSA example.
Encryption.
Some Number Theory Modulo Operation: Question: What is 12 mod 9?
30.1 Chapter 30 Cryptography Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CSCI 391: Practical Cryptology Substitution Monoalphabetic Ciphers.
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
CRYPTOGRAPHY. WHAT IS PUBLIC-KEY ENCRYPTION? Encryption is the key to information security The main idea- by using only public information, a sender can.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Network Security Lecture 18 Presented by: Dr. Munam Ali Shah.
+ Security. + What is network security? confidentiality: only sender, intended receiver should “understand” message contents sender encrypts message receiver.
Encryption CS110: Computer Science and the Internet.
CS Modular Division and RSA1 RSA Public Key Encryption To do RSA we need fast Modular Exponentiation and Primality generation which we have shown.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
Unit 2 Modular Arithmetic and Cryptography IT Disicipline ITD1111 Discrete Mathematics & Statistics STDTLP 1 Unit 2 Modular Arithmetic and Cryptography.
An Introduction to Cryptology
1 Cryptography Troy Latchman Byungchil Kim. 2 Fundamentals We know that the medium we use to transmit data is insecure, e.g. can be sniffed. We know that.
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Introduction to Cryptography Lecture 4. Caesar Cipher Gaius Julius Caesar (100 B.C.- 44 B.C.) General Politician Dictator of Rome Creator of Caesar Cipher.
Introduction to Cryptography Hyunsung Kim, PhD University of Malawi, Chancellor College Kyungil University February, 2016.
Cryptography services Lecturer: Dr. Peter Soreanu Students: Raed Awad Ahmad Abdalhalim
week 8Complexity of Algorithms1 Elementary Number Theory Given positive integers a and b, we use the notation a¦b to indicated that a divides b, i.e.,
Revision. Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder.
Cryptography By: Nick Belhumeur. Overview What is Cryptography? What is Cryptography? 2 types of cryptosystems 2 types of cryptosystems Example of Encryption.
Taehyung Kim HPC Lab. POSTECH
Chapter 30 Cryptography Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Cryptography.
Presentation transcript:

1 Introduction to Codes, Ciphers, and Cryptography Michael A. Karls Ball State University

2 Introduction Throughout history, people have had the need to send messages to other people in secret! Methods have been developed to disguise and break secret messages.

3 Definitions and Terminology A code is a form of secret communication in which a word or phrase is replaced with a word, number, or symbol. For example, here is a simple code for an army.  “Attack at dawn”  Jupiter.  “The coast is clear”  Tippy-toe.  Each commander and soldier would have a copy of the codes in some sort of codebook.

4 Definitions and Terminology (cont.) A cipher is a form of secret communication in which letters are replaced with a letter, number, or symbol. One example of a cipher, attributed to Julius Caesar (1 st Century B.C.), is outlined in the table below. Basically, the cipher alphabet is the plain alphabet shifted n spaces left.  For example, if we take n = 14, we get: Plaintext:“attack at dawn” Ciphertext:“OHHOQY OH ROKB”  Send ciphertext as OHH OQY OHR OKB.  Recipient would need to know how message was created. Plaintextabcdefghijklmnopqrstuvwxyz CiphertextOPQRSTUVWXYZABCDEFGHIJKLMN

5 Definitions and Terminology (cont.) Cryptography is the science of concealing the meaning of a message. It is also used to mean the science of anything connected with ciphers—an alternative to cryptology, which is the science of secret writing. To encrypt a message, one conceals the meaning of the message via a code or cipher. Similar definitions hold for encode and encipher. To decrypt a message, one turns an ecrypted message back into the original message. Similar definitions hold for decode and decipher.

6 Notes on Ciphers For any cipher there is an algorithm, which is a general encrypting method, and a key which specifies the exact details of the algorithm. For the Caesar cipher,  Algorithm—shift the alphabet.  Key—how many places to shift!  Thus, there are 26 keys for this cipher.

7 Notes on Ciphers (cont.) The key must remain secure!  If the key is found, the code will be broken.  If the algorithm is known, the code can still be secure!  For a code or cipher, the greater the number of keys, the greater the security!

8 Notes on Ciphers (cont.) The Caesar cipher is an example of a substitution cipher. This cipher is symmetric because sender and receiver must both know (have) the key.

9 Ciphers via Modular Arithmetic Using modular arithmetic, we can make ciphers! For any non-negative integers a and n, we define a mod n to be the remainder when a is divided by n. For example, 18 mod 5 = 3, since 18 = 3 x mod 7 = 4, since 4 = 0 x mod 26 = 2, since 28 = 1 x mod 13 = 0, since 26 = 2 x

10 Ciphers via Modular Arithmetic (cont.) We can add and multiply numbers mod n too! For example, here is how to find (27+15) mod 26 and (27 x 15) mod 26.  = 42 and 42 mod 26 = 16, so (27+15) mod 26 = 16 or 27 mod 26 = 1 and 15 mod 26 = 15, so (27+15) mod 26 = (1+15) mod 26 = 16 mod 26 = 16  27 x 15 = 405 and 405 mod 26 = 15, so (27 x 15) mod 26 = 15 or (27 x 15) mod 26 = (1 x 15) mod 26 = 15 mod 26 = 15

11 Ciphers via Modular Arithmetic (cont.) To find (a+b) mod n:  Add a to b, then find the resulting sum mod n,  Or find a mod n, find b mod n, and add the results mod n.  Multiplication works in a similar fashion! Now we are ready to make an additive cipher!

12 Ciphers via Modular Arithmetic (cont.) First, assign 1, 2, …, 26 mod 26 to a, b, …, z. Next, choose a fixed integer m between 0 and 25. To get the ciphertext y from plaintext x, add m mod 26, i.e., y = (x+m) mod 26. As an example, here is additive cipher alphabet for m=14. Notice that this is just the Caesar cipher we saw before! Plaintextabcdefghijklm Plaintext # Ciphertext # CiphertextOPQRSTUVWXYZA Plaintextnopqrstuvwxyz Plaintext # Ciphertext # CiphertextBCDEFGHIJKLMN

13 The RSA Encryption Scheme In 1977, MIT mathematicians Rivest, Shamir, and Adleman announced their invention of a public key cryptography scheme. In order to understand this scheme, commonly known as RSA, we need some definitions!

14 Definition of Divisor Let a and b be integers, with b  0. We say that b divides a or b is a divisor of a if a = bc for some integer c. Notation: b|a Example 1: 3|24 since 24 = 3 x 8. Divisors of 12 are: -12, -6, -4, -3, -2, -1, 1, 2, 3, 4, 6, 12

15 Definition of Greatest Common Divisor (GCD) Let a and b be integers, not both zero. The greatest common divisor (GCD) of a and b is the largest integer that divides both a and b. Notation: (a,b) Example 2:  Divisors of 6: -6, -3, -2, -1, 1, 2, 3, 6  Divisors of 8: -8, -4, -2, -1, 1, 2, 4, 8  Thus, (6,8) = 2  Since the divisors of 7 are -7, -1, 1, 7, (7,8) = 1.

16 Definition of Relatively Prime Two integers whose GCD is 1 are said to be relatively prime. Example 3: Since (7,8) = 1, 7 and 8 are relatively prime.

17 Definition of Prime Number A positive integer p is said to be prime if p>1 and the only positive divisors of p are 1 and p. Example 4: 2, 3, and 7 are prime. 6, 8, 10, 100 are not prime (composite).

18 RSA Scheme (with Alice and Bob!) Step 1: Alice chooses two huge prime numbers p and q. Note: Alice keeps p and q secret! Example 5: p = 47 and q = 59.

19 RSA Scheme (with Alice and Bob!) (cont.) Step 2: Alice computes N = p x q. Then she computes k = (p-1)(q-1). Finally, she chooses an integer e such that 1<e<N and (e,k) =1. Example 5 (cont.): N = 47 x 59 = k = 46 x 58 = e = 17. Choice of e is o.k, since 1<17<2773 and (17,2668)= 1.

20 RSA Scheme (with Alice and Bob!) (cont.) Step 3: Alice computes d = e -1 mod k. Alice publishes her public key: N, e. Alice keeps secret her private key: p, q, d, k. Example 5 (cont.): d = mod 2668 = 157. Alice’s public key: N = 2773; e = 17. Alice’s private key: p = 47; q = 59; d = 157; k = 2668.

21 RSA Scheme (with Alice and Bob!) (cont.) Step 4: Suppose Bob wants to send a message to Alice. To do so, he looks up Alice’s public key, converts the message into numbers M<N. Example 5 (cont.): Plaintext is HELLO HELLO  HE LL O_ Assign 00  space; 01  A; 02  B, …, 26  Z (or use ASCII).  PlaintextPlain # HE0805 LL1212 O_1500

22 RSA Scheme (with Alice and Bob!) (cont.) Step 4 (cont.): Next, for each plaintext number M, Bob computes: C = M e mod N(1) to get ciphertext number C. Example 5 (cont.): mod 2773 = mod 2773 = mod 2773 = Encrypted message is

23 RSA Scheme (with Alice and Bob!) (cont.) Step 5: Bob s Alice the encrypted message. To decrypt, Alice uses her private key and computes: M = C d mod N (2) Example 5 (cont.): mod 2773 = mod 2773 = mod 2773 = Decrypted message is HE LL O_.

24 References The Code Book by Simon Singh