Listen to me

Discussion of challenges you have already solved
Post Reply
theStack
Posts: 72
Joined: Sun Nov 02, 2008 12:46 am

Listen to me

Post 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]))
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post 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
osterlaus
Posts: 20
Joined: Sun Nov 02, 2008 6:04 pm

Post by osterlaus »

Well, having decoded your base64ed string, I don't see any code after [code...
Mütze
Posts: 23
Joined: Sun Oct 26, 2008 2:39 pm

Post 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
theStack
Posts: 72
Joined: Sun Nov 02, 2008 12:46 am

Post 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).
FreeFull
Posts: 7
Joined: Fri Apr 22, 2011 6:26 pm

Post 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.
rhyan46
Posts: 2
Joined: Sun Jul 03, 2011 1:14 pm

Post 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.
User avatar
dangermouse
Posts: 89
Joined: Sun Jun 05, 2011 8:14 pm
Location: deep space computing AG
Contact:

Post 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 :-)
AMindForeverVoyaging
Forum Admin
Posts: 496
Joined: Sat May 28, 2011 9:14 am
Location: Germany

Post 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.
kuronno
Posts: 4
Joined: Thu Mar 19, 2009 1:57 pm

Post 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...
pokus1
Posts: 6
Joined: Sat May 28, 2011 10:53 am
Location: Ceska Republika

How you did it?

Post 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
bns
Posts: 7
Joined: Fri Apr 24, 2009 11:40 am
Location: Germany

Post 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.
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post 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.
Post Reply