Tuesday, June 11, 2019

[Project] 1 - Bluestego

The LSB is old technique but still a most common in the CTF and special is in steganography. What is LSB?

The least significant bits have the useful property of changing rapidly if the number changes even slightly. For example, if 1 (binary 00000001) is added to 3 (binary 00000011), the result will be 4 (binary 00000100) and three of the least significant bits will change (011 to 100). By contrast, the three most significant bits (MSBs) stay unchanged (000 to 000).


And in my tool, I use it to hide the message into the picture, every pixel can hide 1 bit, so 8 pixels will compose to 1 byte.


But it too basically, and too easy with zsteg to read the message, so I add some cryptography to encrypt the message. The main cryptography technique I use is Vigenere cipher, I think it old but gold, and I do some stuffs to modify it.

And it can encrypt 2^12 = 4096 characters in a picture with large resolution, for small picture character number can calculate by formula:

Character = (Height * Width / 8) - 20

For example, I used an image sky.jpg to ecnrypt the string: "Hello Blue"



The output.png:


For decryption:


I think it's really easy to use, but still now it too simple, and in the future I hope I can make it better, like can encrypt file in image not only text like right now.

I pushed code on github as always: https://github.com/BinhHuynh2727/BlueStego

Related Posts:

  • [Writeup] Sunshine CTF 2019 Forensics Golly It's a code of Golly rle file, when I run a code given I just have a alphabet table: Run it and nothing else, I read a rle file document at here. And I know a "$" represents the end of each row and a… Read More
  • [Writeup] Mates SS3 Round 4 Programing Đề bài làm bắt chúng ta phải làm sao từ 2 bình nước x, y có thể tích vx, vy và phải đong nước làm sao cho được z lít. Đây là bài toàn đong nước kinh điển, may mắn là mình đã được học qua ở trường nên có thể làm đ… Read More
  • [Writeup] ASIS 2019 Quals Flag collision In this challenge, we need to sumbit two string differene but same length and same crc 32. After I try to brute force two string with length is 15 and submit to server, I received the example of admin is two … Read More
  • [Writeup] Pragyan CTF - ForensicsWelcome We have a jpg file, I used HXD and see a zip file in it, then I used binwalk to get the zip file. 1 2 3 4 5 6 7 $ binwalk welcome.jpeg DECIMAL HEXADECIMAL DESCRIPTION ---------------------------------… Read More
  • [Writeup] Insomnihack final 2019 myBrokenBash For this challenge, the author give us something about stdout and when I try to send something the server will reply the string that I send, it's make me remember to a challenge in Ringzer0 CTF about bash shell… Read More

0 comments:

Post a Comment