(Tuesday, 20 October, 7:30-9PM) Encryption-Decryption

Slides:



Advertisements
Similar presentations
Cryptography Made Easy Stuart Reges Principal Lecturer University of Washington.
Advertisements

Cryptology  Terminology  plaintext - text that is not encrypted.  ciphertext - the output of the encryption process.  key - the information required.
Digital Signatures. Anononymity and the Internet.
 Caesar used to encrypt his messages using a very simple algorithm, which could be easily decrypted if you know the key.  He would take each letter.
What is Elliptic Curve Cryptography?
Great Theoretical Ideas in Computer Science.
OOP/Java1 Public Key Crytography From: Introduction to Algorithms Cormen, Leiserson and Rivest.
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.
Public Key Crytography1 From: Introduction to Algorithms Cormen, Leiserson and Rivest.
Public Key Cryptography
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
CSCI 398 Research Topics in Computer Science Yana Kortsarts Computer Science Department Widener University Chester, PA.
CS5204 – Fall Cryptographic Security Presenter: Hamid Al-Hamadi October 13, 2009.
Page 1 Secure Communication Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
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.
T TT The Cryptography Istituto Tecnico Industriale “E.Divini” San Severino Marche.
1 Applications of Number Theory CS 202 Epp section 10.4 Aaron Bloomfield.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
Public-Key Cryptography CS110 Fall Conventional Encryption.
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.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
RSA Public Key Crypto System. About RSA Announced in 1977 by Ronald Rivest, Adi Shamir, and Leonard Adleman Relies on the relative ease of finding large.
1 Simple and Unbreakable: The Mathematics of Internet Security Dr. Monica Nevins Department of Mathematics and Statistics University of Ottawa University.
Cryptography & Network Security : Topic Seminar Description & Analysis Madhava.N 1RV06SCN05 2 nd Semester M.Tech CNE RVCE RSA ALGORITHM.
CRYPTOGRAPHY. WHAT IS PUBLIC-KEY ENCRYPTION? Encryption is the key to information security The main idea- by using only public information, a sender can.
David Kauchak CS52 – Spring 2015
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine.
CS100A, Lecture 13, 15 October CS100A Lecture Oct Discussion of Prelim 2 (Tuesday, 20 October, 7:30-9PM) Rooms for Prelim 2 A-K: Hollister.
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
Public Key Cryptosystem In Symmetric or Private Key cryptosystems the encryption and decryption keys are either the same or can be easily found from each.
Intro to Cryptography ICS 6D Sandy Irani. Cryptography Intro Alice wants to send a message to Bob so that even if Eve can see the transmitted information,
Cryptography services Lecturer: Dr. Peter Soreanu Students: Raed Awad Ahmad Abdalhalim
RSA Algorithm Date: 96/10/17 Wun-Long Yang. Outline Introduction to RSA algorithm RSA efficient implementation & profiling.
Cryptography By: Nick Belhumeur. Overview What is Cryptography? What is Cryptography? 2 types of cryptosystems 2 types of cryptosystems Example of Encryption.
Public Key Cryptography
Digital Signatures.
CS480 Cryptography and Information Security
Public Key Encryption Major topics The RSA scheme was devised in 1978
Public Key Encryption.
David Kauchak CS52 – Spring 2016
Network Security Design Fundamentals Lecture-13
Vocabulary Big Data - “Big data is a broad term for datasets so large or complex that traditional data processing applications are inadequate.” Moore’s.
Privacy & Security.
Public Key Encryption and Digital Signatures
MA/CSSE 473 Day 10 Data Encryption RSA.
Public Key Encryption and the RSA Algorithm
Big Numbers: Mathematics and Internet Commerce
Some basic terminology
Modular Arithmetic and RSA Encryption
Elliptic Curve Cryptography (ECC)
Real-world Security of Public Key Crypto
NET 311 Information Security
Elliptic Curve Cryptography (ECC)
MSIT 543 Cryptography Concepts and Techniques How RSA Encryption Works
NET 311 Information Security
Discrete Math for CS CMPSC 360 LECTURE 14 Last time:
Where Complexity Finally Comes In Handy…
Chapter -5 PUBLIC-KEY CRYPTOGRAPHY AND RSA
Where Complexity Finally Comes In Handy…
(We’ll spend a few lectures on iteration)
Fluency with Information Technology Lawrence Snyder
Where Complexity Finally Comes In Handy…
CS100A Lect. 12, 8 Oct More About Arrays
Presentation transcript:

(Tuesday, 20 October, 7:30-9PM) Encryption-Decryption CS100A Lecture 13 15 Oct. 1998 Discussion of Prelim 2 (Tuesday, 20 October, 7:30-9PM) Rooms for Prelim 2 A-K: Hollister B14 L-Z: Kimball B11 Cryptography: Encryption-Decryption using arrays (assignment 6) CS100A, Lecture 13, 15 October 1998

Prelim 2 1. Everything that was on Prelim 1. In particular: Be able to define four kinds of variables: local variables, parameters, fields (instance variables) and static fields (class variables) Know the three kinds of methods (procedures, functions, constructors) Know what an argument is. Know precisely the steps in executing a method call. Know precisely the steps in evaluating new C(…) 2. Loops: Know what a loop invariant is and how it is used. Be able to write a loop, given an invariant. Write simple loops without be given an invariant. 3. Arrays: know how to declare an array, allocate an array, use an array. 4. Understand type char. CS100A, Lecture 13, 15 October 1998

Encryption-Decryption CS100A Lect. 13, 15 Oct. 1998 Cryptography: Encryption-Decryption using arrays (assignment 6) Cryptography even before Caesar’s time: Encode messages, with the hope that only “friends”, who have been given the decoding scheme, can decode them. “Have a nice day” replace every character by the next one: a --> b, etc. “Ibwf b ojdf ebz” CS100A, Lecture 13, 15 October 1998

During world war II, the Germans encoded messages using a kind of “computer” (not a real computer, as we know them today) they had built, called the Enigma. The British had a group that worked continu-ously to intercept and decode the messages. They succeeded in breaking the code, and this was one reason for the success of the Allies. At times, they couldn’t use what they had learned because they didn’t want the Germans to suspect that their codes had been broken. Alan Turing, a mathematician who did a lot for computing (about 1936) even before computers were developed, had a big part in this. You’ll learn about Turing’s contributions to the theory of computing --the Turing Machine-- in CS481. CS100A, Lecture 13, 15 October 1998

Two types of cryptosystems: Secret key: both the sender and the receiver have the key to encoding/decoding. Hopefully, no one else does. How to send the receiver the secret key (assuming it has to be changed) without others intercepting it? Public key-private key: Gries decides on a public key - private key pair. He makes the public key available to everyone. Anyone wanting to send Gries an encoded message encodes it using the public key. Only Gries, who knows the private key, can decode the message. Diffie and Hellman published the idea in 1976, but without a good implementation. RSA (by Ron Rivest, Adi Shamir, and Leonard Adelman) found a way to implement it, using number theory. This assignment concerns the RDA public key - private key method. CS100A, Lecture 13, 15 October 1998

long integers: -9223372036854775808.. 9223372036854775807 Public key (puk, m) Private key (prk, m) Examples: puk prk m 401 137 551 229 349 399 241 481 551 109 493 Send Gries/Cardie messages using public key (109, 493). Only they can decode them because only they know the value prk. With small numbers, it can be guessed, but remember that these can be long integers --or even larger integers if we use some other representation of itnegers in Java. We don’t show how to generate public key - private key pairs. Must be hard to guess the prk. For example, given two primes p1 and p2, it’s easy to calculate p1*p2. But, given p1*p2, it’s very hard to calculate p1 or p2! Easy to multiply two integers; hard to factor some integers. CS100A, Lecture 13, 15 October 1998

Arithmetic modulo m (for m>0) Numbers can get too big when encrypting and decrypting (bigger than the biggest number in type long). We need a way to keep integers small. Use arithmetic modulo m, in which all integers are kept in the range 0..m-1. For any integer i, mod(i,m), or i mod m , is the integer that satisfies i = q*m+r and 0<=r < m (for some q) 6 mod 5 = 1 1 mod 5 = 1 -4 mod 5 = 1 5 mod 5 = 0 0 mod 5 = 0 -5 mod 5 = 0 4 mod 5 = 4 -1 mod 5 = 4 3 mod 5 = 3 -2 mod 5 = 3 2 mod 5 = 2 -3 mod 5 = 2 To calculate (i mod m): If i >=0: Use i%m (remainder when i is divided by m) If i<0: Use (i%m) + m See method mod in class Crypto for an analysis. CS100A, Lecture 13, 15 October 1998

Use arithmetic modulo m When encrypting and decrypting, after EVERY opera-tion that might produce an integer r that is larger than m, reduce it modulo m, that is, use r mod m instead! RSA: To encrypt an integer i as an integer j, use j = i puk mod m To decrypt an integer j to yield i, use i = j prk mod m In RSA, puk. prk, and m are chosen to guarantee that i = ( i puk mod m)prk mod m CS100A, Lecture 13, 15 October 1998

Encrypt a String s of characters as a long array c[0..s.length()] Each element c[i] of c is the encryption of s[i]: ((int) s.charAt(i)) puk mod m To decrypt long array c and produce the String s: each character s[i] is (char) (c[i] prk mod m) Example: the String “CS100” with prk = 401 and m =551 is encrypted as the array {383, 277, 197, 98, 98} CS100A, Lecture 13, 15 October 1998