我正在尝试使用 LSB 算法将一串文本隐藏到位图中,该算法正在替换每个像素的 RGB 值的最低有效位。到目前为止,我已经遍历了图像的像素并清除了每个像素的 LSB 值。我正在努力的部分是插入来自字符串的新 LSB 值。
这就是我到目前为止所做的任何关于下一步去哪里的指示都会有所帮助
string text = txtEncrypt.Text;
//Gets the ascii value of each character from the string
var n = ASCIIEncoding.ASCII.GetBytes(text);
Bitmap myBitmap = new Bitmap(myPictureBox.Image);
byte[] rgbBytes = new byte[0];
int R=0, G=0, B=0;
for (int i = 0; i < myBitmap.Width; i++)
{
for (int j = 0; j < myBitmap.Height; j++)
{
Color pixel = myBitmap.GetPixel(i, j);
// now, clear the least significant bit (LSB) from each pixel element
//Therefore Three bits in each pixel spare
R = pixel.R - pixel.R % 2;
G = pixel.G - pixel.G % 2;
B = pixel.B - pixel.B % 2;
// Need to insert new values
}
}