image cryptography and steganography
TRANSCRIPT
ImageCryptography &Steganography
Master :Dr. Ghaderi
Mohammad Amin Amjadi
Winter 2015
2
Main PaperEncrypted image-based reversible data hiding with public key cryptography from difference expansionChih-Wei Shiu , Yu-Chi Chen , Wien Hong
2015 Elsevier B.V. All rights reserved
3
Content
a) Prefaceb) EIRDH-Pc) new EIRDH-P
4
ImagePreface -> Image
Image : a Matrix of Pixels
5
PixelPreface -> Image -> Pixel
+
+
=
RedProperty (8 bit)
24 bit Image
GreenProperty (8 bit)
BlueProperty (8 bit)
B G RLSB MSB LSB MSB LSB MSB0000 0000 0000 0000 0000 0000
Pixel : 24 bit
LSB : Least significant bitMSB : Most significant bit
RGB Mode
6
Cryptography
Goal : Security
Terms :1) Cryptography2) Encrypt3) Decrypt4) Public key Cryptography
7
Cryptography
Sender : Encrypt Message Receiver : Decrypt EMessage
Preface -> Cryptography -> base scenario
SenderEncryptMessage EMessage Receiver
DecryptEMessage Message
8
Cryptography
1. Change Location (reordering) 2. Mapping
Preface -> Cryptography -> base Algorithms
2 14 3
3 41 2
2 14 3
F(2)
F(1)
F(4) F(3)
9
Cryptography
1. Symmetric-Key Cryptographysender and receiver using same keykey is secret
2. Public-Key Cryptographyanyone can access to the public keyonly receiver has the Private Key
Preface -> Cryptography -> Category
10
Steganography
Goal : Hide Message/Data
Terms :1) DH : Data Hiding2) RDH : Reversible Data
Hiding
11
Steganography
use Cover Image / Hide Message / Extract Message Sender : Hide Message inside Cover Image Receiver : Extract secret Message
Preface -> Steganography -> base scenario
SenderCover Image Cover Image(Message)Message
ReceiverCover Image(Message) Cover Image
Message
12
Steganography
LSBImage quality of Cover Image
Preface -> Steganography -> base Algorithms
B G RLSB MSB LSB MSB LSB MSB0000 0000 0000 0000 0000 0000
B G RLSB MSB LSB MSB LSB MSB0000 0000 0000 0000 0000 0000
3bit of Data in any pixel of Cover Image 8bit of Data in any pixel of Cover Image
13
Cryptography & SteganographyPreface -> compare Cryptography and Steganography
Encryption
Decryption
14
Cryptography & SteganographyPreface -> compare Cryptography and Steganography
Cover Image (512 x 512)94 KB
LSB AlgorithmUsing Jpeg Format
Message (450 x 321)20 KB
Stego (512 x 512)37.6 KB
15
EIRDH-P
Combine Cryptography & Steganography
Terms :1) EIRDH : encrypted image-
based reversible data hiding 2) EIRDH-P : encrypted image-
based reversible data hiding (EIRDH) with public key cryptography
3) Image Provider4) Hider
16
EIRDH-P
1. the receiver initially sets his public / secret key pair (pk , sk)
EIRDH-P -> Schematic and Scenario -> KeyGen
ReceiverR
Data HiderH
Image ProviderP
sk
pk
pk
Send
er
Send
17
EIRDH-P
2. the Image Provider picks a cover-image CI , and then uses pk and CI to generate the encrypted image EI , sends it to the hider
EIRDH-P -> Schematic and Scenario -> Image Enc
ReceiverR
Data HiderH
Image ProviderP
sk
pk
pk
Send
er
CI EIEncSe
nd
EI
18
EIRDH-P
3. the Data Hider takes a message M and pk to generate the secret message SM
EIRDH-P -> Schematic and Scenario -> Message Enc
ReceiverR
Data HiderH
Image ProviderP
sk
pk
pk
Send
er
CI EI
EI
EncSe
nd
M pk Enc S
M
19
EIRDH-P
4. the Data Hider takes SM and EI to generate the encrypted image with the embedded message, EIM
EIRDH-P -> Schematic and Scenario -> Embedding
ReceiverR
Data HiderH
Image ProviderP
sk
pk
pk
Send
er
CI EIEncSe
nd
EI
M pk Enc S
M
Hid EIM
20
EIRDH-P
5. The receiver uses EIM and sk to recover the stego-image SI
EIRDH-P -> Schematic and Scenario -> Image Dec
ReceiverR
Data HiderH
Image ProviderP
sk
pk
pk
Send
er
CI EIEncSe
nd
EI
M pk Enc S
M
Hid EIM
EIM Dec SI
Send
21
EIRDH-P
6. The receiver uses SI to recover CI’ and obtain SM’
EIRDH-P -> Schematic and Scenario -> Extracting
ReceiverR
Data HiderH
Image ProviderP
sk
pk
pk
Send
er
CI EIEncSe
nd
EI
M pk Enc S
M
Hid EIM
EIM Dec SI
ExtSM’CI’Send
22
EIRDH-P
7. The receiver obtains the pure message M’ by using sk to decrypt SM’
EIRDH-P -> Schematic and Scenario -> Message Dec
ReceiverR
Data HiderH
Image ProviderP
sk
pk
pk
Send
er
CI EIEncSe
nd
EI
M pk Enc S
M
Hid EIM
EIM Dec SI
ExtSM’CI’
Dec M’
Send
23
EIRDH-PEIRDH-P -> Encryption Algorithm
Public key
Diffie-Hellma
nRSAPaillier
Terms :1) gcd : Greatest common divisor2) lcm : Least common multiple
24
EIRDH-P
1. Choose two distinct prime numbers p and qp != qp , q : Big
EIRDH-P -> Encryption Algorithm -> RSA -> KeyGen
1. p = 61 , q = 53
25
EIRDH-P
2. Compute n = pq
EIRDH-P -> Encryption Algorithm -> RSA -> KeyGen
1. p = 61 , q = 532. n = 61 x 53 = 3233
26
EIRDH-P
3. Compute φ(n) = φ(p)φ(q) = (p − 1)(q − 1) = n - (p + q -1) , where φ is Euler's totient function
EIRDH-P -> Encryption Algorithm -> RSA -> KeyGen
1. p = 61 , q = 532. n = 61 x 53 = 32333. φ(n) = (61 − 1)(53 − 1) = 3120
27
EIRDH-P
4. Choose an integer e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1e is a prim Number on {1 to φ(n) }
EIRDH-P -> Encryption Algorithm -> RSA -> KeyGen
1. p = 61 , q = 532. n = 61 x 53 = 32333. φ(n) = (61 − 1)(53 − 1) = 31204. e = 17
28
EIRDH-P
5. Determine d as d ≡ e−1 (mod φ(n))d⋅e ≡ 1 (mod φ(n))
d.e = 1 + k.φ(n)
EIRDH-P -> Encryption Algorithm -> RSA -> KeyGen
1. p = 61 , q = 532. n = 61 x 53 = 32333. φ(n) = (61 − 1)(53 − 1) = 31204. e = 175. d = 2753 17 x
2753 mod 3120 = 1
29
EIRDH-P
6. public key : ( n , e )
EIRDH-P -> Encryption Algorithm -> RSA -> KeyGen
1. p = 61 , q = 532. n = 61 x 53 = 32333. φ(n) = (61 − 1)(53 − 1) = 31204. e = 175. d = 2753 17 x
2753 mod 3120 = 16. public key : ( n , e ) = ( 3233 , 17 )
30
EIRDH-P
7. private key a) ( n , d )b) ( p , q ) , d mod (q-1) , d mod (p-1) , q-1 mod (p)
EIRDH-P -> Encryption Algorithm -> RSA -> KeyGen
1. p = 61 , q = 532. n = 61 x 53 = 32333. φ(n) = (61 − 1)(53 − 1) = 31204. e = 175. d = 2753 17 x
2753 mod 3120 = 16. public key : ( n , e ) = ( 3233 , 17 )7. private key : ( n , d ) = ( 3233 , 2753 )
31
EIRDH-P
8. Encryptionm (Message) such that 0 ≤ m < n and gcd(m, n) = 1c : ciphertext
EIRDH-P -> Encryption Algorithm -> RSA -> Encryption
1. p = 61 , q = 532. n = 61 x 53 = 32333. φ(n) = (61 − 1)(53 − 1) = 31204. e = 175. d = 2753 17 x
2753 mod 3120 = 16. public key : ( n , e ) = ( 3233 , 17 )7. private key : ( n , d ) = ( 3233 , 2753 )8. c(m)
32
EIRDH-P
9. Decryption
EIRDH-P -> Encryption Algorithm -> RSA -> Decryption
1. p = 61 , q = 532. n = 61 x 53 = 32333. φ(n) = (61 − 1)(53 − 1) = 31204. e = 175. d = 2753 17 x
2753 mod 3120 = 16. public key : ( n , e ) = ( 3233 , 17 )7. private key : ( n , d ) = ( 3233 , 2753 )8. c(m) 9. m(c)
33
EIRDH-P
1. Choose two large prime numbers p and q randomly2. Compute n = pq , 3. Select random integer g where 4. ; where 5. ( N , g ) is public key6. ( p , q , ) is private key7. where r is random such that
EIRDH-P -> Encryption Algorithm -> Paillier
34
new EIRDH-P
each pixel is divided into two parts : an even integer and a bit, where the summation of them is equal to the pixel value
any pixel = x + y + bit(x , y )is an even integer , x > y
[[m]] = c(m) = ciphertext of m [[m1]] [[m2]] = [[ m1 + m2 ]]
new EIRDH-P
35
new EIRDH-P
1. Receiver sets the public/secret key pair (pk, sk) as Paillier encryption
new EIRDH-P -> Algorithm -> KeyGen
36
new EIRDH-P
2. Image Provider pre-processes (x,y) to compute and , and then computes and Note that d can be positive or negativeHe generates and by using pk to encrypt , Here and are the encrypted pixel pair in the encrypted imageThis step will produce EI
new EIRDH-P -> Algorithm -> Image Enc
y xCover Image
Pre Process y' x' Encrypt [[y‘]] [[x‘]]
Enc Image
37
new EIRDH-P
3. Data Hider generates the secret message SM by using pk to encrypt the message M
new EIRDH-P -> Algorithm -> Message Enc
EncMpk SM
38
new EIRDH-P
4. For a bit b of SM , Data Hider generates and computes and Note that is only inserted into the first encrypted pixelFinally, he generates and as a pixel pair of EIM. This step will output EIM
new EIRDH-P -> Algorithm -> Embedding
[[y‘]] [[x‘]][[y”]] [[x”]] Embed
b = 1 , ,
b = 0 , ,
39
new EIRDH-P
5. Receiver uses and and sk to recover x ″ , y ″ as a pixel pair of the stego-image SI This step will finally output SI
new EIRDH-P -> Algorithm -> Image Dec
[[y”]] [[x"]] Dec y “ x “
Stego Image
40
new EIRDH-P
6. If x “ and y “ are both odd or both even , Receiver extracts b = 0 and recover x’ = x” and y’ = y”if not, extracts b = 1 and recovers x’ = x”-1 and y’ = y” since b is only embedded into the first pixelReceiver can easily compute and and obtain the original pixel pair of CI by computing and At the end, this step will output SM and recovers CI
new EIRDH-P -> Algorithm -> Extracting
y” x” Extract y‘ x‘Stego Image
41
new EIRDH-P
7. Receiver obtains the pure message M by using sk to decrypt SM
new EIRDH-P -> Algorithm -> Message Dec
y‘ x‘ Recover y xStego Image
42
new EIRDH-Pnew EIRDH-P -> Schematic
Cover Image
Pre Process Encrypt
Enc Image
[[y‘]] [[x‘]][[y”]] [[x”]] EmbedIf bit = 1 , , If bit = 0 , ,
[[y”]] [[x"]]
Dec
y “ x “Stego Image
Extract y‘ x‘ Recover
, ,
P
H
R
43
Question ?
44
Thanks