20
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Embed Size (px)

Citation preview

Page 1: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Lawrence SnyderUniversity of Washington, Seattle

© Lawrence Snyder 2004

Computing Is Pretty Strange

Page 2: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Encryption is the process of “scrambling” data so it is difficult (impossible?) to understand it

We encrypt data to keep it private Every site that you use as https:// is encrypted Familiar example: Caesar cipher:

C: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

E: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

What would Julius be encrypted to?

04/21/23 © 2011 Larry Snyder, CSE 2

Page 3: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Encryption is the process of “scrambling” data so it is difficult (impossible?) to understand it

We encrypt data to keep it private Every site that you use as https:// is encrypted Familiar example: Caesar cipher:

C: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

E: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

What would Julius be encrypted to? Mxolxv

04/21/23 © 2011 Larry Snyder, CSE 3

Page 4: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

The fixed shift of an alphabet is easy to break

Alternate: Sender uses a key, k, to multiply

clear byte sequences (recall they’re numbers) by k

-- Send encrypted result – looks like gibberish --

Receiver divides by k to decrypt getting clear

04/21/23 © 2011 Larry Snyder, CSE 4

Page 5: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

04/21/23 © 2011 Larry Snyder, CSE 5

776913=100997698413=090792326413=042432325713=042341

Page 6: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

The problem with “private key” encryption: the two sides have to meet to agree on key

Public Key fixes this: The receiver publishes (on Web site, say) a (very very special) key, K

More importantly, the theory it uses means that NO practical amount of computing can break the code

Here’s what you do …

04/21/23 © 2011 Larry Snyder, CSE 6

Page 7: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Sender breaks up the message into blocks as before

Sender cubes each block – yup, raises to the 3rd power – and mods it by K, i.e. (<text>3)%K

Transmit results Receiver raises each remainder to a high power

determined by prime numbers & known only to him

Receiver mods by K, too, which are – surprisingly – the original blocks! The receiver assembles the message Thanks to Euler and Diffie & Hellman

04/21/23 © 2011 Larry Snyder, CSE 7

This Is Amazing!!!This Is Amazing!!!

Page 8: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

The process of hiding informationTwo Greek roots meaning:

“stego” == “roof” “stega” == “cover”

04/21/23 © 2011 Larry Snyder, CSE 8

Page 9: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Most common reason to hide information is to avoid being caught with it Military and spy documents Repressive governments restricting

news/info Avoid others “snooping” – privacy

Hiding is different than encryption … uses the fact that the searcher doesn’t know it’s there

04/21/23 © 2011 Larry Snyder, CSE 9

Page 10: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

The Plan … hide “subversive” protest picture in

“calendar art”

04/21/23 © 2011 Larry Snyder, CSE 10

Guest Image

Host Image

Page 11: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

We don’t need all of the bits in RGB to get a decent picture

04/21/23 © 2011 Larry Snyder, CSE 11

1011 0100 1101 0011 0001 1100 1011 0100 1101 0011 0001 1100

All bits Left 2 bits of each color

Page 12: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Put guest bits into right 2 bits of host

04/21/23 © 2011 Larry Snyder, CSE 12

1111 0100 1101 0011 1011 1101 1011 0100 1101 0011 0001 1100

1111 0110 1101 0011 1011 1100

Page 13: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

04/21/23 © 2011 Larry Snyder, CSE 13

fog.jpg

stegFog.png

Really?Just Do It!

Really?Just Do It!

Page 14: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

… and then we’ll see the details

04/21/23 © 2011 Larry Snyder, CSE 14

Page 15: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

04/21/23 © 2011 Larry Snyder, CSE 15

Encoding Code

Code To Save Result on Click

Page 16: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

After the pictures are loaded

Clear right 2 bits of hostExtract left 2

bits of guestNew combined color

04/21/23 © 2011 Larry Snyder, CSE 16

Page 17: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

04/21/23 © 2011 Larry Snyder, CSE 17

Page 18: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Read in the file, and then on mouse click, pull out the bits and make a picture

Remove right 2 bits

Make them left 2 bits for each color

New color

04/21/23 © 2011 Larry Snyder, CSE 18

Page 19: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

Run A Test … www.tineye.com

04/21/23 © 2011 Larry Snyder, CSE 19

The OriginalThe Original

Page 20: Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Computing Is Pretty Strange

04/21/23 © 2011 Larry Snyder, CSE 20

Steganized Steganized