David Evans CS200: Computer Science University of Virginia Computer Science Lecture 12: Decrypting Work Circle Fractal.

Slides:



Advertisements
Similar presentations
Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa Spring 2006 David Evans Class 2: The Lorenz Cipher and the Postman’s Computer.
Advertisements

Class 21: Imperative Programming University of Virginia cs1120 David Evans.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 13: Of On and Off Grounds Sorting.
Cs1120 Fall 2009 David Evans Lecture 16: Power Analysis.
Cryptology Making & Breaking Codes & Ciphers. AJ 1152 Cryptology Cryptography –Science of creating codes or ciphers Cryptanalysis –Science of breaking.
CS 6262 Spring 02 - Lecture #7 (Tuesday, 1/29/2002) Introduction to Cryptography.

David Evans CS150: Computer Science University of Virginia Computer Science Lecture 18: The Story So Far.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 16: Quicker Sorting.
Modern Cryptography.
Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa Spring 2006 David Evans Class 4: Modern Cryptography
Introduction to Cryptography and Security Mechanisms: Unit 5 Theoretical v Practical Security Dr Keith Martin McCrea
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 14: Asymptotic Growth.
CSE331: Introduction to Networks and Security Lecture 17 Fall 2002.
Overview of Cryptography and Its Applications Dr. Monther Aldwairi New York Institute of Technology- Amman Campus INCS741: Cryptography.
What is Cryptography? Definition: The science or study of the techniques of secret writing, esp. code and cipher systems, methods, and the like Google.
Computer Security CS 426 Lecture 3
Chapter 2 – Classical Encryption Techniques
Cryptography Week-6.
EE5552 Network Security and Encryption block 4 Dr. T.J. Owens CEng MIET Dr T. Itagaki MIET, MIEEE, MAES.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
David Evans Class 12: Quickest Sorting CS150: Computer Science University of Virginia Computer Science Rose Bush by Jacintha.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
David Evans CS551: Security and Privacy University of Virginia Computer Science Lecture 2: Breaking Unbreakable Ciphers.
David Evans Class 13: Quicksort, Problems and Procedures CS150: Computer Science University of Virginia Computer Science.
13-1 Last time Security in Networks Network Security Controls Firewalls Honeypots Intrusion Detection Systems.
One-Time Pad Or Vernam Cipher Sayed Mahdi Mohammad Hasanzadeh Spring 2004.
David Evans CS200: Computer Science University of Virginia Computer Science Class 36: Public-Key Cryptography If you want.
Day 18. Concepts Plaintext: the original message Ciphertext: the transformed message Encryption: transformation of plaintext into ciphertext Decryption:
1 Chapter 2-1 Conventional Encryption Message Confidentiality.
13. BETTER SYMMETRIC CIPHER STREAM CIPHERS 1. SOME TRICKS FOR SUBSTITUTION CIPHER There are some tricks to make substitution cipher safer: Nulls: insert.
Network Security Lecture 11 Presented by: Dr. Munam Ali Shah.
National Institute of Science & Technology Cryptology and Its Applications Akshat Mathur [1] Cryptology and Its Applications Presented By AKSHAT MATHUR.
Network Security Lecture 10 Presented by: Dr. Munam Ali Shah.
CSCI 5857: Encoding and Encryption
Classical Crypto By: Luong-Sorin VA, IMIT Dith Nimol, IMIT.
Giuseppe Bianchi Warm-up example 1 found on a real paper! Warm-up example 1 found on a real paper!
Computer Security Cryptography. Cryptography Now and Before  In the past – mainly used for confidentiality  Today –Still used for confidentiality –Data.
David Evans CS551: Security and Privacy University of Virginia Computer Science Lecture 3: Striving for Confusion Structures.
David Evans Class 20: Quick Sorting CS200: Computer Science University of Virginia Computer Science Queen’s University,
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 12: Something about Sneezewort From.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 10: Puzzling Pegboards.
David Evans Class 21: The Story So Far (Quicksort, Continuing Golden Ages) CS200: Computer Science University of Virginia.
David Evans Lecture 13: Astrophysics and Cryptology CS200: Computer Science University of Virginia Computer Science.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 12: QuickSorting Queen’s University,
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 9: Of On and Off Grounds Sorting Coffee.
CS 150 – Computing: From Ada to the Web Cryptography.
The Enigma Machine Eric Roberts CS 106A February 3, 2016.
Lecture 3 Page 1 CS 236 Online Introduction to Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 14: P = NP?
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
David Evans CS200: Computer Science University of Virginia Computer Science Class 26: Halting Problem It is plain at any.
Chapter 2 Basic Encryption and Decryption
Lecture 13: Quicksorting CS200: Computer Science
Lecture 7: List Recursion CS200: Computer Science
Introduction Of System Security
Lecture 8: Recursion Practice CS200: Computer Science
Lecture 16: Quickest Sorting CS150: Computer Science
Lecture 11: All Sorts CS200: Computer Science University of Virginia
David Evans Lecture 9: The Great Lambda Tree of Infinite Knowledge and Ultimate Power CS200: Computer Science University.
Lecture 13: Cost of Sorts CS150: Computer Science
Lecture 22: P = NP? CS200: Computer Science University of Virginia
Lecture 10: Quicker Sorting CS150: Computer Science
Lecture 9: The Great Lambda Tree of Knowledge and Power
An electro-mechanical rotor cipher machine created by the German engineer Arthur Scherbius.
Lecture 15: Quicker Sorting CS150: Computer Science
Lecture 11: Sorting Grounds and Bubbles
Modern Cryptography.
Presentation transcript:

David Evans CS200: Computer Science University of Virginia Computer Science Lecture 12: Decrypting Work Circle Fractal by Ramsey Arnaoot and Qi Wang

12 February 2003CS 200 Spring Menu Measuring Work Faster (?) Sorting PS4: Cryptology

12 February 2003CS 200 Spring Sorting How much work is sort ? We measure work using orders of growth: How does work grow with problem size? (define (sort cf lst) (if (null? lst) lst (let ((most (find-most cf lst))) (cons most (sort cf (delete lst most)))))) (define (find-most cf lst) (insertl (lambda (c1 c2) (if (cf c1 c2) c1 c2)) lst (car lst)))

12 February 2003CS 200 Spring Why not just time it? Moore’s Law: computing power doubles every 18 months!

12 February 2003CS 200 Spring How much work is find-most? Work to evaluate (find-most f lst)? –Evaluate (insertl (lambda (c1 c2) …) lst) –Evaluate lst –Evaluate (car lst) (define (find-most cf lst) (insertl (lambda (c1 c2) (if (cf c1 c2) c1 c2)) lst (car lst))) These don’t depend on the length of the list, so we don’t care about them.

12 February 2003CS 200 Spring Work to evaluate insertl How many times do we evaluate f for a list of length n ? (define (insertl f lst stopval) (if (null? lst) stopval (f (car lst) (insertl f (cdr lst) stopval)))) n insertl is  ( n ) If we double the length of the list, we amount of work insertlg does approximately doubles.

12 February 2003CS 200 Spring Sorting How much work is it to sort? –How many times does sort evaluate find-most ? (define (sort cf lst) (if (null? lst) lst (let ((most (find-most cf lst))) (cons most (sort cf (delete lst most)))))) sort is  ( n 2 ) If we double the length of the list, we amount of work sort does approximately quadruples.

12 February 2003CS 200 Spring Timing Sort > (time (sort < (revintsto 100))) cpu time: 20 real time: 20 gc time: 0 > (time (sort < (revintsto 200))) cpu time: 80 real time: 80 gc time: 0 > (time (sort < (revintsto 400))) cpu time: 311 real time: 311 gc time: 0 > (time (sort < (revintsto 800))) cpu time: 1362 real time: 1362 gc time: 0 > (time (sort < (revintsto 1600))) cpu time: 6650 real time: 6650 gc time: 0

12 February 2003CS 200 Spring (n2)(n2) = n 2 /500 measured times

12 February 2003CS 200 Spring Is our sort good enough? Takes over 1 second to sort 1000-length list. How long would it take to sort 1 million items? (n2)(n2) 1s = time to sort s ~ time to sort M is 1000 * 1000 Sorting time is n 2 so, sorting 1000 times as many items will take times as long = 1 million seconds ~ 11 days Note: there are 800 Million VISA cards in circulation. It would take 20,000 years to process a VISA transaction at this rate.

12 February 2003CS 200 Spring Divide and Conquer sorting? Bubble sort: find the lowest in the list, add it to the front of the result of sorting the list after deleting the lowest Insertion sort: insert the first element of the list in the right place in the sorted rest of the list

12 February 2003CS 200 Spring insertsort (define (insertsort cf lst) (if (null? lst) null (insertel cf (car lst) (insertsort cf (cdr lst)))))

12 February 2003CS 200 Spring insertel (define (insertel cf el lst) (if (null? lst) (list el) (if (cf el (car lst)) (cons el lst) (cons (car lst) (insertel cf el (cdr lst))))))

12 February 2003CS 200 Spring How much work is insertsort? (define (insertsort cf lst) (if (null? lst) null (insertel cf (car lst) (insertsort cf (cdr lst))))) (define (insertel cf el lst) (if (null? lst) (list el) (if (cf el (car lst)) (cons el lst) (cons (car lst) (insertel cf el (cdr lst)))))) Worst case? Average case? insertel is  ( n ) How many times does insertsort evaluate insertel ? n times (once for each element) insertsort is  ( n 2 )

12 February 2003CS 200 Spring > (insertsort < (revintsto 20)) ( ) Requires 190 applications of < > (insertsort < (intsto 20)) ( ) Requires 19 applications of < > (insertsort < (rand-int-list 20)) ( ) Requires 104 applications of <

12 February 2003CS 200 Spring > (bubblesort < (intsto 20)) ( ) Requires 210 applications of < > (bubblesort < (rand-int-list 20)) ( ) Requires 210 applications of <

12 February 2003CS 200 Spring bubblesort vs. insertsort Both are  ( n 2 ) worst case (reverse list) Both are  ( n 2 ) average case (random) –But insert-sort is about twice as fast insertsort is  ( n ) best case (ordered list)

12 February 2003CS 200 Spring Can we do better? Think about this for next time Hint: think about the trees in SICP 2.2

12 February 2003CS 200 Spring Cryptology ( CS588 Condensed)

12 February 2003CS 200 Spring Terminology Encrypt Decrypt Plaintext Ciphertext Plaintext Alice Bob Eve Insecure Channel C = E(P) P = D(C) E must be invertible: P = D (E (P))

12 February 2003CS 200 Spring Encrypt Decrypt Plaintext Ciphertext Plaintext Alice Bob Insecure Channel C = E(P, K) P = D(C, K) KK “The enemy knows the system being used.” Claude Shannon Eve

12 February 2003CS 200 Spring Jefferson Wheel Cipher

12 February 2003CS 200 Spring Enigma About 50,000 used by Nazi’s in WWII Modified throughout WWII, believed to be perfectly secure Broken by Bletchley Park led by Alan Turing (and 30,000 others) First computer (Collossus) developed to break Nazi codes (but kept secret through 1970s) Allies used decrypted Enigma messages to plan D-Day

12 February 2003CS 200 Spring Bletchley Park

12 February 2003CS 200 Spring Lorenz Cipher Machine

12 February 2003CS 200 Spring Perfectly Secure Cipher: One-Time Pad Mauborgne/Vernam [1917] xor (  ): 0  0 = 0 1  0 = 1 0  1 = 1 1  1 = 0 a  a = 0 a  0 = a a  b  b = a E(P, K) = P  K D(C, K) = C  K = (P  K)  K = P

12 February 2003CS 200 Spring For any given ciphertext, all plaintexts are equally possible. Ciphertext: Key: Plaintext: = “CS” Why perfectly secure? 1 0 B

12 February 2003CS 200 Spring If its “perfect” why is it broken? Cannot reuse K Need to generate truly random bit sequence as long as all messages Need to securely distribute key

12 February 2003CS 200 Spring “One-Time” Pad’s in Practice Lorenz Machine – Nazi high command in WWII –Pad generated by 12 rotors –Receiver and sender set up rotors in same positions –One operator retransmitted a message (but abbreviated message header the second time!) –Enough for Bletchley Park to figure out key – and structure of machine that generated it! –But still had to try all configurations

12 February 2003CS 200 Spring Colossus – First Programmable Computer Bletchley Park, 1944 Read ciphertext and Lorenz wheel patterns from tapes Tried each alignment, calculated correlation with German Decoded messages (63M letters by 10 Colossus machines) that enabled Allies to know German troop locations to plan D-Day Destroyed in 1960, kept secret until 1970s

12 February 2003CS 200 Spring From

12 February 2003CS 200 Spring Problem Set 4 Break a simplified Lorenz Cipher Removed one wheel, made initial positions of all groups of wheels have to match Small rotors Its REALLY AMAZING that the British were able to break the real Lorenz in 1943 and it is still hard for us today!

12 February 2003CS 200 Spring Motivation Helps… Confronted with the prospect of defeat, the Allied cryptanalysts had worked night and day to penetrate German ciphers. It would appear that fear was the main driving force, and that adversity is one of the foundations of successful codebreaking. Simon Singh, The Code Book

12 February 2003CS 200 Spring Modern Ciphers 128-bit keys, encrypt 128-bit blocks Brute force attack –Try 1 Trillion keys per second –Would take years to try all keys! –If that’s not enough, can use 256-bit key No known techniques that do better than brute force search

12 February 2003CS 200 Spring Charge PS4: Cryptology –No new Computer Science concepts –Lots of practice with lists and recursion Think about faster ways of sorting Read Tyson’s essay (before Friday) –How does it relate to  (n 2 ) –How does it relate to grade inflation –Don’t misinterpret it as telling you to run out and get tatoos and piercings!