Encryption. Secure Chat. Encryption Machine

Similar documents
Computer Science 126. Prologue: A Simple Machine. General Computer Science Fall Robert Sedgewick

Stream Cipher. Block cipher as stream cipher LFSR stream cipher RC4 General remarks. Stream cipher

LFSR stream cipher RC4. Stream cipher. Stream Cipher

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl. Chapter 2 Stream Ciphers ver.

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl. Chapter 2 Stream Ciphers ver.

An Introduction to Cryptography

V.Sorge/E.Ritter, Handout 5

Design for Test. Design for test (DFT) refers to those design techniques that make test generation and test application cost-effective.

New Address Shift Linear Feedback Shift Register Generator

21.1. Unit 21. Hardware Acceleration

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Cryptography CS 555. Topic 5: Pseudorandomness and Stream Ciphers. CS555 Spring 2012/Topic 5 1

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

How to Predict the Output of a Hardware Random Number Generator

True Random Number Generation with Logic Gates Only

CSc 466/566. Computer Security. 4 : Cryptography Introduction

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Sequential Logic. Introduction to Computer Yung-Yu Chuang

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

Enigma. Developed and patented (in 1918) by Arthur Scherbius Many variations on basic design Eventually adopted by Germany

Stream Ciphers. Debdeep Mukhopadhyay

Chapter 1: Data Storage. Copyright 2015 Pearson Education, Inc.

LFSR Counter Implementation in CMOS VLSI

VLSI System Testing. BIST Motivation

8/30/2010. Chapter 1: Data Storage. Bits and Bit Patterns. Boolean Operations. Gates. The Boolean operations AND, OR, and XOR (exclusive or)

CSE 352 Laboratory Assignment 3

Attacking of Stream Cipher Systems Using a Genetic Algorithm

Segmented Leap-Ahead LFSR Architecture for Uniform Random Number Generator

WINTER 15 EXAMINATION Model Answer

6.3 Sequential Circuits (plus a few Combinational)

CMOS Testing-2. Design for testability (DFT) Design and Test Flow: Old View Test was merely an afterthought. Specification. Design errors.

Available online at ScienceDirect. Procedia Technology 24 (2016 )

Sequences and Cryptography

Unit V Design for Testability

SECURED EEG DISTRIBUTION IN TELEMEDICINE USING ENCRYPTION MECHANISM

Chapter 3. Boolean Algebra and Digital Logic

TYPICAL QUESTIONS & ANSWERS

Logic Design II (17.342) Spring Lecture Outline

(12) Patent Application Publication (10) Pub. No.: US 2003/ A1

NON-BREAKABLE DATA ENCRYPTION WITH CLASSICAL INFORMATION

Randomness analysis of A5/1 Stream Cipher for secure mobile communication

Optimization of FPGA Architecture for Uniform Random Number Generator Using LUT-SR Family

Exploring the Enigma [The MATH Connection]

Scanned by CamScanner

Data Storage and Manipulation

CS 61C: Great Ideas in Computer Architecture

ISSN (Print) Original Research Article. Coimbatore, Tamil Nadu, India

Comparative Analysis of Stein s. and Euclid s Algorithm with BIST for GCD Computations. 1. Introduction

Exercise 4. Data Scrambling and Descrambling EXERCISE OBJECTIVE DISCUSSION OUTLINE DISCUSSION. The purpose of data scrambling and descrambling

Advanced Digital Logic Design EECS 303

Jin-Fu Li Advanced Reliable Systems (ARES) Laboratory. National Central University

Design and Implementation of Data Scrambler & Descrambler System Using VHDL

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

UPDATE TO DOWNSTREAM FREQUENCY INTERLEAVING AND DE-INTERLEAVING FOR OFDM. Presenter: Rich Prodan

ECE 331 Digital System Design

ECE 301 Digital Electronics

Lecture 7: Sequential Networks

Available online at ScienceDirect. Procedia Computer Science 46 (2015 ) Aida S Tharakan a *, Binu K Mathew b

Sequential Circuit W CLK. CMSC 2833 Lecture 42. Steps:

A Pseudorandom Binary Generator Based on Chaotic Linear Feedback Shift Register

Modified Version of Playfair Cipher Using Linear Feedback Shift Register and Transpose Matrix Concept

Data Representation. signals can vary continuously across an infinite range of values e.g., frequencies on an old-fashioned radio with a dial

Evaluation of Fibonacci Test Pattern Generator for Cost Effective IC Testing

COMP2611: Computer Organization. Introduction to Digital Logic

MATHEMATICAL APPROACH FOR RECOVERING ENCRYPTION KEY OF STREAM CIPHER SYSTEM

Lab 2 Part 1 assigned for lab sessions this week

WINTER 14 EXAMINATION

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

Synthesis Techniques for Pseudo-Random Built-In Self-Test Based on the LFSR

Assistant Professor, Electronics and Telecommunication Engineering, DMIETR, Wardha, Maharashtra, India

UNIT IV CMOS TESTING. EC2354_Unit IV 1

Testing Digital Systems II

Implementation of BIST Test Generation Scheme based on Single and Programmable Twisted Ring Counters

Lecture 8: Cracking the Codes based on Tony Sale s Codes & Ciphers Web Page. History of Computing. Today s Topics. History of Computing Cipher Systems

EECS 270 Midterm Exam Spring 2011

CHAPTER1: Digital Logic Circuits

VLSI Test Technology and Reliability (ET4076)

Time Domain Simulations

Performance Evaluation of Stream Ciphers on Large Databases

Computer Architecture and Organization

Lecture 17: Introduction to Design For Testability (DFT) & Manufacturing Test

ECE 715 System on Chip Design and Test. Lecture 22

Digital Integrated Circuits Lecture 19: Design for Testability

Analysis of Different Pseudo Noise Sequences

Further Details Contact: A. Vinay , , #301, 303 & 304,3rdFloor, AVR Buildings, Opp to SV Music College, Balaji

TEST-3 (DIGITAL ELECTRONICS)-(EECTRONIC)

Chapter 4. Logic Design

Unit 8: Testability. Prof. Roopa Kulkarni, GIT, Belgaum. 29

I B.SC (INFORMATION TECHNOLOGY) [ ] Semester II CORE : DIGITAL COMPUTER FUNDAMENTALS - 212B Multiple Choice Questions.

DesignandImplementationofDataScramblerDescramblerSystemusingVHDL

Cryptanalysis of the Bluetooth E 0 Cipher using OBDD s

2e 23-1 Peta Bits Per Second (Pbps) PRBS HDL Design for Ultra High Speed Applications/Products

Cryptagram. Photo Privacy for Online Social Media Matt Tierney, Ian Spiro Christoph Bregler, Lakshmi Subramanian

SEQUENTIAL CIRCUITS SEQUENTIAL CIRCUITS

Design of Fault Coverage Test Pattern Generator Using LFSR

DESIGN OF RECONFIGURABLE IMAGE ENCRYPTION PROCESSOR USING 2-D CELLULAR AUTOMATA GENERATOR

FPGA IMPLEMENTATION AN ALGORITHM TO ESTIMATE THE PROXIMITY OF A MOVING TARGET

a) (A+B) (C+D) b) AB+CD c) AC+BD d) (A+D) (B+C)

SRAM Based Random Number Generator For Non-Repeating Pattern Generation

Transcription:

Encryption Introduction to Programming in Java: An Interdisciplinary Approach Robert Sedgewick and Kevin Wayne Copy right 2002 2010 19 Feb 2012 19:24:23 Secure Chat Encryption Machine Alice wants to send a secret to Bob? Sometime in the past, they exchange a one-time pad. Alice uses the pad to encrypt the. Bob uses the same pad to decrypt the. Goal. Design a machine to encrypt and decrypt data. encrypt decrypt Encrypt SENDMONEY with yt25a5y/s Decrypt gx76w3v7k with yt25a5y/s Key point. Without the pad, Eve cannot understand the. 5 6 1

Encryption Machine A Digital World Goal. Design a machine to encrypt and decrypt data. encrypt decrypt Data is a sequence of bits. [bit = 0 or 1] Text. Programs, executables. Documents, pictures, sounds, movies, File formats. txt, pdf, java, exe, docx, pptx, jpeg, mp3, divx, Enigma encryption machine. "Unbreakable" German code during WWII. Broken by Turing bombe. One of first uses of computers. Helped win Battle of Atlantic by locating U-boats. a lens earbuds a radio 7 8 A Digital World Data is a sequence of bits. [bit = 0 or 1] Text. Programs, executables. Documents, pictures, sounds, movies, File formats. txt, pdf, java, exe, docx, pptx, jpeg, mp3, divx, a cash dispenser a ballot box a heating element Copyright 2004, Sidney Harris, http://www.sciencecartoonsplus.com 9 10 A Digital World Data is a sequence of bits. [bit = 0 or 1] Text. Programs, executables. Documents, pictures, sounds, movies, Base64 encoding. Use 6 bits to represent each alphanumeric symbol. One-Time Pad Encryption M 12 00110 0 very weak type of encryption 11 12 2

One-Time Pad Encryption One-Time Pad Encryption Generate N (one-time pad). Generate N (one-time pad). sum corresponding pair of bits: 1 if sum is odd, 0 if even Truth Table x y x ^ y 0 0 0 0 1 1 1 0 1 1 1 0 0 ^ 1 = 1 13 14 One-Time Pad Encryption Secure Chat (review) Generate N (one-time pad). Convert binary back into text. w 22 01011 0 Alice wants to send a secret to Bob? Sometime in the past, they exchange a one-time pad. Alice uses the pad to encrypt the. Bob uses the same pad to decrypt the. Encrypt SENDMONEY with yt25a5y/s Decrypt gx76w3v7k with yt25a5y/s Key point. Without the pad, Eve cannot understand the. 15 16 Convert to binary. Convert to binary. W 22 01011 0 17 18 3

Convert to binary. Use same N (one-time pad). Convert to binary. Use same N (one-time pad). Truth Table x y x ^ y 0 0 0 0 1 1 1 0 1 1 1 0 1 ^ 1 = 0 19 20 Why Does It Work? Convert to binary. Use same N (one-time pad). Convert back into text. M 12 00110 0 Crucial property. Decrypted = original. Notation Meaning a original bit b one-time pad bit ^ operator a ^ b bit (a ^ b) ^ b decrypted bit Why is crucial property true? Use properties of. (a ^ b) ^ b = a ^ (b ^ b) = a ^ 0 = a associativity of ^ always 0 identity Truth Table x y x ^ y 0 0 0 0 1 1 1 0 1 1 1 0 21 22 (with the wrong pad) (with the wrong pad) Convert to binary. Convert to binary. 23 24 4

(with the wrong pad) (with the wrong pad) Convert to binary. Use wrong N bits (bogus one-time pad). Convert to binary. Use wrong N bits (bogus one-time pad). 10100 0 01110 0 11010 1 10111 1 01001 0 11100 1 10010 1 10101 0 00101 0 wrong bits 10100 0 01110 0 11010 1 10111 1 01001 0 11100 1 10010 1 10101 0 00101 0 wrong bits 00100 0 00101 1 00111 0 01010 1 00010 0 00111 0 00101 0 01000 1 00000 0 25 26 (with the wrong pad) Convert to binary. Use wrong N bits (bogus one-time pad). Convert back into text: Oops. 10100 0 01110 0 11010 1 10111 1 01001 0 11100 1 10010 1 10101 0 00101 0 00100 0 00101 1 00111 0 01010 1 00010 0 00111 0 00101 0 01000 1 00000 0 wrong bits I L O V E O K R A wrong 27 28 Goods and Bads of One-Time Pads Pseudo-Random Bit Generator Good. Easily computed by hand. Very simple encryption/decryption processes. Provably unbreakable if bits are truly random. [Shannon, 1940s] eavesdropper Eve sees only "one time" means one time only Bad. Easily breakable if pad is re-used. Pad must be as long as the. Truly are very hard to come by. Pad must be distributed securely. impractical for Web commerce Practical middle-ground. Let s make a "random"-bit generator gadget. Alice and Bob each get identical small gadgets. How to make small gadget that produces "random" bits. Enigma machine. Linear feedback shift register. Linear congruential generator. Blum-Blum-Shub generator. Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. Jon von Neumann (left) ENIAC (right) instead of identical large one-time pads a Russian one-time pad 29 30 5

Shift Register Linear Feedback Shift Register (LFSR) Shift register terminology. Bit: 0 or 1. Cell: storage element that holds one bit. Register: sequence of cells. Seed: initial sequence of bits. Shift register: when clock ticks, bits propagate one position to left. {8, 10} linear feedback shift register. Shift register with 11 cells. Bit b0 is is of previous bits b8 and b10. Pseudo-random bit = b0. feedback xor ^ LFSR demo 0 1 1 0 1 0 0 0 0 1 0 time t b 10 b 9 b 8 b 7 b 6 b 5 b 4 b 3 b 2 b 1 b 0 time t 1 1 0 1 0 0 0 0 1 0? time t + 1 b 9 b 8 b 7 b 6 b 5 b 4 b 3 b 2 b 1 b 0 b8^b10 time t + 1 register 31 32 Random Numbers Q. Are these 2000 numbers random? If not, what is the pattern? 110010010011110110111001011010111001100010111111010010000100110100101111001100100111111 101110000010101100010000111010100110100001111001001100111011111110101000001000010001010 010101000110000010111100010010011010110111100011010011011100111101011110010001001110101 011101000001010010001000110101010111000000010110000010011100010111011010010101100110000 111111100110000011111100011000011011110011101001111010011100100111011101110101010101000 000000010000000010100000010001000010101010010000000110100000111001000110111010111010100 010100001010001001000101011010100001100001001111001011100111001011110111001001010111011 000010101110010000101110100100101001101100011110111011001010101111000000100110000101111 100100100011101101011010110001100011101111011010100101100001100111001111110111100001010 011001000111111010110000100011100101011011100001101011001110001111101101100010110111010 011010100111100001110011001101111111110100000001001000001011010001001100101011111100001 000011001010011111000111000110110110111011011010101101100000110111000111010110110100011 011001011101111001010100111000001110110001101011101110001010101101000000110010000111110 100110001001111101011100010001011010101001100000011111000011000110011110111111001010000 111000100110110101111011000100101110101100101000111100010110011010011111100111000011110 110011001011111111001000000111010000110100100111001101110111110101010001000000101010000 100000100101000101100010100111010001110100101101001100110011111111111000000000110000000 111100000110011000111111110110000001011100001001011001011001111001111100111100011110011 011001111101111100010100011010001011100101001011100011001011011111001101000111110010110 001110011101101111010110100100011001101011111110001000001101010001110000101101100100110 111101111010010100100110001101111101110100010101001010000011000100011110101011001000001 111010001100100101111101100100010111101010010010000110110100111011001110101111101000100 01001010101011000000001110000001101100001110111001101010111110000010001100010101111010 LFSR Encryption LFSR encryption. Initialize LFSR with small seed. Generate N bits with LFSR. Convert binary back into text. w 22 01011 0 LFSR bits A. No. This is output of {8, 10} LFSR with seed 01101000010! 33 34 LFSR Decryption LFSR Convert to N bits. Initialize identical LFSR with same seed. Generate N bits with LFSR. Convert binary back into text. M 12 00110 0 Goods. Goods and Bads of LFSR Encryption Easily computed with simple machine. Very simple encryption/decryption process. Scalable: 20 cells for 1 million bits; 30 cells for 1 billion bits. [ but need theory of finite groups to know where to put taps ] LFSR bits Bads. a commercially available LFSR Still need secure, independent way to distribute LFSR seed. The bits are not truly random. [ bits in our 11-bit LFSR cycle after 2 11-1 = 2047 steps ] Experts have cracked LFSR. [ more complicated machines needed ] 35 36 6

Other LFSR Applications A Closing Profound Question What else can we do with a LFSR? DVD encryption with CSS. DVD decryption with DeCSS! Subroutine in military cryptosystems. DVD Jon (Norwegian hacker) Q. What is a random number? LFSR does not produce random numbers. It is a very simple deterministic machine. But not obvious how to distinguish the bits it produces from random. /* efd tt. c Aut hor : Cha rle s M. H ann um <ro ot@ iha ck. net > * / /* Usa ge is: at tit le- key sc ram ble d.v ob e fdt t > cle ar. vob */ c #def ine m( i)( x[i ]^s [i+ 84] )<< uns ign ed cha r x [5],y, s[2 048 ];m ain ( n){ for ( r ead (0, x,5 ) ;re ad( 0,s,n =20 48 ); wri te( 1,s,n) )if (s [ y=s [13 ]%8 +20 ] /16 %4 == 1 ){ int i =m( 1)1 7 ^25 6 + m(0 ) 8, k =m (2) 0,j= m(4 ) 17 ^ m (3) 9^k * 2-k %8 ^ 8,a 0,c =2 6;f or ( s[y ] =16 ; = - -- c;j =2) a= a* 2^i & 1,i= i / 2^j &1 * << 24; for (j= 1 27; + +j< n;c =c> y ) c Q. Are truly random processes found in nature? Motion of cosmic rays or subatomic particles? Mutations in DNA? Q. Or, is the natural world a (not-so-simple) deterministic machine? +=y= i^i /8^ i>> 4^i >>1 2, i =i> >8^ y<< 17, a^= a>> 14, y=a ^a* 8^a <<6,a= a >>8 ^y< <9, k=s [j],k = "7W o~' G_\ 216 "[k &7 ]+2 ^"c r3s fw6 v;* k+> /n. "[k >>4 ]*2 ^k* 257 / 8, s[j ]=k ^(k &k* 2&3 4)* 6^c +~y ;}} God does not play dice. Albert Einstein http://www.cs.cm u.edu/~dst/ DeCSS/Galle ry 37 40 Linear Feedback Shift Register Extra Slides exclusive or of bits 8 and 10 ^ 10 9 8 7 6 5 4 3 2 1 0 0 1 1 0 1 0 0 0 0 1 0 initial seed 1 1 0 1 0 0 0 0 1 0 1 after one step One step of an 11-bit LFSR with initial seed 0110100001 0 and tap at position 8 Introduction to Programming in Java: An Interdisciplinary Approach Robert Sedgewick and Kevin Wayne Copy right 2008 * * 41 42 7