Page 1 of 1

Listen to me

Posted: Thu Feb 19, 2009 7:57 pm
by theStack
It's really worth looking at the titles of the challenges, without that "Listen" in the name it would have been quite hard to guess that there must be some kind of audio format hidden in the image. Did it with python:

Code: Select all

#!/usr/bin/env python
import sys, Image
im = Image.open("listen.png")
for pixel in list(im.getdata()):
    sys.stdout.write(chr(pixel[0]) + chr(pixel[1]) + chr(pixel[2]))

Posted: Sun Feb 22, 2009 3:34 am
by m!nus
indeed, that "listen" helped a lot, wasn't hard anyways

for the "converter": there's not much space for differences in implementations
here my PHP one
...somehow get a 503 when pasting my code, have it base64ed :D

Code: Select all

aW5kZWVkLCB0aGF0IFwibGlzdGVuXCIgaGVscGVkIGEgbG90LCB3YXNuJ3QgaGFyZCBhbnl3YXlzDQoNCmZvciB0aGUgXCJjb252ZXJ0ZXJcIjogdGhlcmUncyBub3QgbXVjaCBzcGFjZSBmb3IgZGlmZmVyZW5jZXMgaW4gaW1wbGVtZW50YXRpb25zDQpoZXJlIG15IFBIUCBvbmUNCltjb2RlXTw

Posted: Sun Feb 22, 2009 9:41 am
by osterlaus
Well, having decoded your base64ed string, I don't see any code after [code...

Posted: Sun Feb 22, 2009 9:56 am
by Mütze
Hello,

I didn't write any converter. I simply used convert (part of ImageMagick) to convert the file into raw format:

Code: Select all

$ convert listen.png listen.rgb
$ file listen.rgb 
listen.rgb: MPEG ADTS, layer III, v2,  32 kBits, 22.05 kHz, Monaural

Posted: Sun Feb 22, 2009 1:06 pm
by theStack
Mütze wrote:Hello,

I didn't write any converter. I simply used convert (part of ImageMagick) to convert the file into raw format:

Code: Select all

$ convert listen.png listen.rgb
$ file listen.rgb 
listen.rgb: MPEG ADTS, layer III, v2,  32 kBits, 22.05 kHz, Monaural
Ah, very nice. I tried that too but I didn't know the file extension has to be ".rgb" for converting to raw files - my approach was ".raw" which didn't lead to success (it was a PNG file again).

Posted: Wed May 04, 2011 2:39 pm
by FreeFull
I didn't know how to convert it into a raw file using imagemagick either, so I converted it to a text file and extracted the hex data instead.

Posted: Thu Aug 04, 2011 5:33 pm
by rhyan46
I had to google a lot, but then simply opened the image in photoshop and saved it as .raw
then renamed it to .mp3 (maybe not necessary) and listened to the quite beautiful voice.

Posted: Mon Jun 04, 2012 9:16 pm
by dangermouse
you won't believe it, but if you simply rename the PNG into SND, open with Audacity, and slow it down the speed twice without changing the pitch, you hear morse saying something like EAT TOMATO. This threw us off, until Virus installed the Irfan view plugins, and of course we removed the PNG header. Then the Irfan Multimedia Player could finally play it :-)

Posted: Sun Jun 10, 2012 10:07 am
by AMindForeverVoyaging
Wrote a Java class to extract the raw data:

Code: Select all

import java.io.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;

public class GetPixelColor
{
	public static void main(String args[]) throws IOException {
	File file_in = new File("listen.png");
	BufferedImage image = ImageIO.read(file_in);
	BufferedWriter out = new BufferedWriter(new FileWriter("RGB_output.raw"));
	
	// Image size is 43x100 pixels
	for(int y=0; y<100; y++) {
		for(int x=0; x<43; x++) {
			int clr   = image.getRGB(x,y); 
			int red   = (clr & 0x00ff0000) >> 16;
			int green = (clr & 0x0000ff00) >> 8;
			int blue  =  clr & 0x000000ff;
			
			out.write(red);   // endianness? red or blue here?
			out.write(green);
			out.write(blue);  // endianness? blue or red here?
			}
		}
	out.close();
	}
}
This approach did not work though. Using the program "StegSolve" that dangermouse hinted me to, I got a file that I could listen to.

Strange is that the file size between the Java and the StegSolve output is the same, and the first bytes are identical. No idea why they would differ at some point afterwards, but they do. Oh well.

Posted: Fri Jul 27, 2012 12:00 am
by kuronno
I just used IrfanView. For some reason I couldn't save it to RAW format, but then all I had to do was save to PPM binary format and remove manually the ASCII header...

How you did it?

Posted: Mon Oct 13, 2014 6:26 pm
by pokus1
Hello, for "decoding" I used IrfanView and saving as raw file.

I have a question:
How you createt this picture? I tried to do it with IrfanView (vice versa than decrypting), but I wasn't successful (probably I messed it up).
What software or script did you used? I would like to do something similar in visual basic, but I need some hind :wink:

I would appreciate any hint or help.

Have a nice day

Posted: Thu Oct 16, 2014 7:45 am
by bns
Hi,

I used python and the "Pillow" imaging library for this.
My little script to generate the MP3 is:

Code: Select all

#!/usr/bin/python
from PIL import Image

filename_out = "listen.mp3"

im = Image.open ( "listen.png" )

#print im.format, im.size, im.mode

im = im.convert('RGB')
b = im.tobytes ( )

f_out = file ( filename_out, 'wb' )
f_out.write ( b )
f_out.close ( )
A little spin that took me half an hour was, that the Pillow lib recognizes an alpha channel in the image and will save this channel to the output file, too - corrupting the output.
The line

Code: Select all

im.convert('RGB')
eliminates this, generating a valid MP3.

@pokus1:
Using the Pillow lib, it should be easy to create a PNG out of any binary data.

Posted: Wed Dec 02, 2015 9:16 pm
by Hippo
Wow, finally I have decided to try it again. (with all hints from both challenges threads in mind) I have originally tried to convert the file to wav.
Looking to mpeg header format ... it become favourite ... my first try was just RGB info extraction what resulted in mp3 what could be listen, but I had problems to understand. Than I have added alpha chanel and result was not valid mp3 (even when I have tried alpha first/last). So I have returned back to just rgb.

And as I had feeling I hear 1234, I tried it ... I was really surprised it went through.
(Especially as it sounds way different what I have learned from SayIt).

OK when listened more slower, 2,3 is heard clearly 4 misses end and 1 is natural start of the sequence.