Hiding Data in Images: Steganography Part 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Hiding Data in Images

Steganography Part 1
Steganography to Explore Coding
• Steganography is the hiding of data in an
image or other digital artifact
• Originally not digital, invisible ink, wax tablets
• Hiding text requires more math than images

Usain Bold by Nick Webb/CC-by-2.0


Coding Challenge for You
• You will be able to find hidden meaning in
the universe!
• You’ll see code to hide one image in another
• Challenge: write code to extract hidden image
How to Hide Data in Pixels?
• Pixels have Red, Green, Blue components
• Each is a value between 0-255
How to Hide Data in Pixels?
• Pixels have Red, Green, Blue components
• Each is a value between 0-255
• Is there a big difference between 240 and 255?
• Half a pixel for hiding
One Shade of Red Another Shade
• We’ll do math!
• Explain Decimal
• Use binary/hex

#F00000 #FF0000
rgb(240, 0, 0) rgb(255, 0, 0)
First Decimal
Hide This In This
R = 8274 R = 3568
G = 0000 G = 5686
B = 1098 B = 7450

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Hide This In This Result
R = 8274 R = 3568 R = 35
G = 0000 G = 5686 G=
B = 1098 B = 7450 B=

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Hide This In This Result
R = 8274 R = 3568 R = 3582
G = 0000 G = 5686 G=
B = 1098 B = 7450 B=

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Hide This In This Result
R = 8274 R = 3568 R = 35 82
G = 0000 G = 5686 G = 56
B = 1098 B = 7450 B=

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Hide This In This Result
R = 8274 R = 3568 R = 35 82
G = 0000 G = 5686 G = 56 00
B = 1098 B = 7450 B=

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Hide This In This Result
R = 8274 R = 3568 R = 35 82
G = 0000 G = 5686 G = 56 00
B = 1098 B = 7450 B = 74 10

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Hide This In This Result
R = 8274 R = 3568 R = 35 82
G = 0000 G = 5686 G = 5600
B = 1098 B = 7450 B = 74 10

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Extracted Result
R= R = 35 82
G= G = 56 00
B= B = 74 10

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Extracted Result
R = 82 R = 35 82
G= G = 56 00
B= B = 74 10

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Extracted Result
R = 8200 R = 35 82
G= G = 56 00
B= B = 74 10

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Extracted Result
R = 82 00 R = 35 82
G = 00 00 G = 56 00
B = 10 00 B = 74 10

• Suppose colors went 0 to 9999


• 4 decimal digits
First Decimal
Original Extracted Result
R = 8274 R = 82 00 R = 35 82
G = 0000 G = 00 00 G = 56 00
B = 1098 B = 10 00 B = 74 10

• Suppose colors went 0 to 9999


• 4 decimal digits
Steganography High Level
• Big idea: Hide information in image
• Your goal: one image in another
• Minor numerical change: look same
• Need to do in binary, not decimal
• 0 to 255, not 0 to 9999

You might also like