
- Cryptography - Home
- Cryptography - Origin
- Cryptography - History
- Cryptography - Principles
- Cryptography - Applications
- Cryptography - Benefits & Drawbacks
- Cryptography - Modern Age
- Cryptography - Traditional Ciphers
- Cryptography - Need for Encryption
- Cryptography - Double Strength Encryption
- Cryptosystems
- Cryptosystems
- Cryptosystems - Components
- Attacks On Cryptosystem
- Cryptosystems - Rainbow table attack
- Cryptosystems - Dictionary attack
- Cryptosystems - Brute force attack
- Cryptosystems - Cryptanalysis Techniques
- Types of Cryptography
- Cryptosystems - Types
- Public Key Encryption
- Modern Symmetric Key Encryption
- Cryptography Hash functions
- Key Management
- Cryptosystems - Key Generation
- Cryptosystems - Key Storage
- Cryptosystems - Key Distribution
- Cryptosystems - Key Revocation
- Block Ciphers
- Cryptosystems - Stream Cipher
- Cryptography - Block Cipher
- Cryptography - Feistel Block Cipher
- Block Cipher Modes of Operation
- Block Cipher Modes of Operation
- Electronic Code Book (ECB) Mode
- Cipher Block Chaining (CBC) Mode
- Cipher Feedback (CFB) Mode
- Output Feedback (OFB) Mode
- Counter (CTR) Mode
- Classic Ciphers
- Cryptography - Reverse Cipher
- Cryptography - Caesar Cipher
- Cryptography - ROT13 Algorithm
- Cryptography - Transposition Cipher
- Cryptography - Encryption Transposition Cipher
- Cryptography - Decryption Transposition Cipher
- Cryptography - Multiplicative Cipher
- Cryptography - Affine Ciphers
- Cryptography - Simple Substitution Cipher
- Cryptography - Encryption of Simple Substitution Cipher
- Cryptography - Decryption of Simple Substitution Cipher
- Cryptography - Vigenere Cipher
- Cryptography - Implementing Vigenere Cipher
- Modern Ciphers
- Base64 Encoding & Decoding
- Cryptography - XOR Encryption
- Substitution techniques
- Cryptography - MonoAlphabetic Cipher
- Cryptography - Hacking Monoalphabetic Cipher
- Cryptography - Polyalphabetic Cipher
- Cryptography - Playfair Cipher
- Cryptography - Hill Cipher
- Polyalphabetic Ciphers
- Cryptography - One-Time Pad Cipher
- Implementation of One Time Pad Cipher
- Cryptography - Transposition Techniques
- Cryptography - Rail Fence Cipher
- Cryptography - Columnar Transposition
- Cryptography - Steganography
- Symmetric Algorithms
- Cryptography - Data Encryption
- Cryptography - Encryption Algorithms
- Cryptography - Data Encryption Standard
- Cryptography - Triple DES
- Cryptography - Double DES
- Advanced Encryption Standard
- Cryptography - AES Structure
- Cryptography - AES Transformation Function
- Cryptography - Substitute Bytes Transformation
- Cryptography - ShiftRows Transformation
- Cryptography - MixColumns Transformation
- Cryptography - AddRoundKey Transformation
- Cryptography - AES Key Expansion Algorithm
- Cryptography - Blowfish Algorithm
- Cryptography - SHA Algorithm
- Cryptography - RC4 Algorithm
- Cryptography - Camellia Encryption Algorithm
- Cryptography - ChaCha20 Encryption Algorithm
- Cryptography - CAST5 Encryption Algorithm
- Cryptography - SEED Encryption Algorithm
- Cryptography - SM4 Encryption Algorithm
- IDEA - International Data Encryption Algorithm
- Public Key (Asymmetric) Cryptography Algorithms
- Cryptography - RSA Algorithm
- Cryptography - RSA Encryption
- Cryptography - RSA Decryption
- Cryptography - Creating RSA Keys
- Cryptography - Hacking RSA Cipher
- Cryptography - ECDSA Algorithm
- Cryptography - DSA Algorithm
- Cryptography - Diffie-Hellman Algorithm
- Data Integrity in Cryptography
- Data Integrity in Cryptography
- Message Authentication
- Cryptography Digital signatures
- Public Key Infrastructure
- Hashing
- MD5 (Message Digest Algorithm 5)
- SHA-1 (Secure Hash Algorithm 1)
- SHA-256 (Secure Hash Algorithm 256-bit)
- SHA-512 (Secure Hash Algorithm 512-bit)
- SHA-3 (Secure Hash Algorithm 3)
- Hashing Passwords
- Bcrypt Hashing Module
- Modern Cryptography
- Quantum Cryptography
- Post-Quantum Cryptography
- Cryptographic Protocols
- Cryptography - SSL/TLS Protocol
- Cryptography - SSH Protocol
- Cryptography - IPsec Protocol
- Cryptography - PGP Protocol
- Image & File Cryptography
- Cryptography - Image
- Cryptography - File
- Steganography - Image
- File Encryption and Decryption
- Cryptography - Encryption of files
- Cryptography - Decryption of files
- Cryptography in IoT
- IoT security challenges, Threats and Attacks
- Cryptographic Techniques for IoT Security
- Communication Protocols for IoT Devices
- Commonly Used Cryptography Techniques
- Custom Building Cryptography Algorithms (Hybrid Cryptography)
- Cloud Cryptography
- Quantum Cryptography
- Image Steganography in Cryptography
- DNA Cryptography
- One Time Password (OTP) algorithm in Cryptography
- Difference Between
- Cryptography - MD5 vs SHA1
- Cryptography - RSA vs DSA
- Cryptography - RSA vs Diffie-Hellman
- Cryptography vs Cryptology
- Cryptography - Cryptology vs Cryptanalysis
- Cryptography - Classical vs Quantum
- Cryptography vs Steganography
- Cryptography vs Encryption
- Cryptography vs Cyber Security
- Cryptography - Stream Cipher vs Block Cipher
- Cryptography - AES vs DES ciphers
- Cryptography - Symmetric vs Asymmetric
Steganography − Image
Steganography is a way to hide secret information by embedding it in an audio, video, image or text file. It is one of the methods employed to protect classified or sensitive data from malicious attacks.
Sometimes, hidden content encrypted before being concealed in another file type. If it is not encoded, then it may undergo some form of alteration so as to increase its invisibility against detection.
Steganography is sometimes likened to cryptography, as both are forms of covert communication. However there are differences between these two concepts; unlike steganography which does not involve encrypting the data prior sending or decoding it with a key after receiving.
The term Steganography comes from Greek words 'stegos' which means 'cover' and 'grayfia' meaning 'writing'. This can be translated as either 'covered writing' or 'hidden writing'.
How is it different from Cryptography?
Cryptography and steganography are both process of concealing, hiding or securing sensitive data. They mainly differ in that cryptography renders data unreadable or conceals its meaning, while steganography hides the existence of data.
Cryptography is commonly used to supplement the security offered by steganography. Encryption methods are used to encrypt sensitive information before it is included in cover files.
How Steganography Work?
Steganography hides information in a way that avoids detection. One of the most common ways is known as 'least significant bit' (LSB) steganography. This requires encoding the secret information in the least significant bits of a media file. For example −
- Each pixel in an image file has three bytes of data, one for each of the colours red, green, and blue. Some image formats reserve an extra fourth byte for transparency, or 'alpha'.
- LSB steganography changes the final bit of each byte to conceal one piece of data. To hide one megabyte of data using this method, you need an image file that is eight megabytes large.
- Modifying the last bit of the pixel value does not result in a visible change to the image, therefore anyone seeing the original and steganographically modified photos will be unable to see the difference.
The same strategy can be used with other digital content, like audio and video, to hide data in areas of the file that lead to the least change to the audible or visible output.
Another steganography method is to replace words or letters. This is where the sender of a secret message hides the text by distributing it within a much bigger text, organising the words at specific intervals. While this substitution method is simple to use, it can render the text appear unusual and out of place because the secret words do not match logically within their target sentences.
Other steganography approaches involve concealing a complete partition on a hard disc or inserting data in file and network headers. The success of these techniques is determined by how much data can be hidden and how easy it is to detect.
Steganography Types
Steganography can be divided into five categories from a digital viewpoint. They are as follows −
- Text steganography − This is the process of hiding concealed messages within conventional text for example embedding a message within a paragraph or sentence.
- Image steganography − It is the process of hiding information inside an image by embedding a message in its pixels.
- Audio steganography − This is the method of concealing data within an audio recording just like embedding a message in the sound waves.
- Video steganography − It is the technique of secretly encoding data into a video file while preserving its appearance.
- Network steganography − Network steganography is the process of concealing data inside a network traffic for example, encoding a message in data packets sent between computers.
Image Steganography
Let us see the algorithms fo image steganography and how it works in the below section −
Algorithms
Here are some a brief overview of common methods and algorithms used in image steganography −
- Least Significant Bit (LSB) Substitution − This approach involves substituting the bits of a private message with the least significant bits (LSBs) of pixels in an image. These LSBs among other things do not have much influence on how the image looks when littlebit changed.
- Spread Spectrum − What this method does is distribute small changes made to pixel color values so as to cover up a secret message throughout every part of the image.
- Transform Domain Techniques − These involve converting an image into another domain such as frequency domain using Fourier transforms and then hiding a secret message there. One popular technique is Discrete Cosine Transform (DCT) used for JPEG compression where it is applied over blocks of pixels. Embedding the information in transformed domains makes it harder to be noticed.
- Visual Cryptography − Instead of directly concealing information, visual cryptography splits one secret message into many shares or layers each of which reveals nothing about the original text independently.
- F5 Algorithm − F5 algorithm is an embedded-based approach to steganography using least significant bits (LSB). It ensures that no noticeable changes are made by modifying these pixels' least significant byte while still allowing for maximum capacity
These techniques and algorithms can be used in a number of steganography tools and software for hiding data within images. They offer various levels of security, capacity, and detection protection depending on the application needs.
How it Works?
Image steganography allows secret information to be hidden in such a way that it does not easily come into view of the human eye. Here is a simple explanation on how generally it is done −
- The first step involves selecting an image which will act as the carrier or cover image. It should be an image with high data volume and complexity so as to help in hiding this extra information.
- Next, the hidden message or secret information is encoded into the cover image. Different techniques can be used for this like LSB substitution, spread spectrum, transform domain methods etc.
- Then comes embedding the encoded message into the cover image by modifying some pixels or color values depending on chosen method to represent bits of secret message.
- Now that we have modified our picture containing hideen msgs let us store it somewhere required or transmit it if necessary. The modified picture seems like any other normal photo seen by an average person hence no one cares about specific tools or knowledge unless they want to find out what was concealed in there.
- If somebody has enough skills and tools, he can retrieve these invisible texts. Such a person examines changed imaages using similar algorithms or methods which were applied during embedding process thus being able to detect and extract covert data from them.
- There can be a verification step to make sure the hidden message was correctly and perfectly extracted, depending on the program. This can involve looking for particular signatures or patterns in the decoded message.
Implementation using Python
Using LSB substitution, this code will encode a message into an image and then decode the message from the encoded image. To run this code make sure you have the Python Imaging Library (PIL) installed in your system (pip install pillow).
Here's a simple Python code example for image steganography with the help of LSB substitution −
from PIL import Image def encode_message(image_path, message): img = Image.open(image_path) binary_message = ''.join(format(ord(char), '08b') for char in message) if len(binary_message) > img.width * img.height * 3: raise ValueError("Message is too long to encode in the image") binary_message += '1111111111111110' # Adding end of message marker index = 0 for pixel in img.getdata(): if index < len(binary_message): # Convert pixel RGB values to binary pixel = list(pixel) for i in range(3): pixel[i] = pixel[i] & ~1 | int(binary_message[index], 2) index += 1 img.putpixel((index // 3 % img.width, index // 3 // img.width), tuple(pixel)) else: break img.save("encoded_image.png") def decode_message(image_path): img = Image.open(image_path) binary_message = "" for pixel in img.getdata(): for value in pixel: binary_message += bin(value)[-1] # Extract the message message = "" for i in range(0, len(binary_message), 8): byte = binary_message[i:i+8] if byte == '1111111111111110': break message += chr(int(byte, 2)) return message # function execution encode_message("my_image.png", "This is a secret message.") decoded_message = decode_message("encoded_image.png") print("Decoded Message:", decoded_message)
Input/Output
In the below output we can see two different images. First image is before applying steganography algorithm. And the second image is after applying algorithm. So you can see the size of both the images. After embedding message in the input image the size of the image is increased.
