CS100A, Lecture 13, 15 October 1998 1 CS100A Lecture 13 15 Oct. 1998 Discussion of Prelim 2 (Tuesday, 20 October, 7:30-9PM) Rooms for Prelim 2 A-K: Hollister.

Slides:



Advertisements
Similar presentations
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesThe Mighty Mod.
Advertisements

Cryptography Made Easy Stuart Reges Principal Lecturer University of Washington.
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.
CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
Section 3.8: More Modular Arithmetic and Public-Key Cryptography
 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.
YSLInformation Security -- Public-Key Cryptography1 Elliptic Curve Cryptography (ECC) For the same length of keys, faster than RSA For the same degree.
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.
Distributed Systems1 Lecture 12: RSA Distributed Systems2 Plan for today: Introduce RSA and a toy example using small numbers. This is.
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
Public Key Cryptography
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) 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.
Chapter 12 Cryptography (slides edited by Erin Chambers)
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.
Implementing RSA Encryption in Java
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Cryptography and Network Security Chapter 10 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Section 4.4: The RSA Cryptosystem Practice HW Handwritten and Maple Exercises p at end of class notes.
Darci Miyashiro Math 480 April 29, 2013
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.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
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.
The First Ten Years of Public-Key Cryptography Paper by: Whitfield Diffie Presentation by Taotao Zhao.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
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!
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.
The RSA Cryptosystem The methods of encryption that we have studied so far have been historical methods that are not very useful for today’s computer age.
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.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
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.
Digital Signatures.
CS480 Cryptography and Information Security
Vocabulary Big Data - “Big data is a broad term for datasets so large or complex that traditional data processing applications are inadequate.” Moore’s.
Public Key Encryption and Digital Signatures
(Tuesday, 20 October, 7:30-9PM) Encryption-Decryption
Some basic terminology
Modular Arithmetic and RSA Encryption
Elliptic Curve Cryptography (ECC)
Elliptic Curve Cryptography (ECC)
MSIT 543 Cryptography Concepts and Techniques How RSA Encryption Works
Discrete Math for CS CMPSC 360 LECTURE 14 Last time:
Presentation transcript:

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 B14 L-Z: Kimball B11 Cryptography: Encryption-Decryption using arrays (assignment 6)

CS100A, Lecture 13, 15 October 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 CS100A Lect. 13, 15 Oct 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 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 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 long integers: Public key (puk, m) Private key(prk, m) Examples: pukprk m 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 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 = 11 mod 5 = 1-4 mod 5 = 1 5 mod 5 = 00 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 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 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}