0% found this document useful (0 votes)
17 views

Methodology Adopted: Architecture Diagram

The document discusses the data structures and algorithms used to encode and decode a message hidden in the least significant bit of image bytes. It uses BigInteger to store the message length and Byte arrays to store the bits. It stores the length in the first 32 bytes, then loops through that many image bytes, extracting the least significant bit of each to reconstruct the message bytes.

Uploaded by

Amanpreet Kaur
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Methodology Adopted: Architecture Diagram

The document discusses the data structures and algorithms used to encode and decode a message hidden in the least significant bit of image bytes. It uses BigInteger to store the message length and Byte arrays to store the bits. It stores the length in the first 32 bytes, then loops through that many image bytes, extracting the least significant bit of each to reconstruct the message bytes.

Uploaded by

Amanpreet Kaur
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Methodology adopted

Architecture diagram:

Data Structure Used


A) BigInteger: - Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in two's-complement notation (like Java's primitive integer types). BigInteger provides analogues to all of Java's primitive integer operators, and all relevant methods from java.lang.Math. Additionally, BigInteger provides operations for modular arithmetic, GCD calculation, primarily testing, prime generation, bit manipulation, and a few other miscellaneous operations.

B) Byte: - The Byte class wraps a value of primitive type byte in an object. An object of type Byte contains a single field whose type is byte. In addition, this class provides several methods for converting a byte to a String and a String to a byte, as well as other constants and methods useful when dealing with a byte.

Algorithm Used
a) The length of the message is stored as a 4 byte number, or 32 bits, thus the message starts after 32 bytes of image. b) Since the first 32 bytes contain 1 bit each of our length, we must loop all 32 bytes to retrieve the length. c) We shift the bits of length left by 1, then OR it with a result of the least significant bit of the image byte. (& 1) will clear all bits, except the last bit, which will be left as is. Thus as bits are added, they are moved along and placed into the newly empty least significant slot of length. d) Now that we have a length and have created a byte array to hold the bits, we loop through that many image bytes. e) Again we must loop through the 8 bits of a byte to be collected. f) The resulting array of bytes is made up of the least significant bit of each sequential byte. This is retrieved in the same way as we retrieved the length, now that the loops are properly setup.

You might also like