在隐写术中访问lsb位

时间:2017-08-21 19:38:17

标签: java encryption steganography argb

该程序通过修改ARGB的alpha(透明度)部分的lsb位将消息嵌入到图像中,访问此代码中位位置的机制在这一行中令人困惑:

startX = start / maxY,startY = start - startX * maxY

private void embedByte(BufferedImage img, byte b, int start, int 
storageBit) {
int maxX = img.getWidth(), maxY = img.getHeight(), 
____________________________________________________________
startX = start/maxY, startY = start - startX*maxY, count=0;
____________________________________________________________
 for(int i=startX; i<maxX && count<8; i++) {
   for(int j=startY; j<maxY && count<8; j++) {
    int rgb = img.getRGB(i, j), bit = getBitValue(b, count);
    rgb = setBitValue(rgb, storageBit, bit);
    img.setRGB(i, j, rgb);
    count++;
    }
  }
}

startX&amp;的意思是什么? startY和两个for循环的目的?

源代码:

http://developeriq.in/articles/2013/feb/28/embedding-messages-in-digital-images-using-java/

0 个答案:

没有答案