0

I have two pictures: st_original.png and st_secret_key_container.png .

The second picture is the same as the first but contains a secret which is the MD5 checksum of some key I'll need to decrypt a small amount of text (the background is black in the second one).

I know this might be unwelcome here but it is a university assignment, I have to retrieve the MD5 from the picture and reverse it so i can decrypt with it the text .

I'm not asking to do the work for me, actually I'm enjoying figuring this out , that's why I didn't upload the pics nor the encrypted text . I tried some things so far like checking for a watermark in the picture with OpenPuff and StegoMagic to no avail. Most of the tools I found searching Google are out of date or no longer maintained since the 90s.

Text is definitely hidden in the picture its no question of "if", its clearly stated in the assignment that its a text hidden via LSB (least significant bit) stenography.

I have spent some time trying to figure out this thing - the problem is the PNG format and the black background. If its only hiding an MD5 (32 chars) then not much should really change. The black background makes it hard because a lot changed.

Any idea how should I tackle this?

  • Try opening up the image in something like Photoshop or GIMP and analyzing the layers, opacity, etc. You could try exiftool to see what data (if any) is stored. – munkeyoto Jan 2 '15 at 21:02
  • Hexdump -c and sdiff will get you started – KDEx Jan 2 '15 at 22:27
  • is this some DOS/Linux command or tool names ? – vlatkozelka Jan 2 '15 at 22:34
0

Solved it... I tried a tool that enhances LSB, and there I saw the first pixels were clearly different so the 32 chars length had to be written there. All I needed was the values of the LSB of the first 256 bytes, each 8 of these make one character of the MD5.

Here is the code I wrote in Java, along with the output:

BufferedImage img = ImageIO.read(new File("D:\\crypto secret\\2.png"));
        WritableRaster raster = img.getRaster();
        DataBufferByte buffer = (DataBufferByte) raster.getDataBuffer();
        byte[] data = buffer.getData();

        int j = 0 ;
        String[] bin = new String[32];
        char[] md5 = new char[32];

        for(int i = 0 ; i <256;i++){

            System.out.print(data[i]&0xFF);
            if((j+1)%8==0){
                System.out.println();
            }
            j++;
        }


00110100
01100101
01100101
00110111
00111001
01100100
00110111
00110110
00110011
00110011
01100100
00111000
01100001
01100001
01100100
00111000
00110010
00111000
01100001
00110011
00110100
01100100
00110100
01100101
00111000
00110110
00110010
00110001
01100011
01100001
01100100
00110010

I converted these to ASCII via some online tool which gave me this MD5 4ee79d7633d8aad828a34d4e8621cad2 and then a lookup on that gave me this string antonine, which is part of my university's name. Then I went ahead and decrypted the secret text with that as a key, in EDS ECB mode.

The hidden text was:

Hello students. You solved Task 3 challenge.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.