Example #1
0
  /**
   * Codifica un byte en una imagen mediante el uso de técnicas de esteganografía
   *
   * @param originalByte Byte que se desea codificar
   */
  private void encodeByteInImage(byte originalByte) {
    for (int j = 0; j < 8; j++) {
      int index = pixelPath.getNextPathIndex();
      byte mask = (byte) (0x80 >> j);
      byte bit = (byte) (originalByte & mask);

      bit = (byte) (bit >> 7 - j);
      byte pixelValue = keyBitmap.getByte(index);
      mask = (byte) 0xFE;
      pixelValue &= mask;
      pixelValue |= bit;
      keyBitmap.setByte(index, pixelValue);
    }
  }