Class MessageManipulator

java.lang.Object
ch.heigvd.dai.utilities.MessageManipulator

public class MessageManipulator extends Object
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 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 a BmpFile instance
      message - the message to hide
      bitsPerByte - the number of bits to use per message byte
      Throws:
      MessageManipulationException - if one of the arguments is not valid
    • exposeMessage

      public void exposeMessage(BmpFile bmpFile, byte[] message) throws MessageManipulationException
      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 a BmpFile instance
      message - a byte array where the extracted message will be extracted to
      Throws:
      MessageManipulationException - if one of the arguments is not valid