Package ch.heigvd.dai.utilities
Class MessageManipulator
java.lang.Object
ch.heigvd.dai.utilities.MessageManipulator
Implements the logic necessary to hide and expose an array of bytes inside a bitmap image, which
is itself parsed using the
BmpFile
class.- Author:
- Pedro Alves da Silva, Gonçalo Carvalheiro Heleno
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
exposeMessage
(BmpFile bmpFile, byte[] message) Extracts a hidden message from the provided data array.void
hideMessage
(BmpFile bmpFile, byte[] message, int bitsPerByte) Hides a provided message inside the provided data array.
-
Constructor Details
-
MessageManipulator
public MessageManipulator()
-
-
Method Details
-
hideMessage
public void hideMessage(BmpFile bmpFile, byte[] message, int bitsPerByte) throws MessageManipulationException Hides a provided message inside the provided data array.Data array is used as input and output. Each of the (bitsPerByte) LSb of each byte in data are replaced.
- Parameters:
bmpFile
- the parsed bitmap file from aBmpFile
instancemessage
- the message to hidebitsPerByte
- the number of bits to use per message byte- Throws:
MessageManipulationException
- if one of the arguments is not valid
-
exposeMessage
Extracts a hidden message from the provided data array.Data array is used as input and output. Each of the (bitsPerByte) LSb of each byte in data are set to 0.
- Parameters:
bmpFile
- the parsed bitmap file from aBmpFile
instancemessage
- a byte array where the extracted message will be extracted to- Throws:
MessageManipulationException
- if one of the arguments is not valid
-