private void GetLengthPositions() { for (int i = 0; i < 32; i++) { lengthPositions.Add(currentPosition); helper.SetNextCurrentPosition(ref currentPosition, positions); } }
private void Initialize(Bitmap image) { helper = new EncoderDecoderHelper(); Image = image; pixelColors = new byte[image.Height * image.Width * 3]; helper.FillPositionArray(image, positions); helper.SetNextCurrentPosition(ref currentPosition, positions); helper.FillPixelColorsArray(image, pixelColors); }
public void Reset() { helper = new EncoderDecoderHelper(); allText = new StringBuilder(); pixelColors = new byte[Image.Height * Image.Width * 3]; helper.FillPositionArray(Image, positions); helper.SetNextCurrentPosition(ref currentPosition, positions); helper.FillPixelColorsArray(Image, pixelColors); GetLengthPositions(); }
public string GetTextFromImage() { BitArray lengthArray = new BitArray(32); for (int i = 0; i < 32; i++) { lengthArray[i] = pixelColors[currentPosition].GetFirstBit(); helper.SetNextCurrentPosition(ref currentPosition, positions); } var length = lengthArray.GetAsByteArray().GetAsInt(); BitArray text = new BitArray(length); for (int i = 0; i < length; i++) { text[i] = pixelColors[currentPosition].GetFirstBit(); helper.SetNextCurrentPosition(ref currentPosition, positions); } return(Encryptor.Decrypt(Statics.passwordHash, text.GetAsByteArray())); }