Cryptography is the art of securing information by encrypting it into an unreadable cipher text format that only those with the secret key can decrypt into plain text. Steganography hides information within other files like images rather than encrypting it. The RSA algorithm uses a public and private key system for encryption and is widely used. Image steganography works by hiding bits of encrypted files in the least significant bits of pixels in an image file, altering the bits of the red, green, and blue color values. This allows hidden information to be transmitted within an image file that appears normal to anyone unaware of its hidden content.
2. CRYPTOGRAPHY :
The art of protecting information by transforming it
(encrypting it) into an unreadable format, called cipher text.
Only those who possess a secret key can decipher (or decrypt)
the message into plain text.
STEGANOGRAPHY:
Steganography is basically referred as hidden writing. It is
entirely different from cryptography. In cryptography ,we
basically perform the encryption and decryption by changing
the text into another form.
3. Traditional private/secret/single key cryptography uses one
key
Shared by both sender and receiver
If this key is disclosed communications are compromised
Also is symmetric, parties are equal
Hence does not protect sender from receiver forging a
message & claiming is sent by sender
4. Uses two keys – a public & a private key
Asymmetric since parties are not equal
Uses clever application of number theoretic concepts to
function
Complements rather than replaces private key cryptography.
5. RSA algorithm is a part of cryptography in which a text
message is hidden in some other form.
Introduced by Rivest, Shamir & Adleman in 1977
Best known & widely used public-key scheme
Based on exponentiation in a finite (Galois) field over
integers modulo a prime
Uses large integers (eg. 1024 bits)
Security due to cost of factoring large numbers
7. Types of Steganography:
1. Image Steganography
2. Text Steganography
3. Video Steganography
4. Protocol Steganography
5. Audio Steganography
8. In steganography first we select the text or any file that we
want to send to another person.
Then we select the image or audio file in which we want to
hide our file (containing message).
9. Then we use the steganography software for encryption.
After encryption the text file is now converted in an image
file which contains our confidential data.
Then the receiver will also use the same software for
decryption.
10. How the image steganography works:
Before encrypting file into image file, we use the well
defined RSA Algorithm to increase the security of the data
transmission.
Then, we use this encrypted message to be encrypted once
again into the image file.
11. Every image is formed of the pixels. There are a number of
pixels in the image. Every pixel is formed of 24 bits. Each
pixel has 8 bits of red color, 8 bits of green color and 8 bits
of blue color(RGB).
12. Also the file that we want to send to the receiver is also
formed from a number of bits.
Now the next step is to store every 3 bits of the file in every
pixel’s Least Significant bit (LSB) i.e. 1-1 bit in 8th bit of red ,
blue, green color bits.
In this way our encryption will be done.
In this way, decryption can also be performed by extracting
the 8th bit of every color from each pixel.
14. First we extract the image by using
Image im=Image.fromfile(imagepath);
Get the height and width by im.height and im.width
Get the pixel info by using
Bitmap bt=new bitmap(im);
15. Now we extract the file and get the fileinfo by using
FileInfo fi=new FileInfo(filepath)
We convert the file into stream of bytes by using
fc=File.ReadAllBytes(file path)
16. Now we perform the encryption
In encryption function, we start a loop and in loop we access
every byte of the file 3 times .
We also use the functions ‘byte2bool’ and ‘bool2byte’ which
converts byte into bits and vice-versa
17. Starting from LSB, in the first iteration we first put 3 bits of
the file in the red pixel, then in the green one and in third i.e.
blue we put 2 bits.
The chromatic influence of blue color is maximum for
human eye so we change only 2 bits of it.
When all the bytes of the file are not able to store in the last
bits of every color then we start to replace the 7 th bit of
every color.
18. In this way the storing capacity of the image file increases
but little noise is also increased in the image
In the same way we can perform the decryption
The last step to get the original message is to decrypt the
information received from image file using RSAAlgorithm.