Computer Science Canada

Cypher Image

Author:  agnivohneb [ Sun Sep 14, 2008 7:06 pm ]
Post subject:  Cypher Image

I created this unit file for those who need to send messages in class without any suspicion. It will take any message (225 characters long) and convert it into a pixel image. You see dots but the computer sees a message. Have a look at the example to see how this would be used. And also see the example output to see what it would look like.

Please don't ask why I decided to call it cypher image. I am aware that this is not an actual cypher program.

Have fun and you may use this however you like, just keep my name as the original creator.

Author:  Dan [ Sun Sep 14, 2008 7:15 pm ]
Post subject:  RE:Cypher Image

Some ways you could make this program more interesting would be to add color in to it so you can store more data in each pixel. In theory if you used a losses image format with colors you could get "TEST" in to 1 1/3 pixes rather then that big image.

Also you could add some real encryption into it so it is both encrypted and made into an image.

There is also a technice that is some times used to hide data in an existing image where you put the data in the low byte of each color triple for each pixel so the image looks about the same but it has your message hidden in it. That way when some one sees the image they think it is just that image and there is nothing encoded in it and it does not look like a bar code.

Author:  agnivohneb [ Sun Sep 14, 2008 7:30 pm ]
Post subject:  Re: RE:Cypher Image

Dan @ Sun Sep 14, 2008 7:15 pm wrote:
Also you could add some real encryption into it so it is both encrypted and made into an image.

You could if you wanted to just by encrypting the message before you send it to the setMessage procedure. and decrypt after you get it from the getMessage function. But that is up to the programmer using this unit file, so I didn't add anything to it that is not meant for converting a string to an image. I am sure someone has created a procedure or function for encrypting and decrypting strings.

And as for the other stuff you said.
?????WTF????? I don't get it.

Author:  Insectoid [ Sun Sep 14, 2008 7:31 pm ]
Post subject:  RE:Cypher Image

Very creative! The answer to my IM-during-class problems! Does the message have to be 255 characters, or is that the maximum size?

Author:  agnivohneb [ Sun Sep 14, 2008 7:37 pm ]
Post subject:  RE:Cypher Image

The only reason the message is 255 character is because each 15X15 pixel area you see is one character. 15X15 of those areas represents the 225 characters in your message. If that helps

Author:  agnivohneb [ Sun Sep 14, 2008 7:57 pm ]
Post subject:  Re: Cypher Image

Just use these to encrypt your message. I did just make them up quick and probably forgot something.

Turing:
function encr (input, key : string) : string
    var output, key2 : string := ""
    key2 := key

    loop
        if length (input) > length (key2) then
            key2 += key2
        else
            exit
        end if
    end loop
    for i : 1 .. length (input)
        output += chr (ord (input (i)) + ord (key2 (i)))
    end for
    result output
end encr

function decr (input, key : string) : string
    var output, key2 : string := ""
    key2 := key

    loop
        if length (input) > length (key2) then
            key2 += key2
        else
            exit
        end if
    end loop
    for i : 1 .. length (input)
        output += chr (ord (input (i)) - ord (key2 (i)))
    end for
    result output
end decr

var phr, key : string
put "Please enter a phrase: " ..
get phr : *
put "Please enter the password: " ..
get key

put encr (phr, key)
put decr (encr (phr, key), key)

Author:  Tony [ Sun Sep 14, 2008 9:13 pm ]
Post subject:  Re: RE:Cypher Image

agnivohneb @ Sun Sep 14, 2008 7:30 pm wrote:
?????WTF????? I don't get it.

It's called steganography.

Author:  bugzpodder [ Sun Sep 14, 2008 10:38 pm ]
Post subject:  RE:Cypher Image

if you want to do encryption, do *real* encryption. otherwise, you are simply wasting time. if you just want some way of passing a message without suspicion, that's not encryption (and it is rightly stated in the original post) and what you got is fine.

Author:  bugzpodder [ Sun Sep 14, 2008 10:40 pm ]
Post subject:  RE:Cypher Image

btw for JPEG image formats, you can just add your custom block of data. because blocks of unknown tags are ignored by the image display program, you can essentially have any image and any data -- usually nobody will bother to check.

Author:  Zeroth [ Sun Sep 14, 2008 11:02 pm ]
Post subject:  Re: Cypher Image

Hmm, I invented a method a year or so ago, of hiding data in pictures that is unbreakable. Well, it doesn't hide data. It refers to data in the picture. Essentially, it takes the message, in bytes, and find matching bytes in the image. Then, the program creates an output file referring to a specific location in the picture. By distributing the same image amongst a group, one can then recieve simply a list of numbers, and then decipher the message. The picture essentially acts as the pre-distributed info, with the numbers acting as the message. Do whatever you want, encrypt the numbers, encrypt the message before finding matches, changing the size of the window we look at, going vertical instead of horizontal... the options are nearly limitless. The various options can act as a password. The best part, there IS no extra information contained in the image, so it is safe to have. And the numbers are useless without the image and the alignment information.

Author:  Dan [ Mon Sep 15, 2008 12:32 am ]
Post subject:  RE:Cypher Image

@Zeroth thats a rather intresting take on the very old idea of having buch of codes witch refure to a book and when the code is used on the book it relates to the spefic letters that make up your message and you could not find the message with out knowing what book or body of text to use.

However i would not trust this method to be unbreakable, noramly in cryptogrphey you assume your attacker knows how your algormtim works and they can see the encrypted message. So if an attacker has both your output, your alrogthm and a group of images it could be borken by a quick burtforce attack to find the message if it is not encrypted with a real ecnruption alogrithm befor hand as the size of the message could be determined from the output.

Simpley put your method is steganography and not cryptography as with the method in this topic and both realy on the encryption used befor hand.

Author:  turingmasta [ Mon Sep 15, 2008 9:25 am ]
Post subject:  RE:Cypher Image

I can't see the hidden word "TEST" in that image. Is this one of those things where you have to put your eyes out of focus?

Author:  Carey [ Mon Sep 15, 2008 9:50 am ]
Post subject:  RE:Cypher Image

No it is not. please read the previous posts before posting yourself. the word test is represented by the black and white blocks in the picture. the computer sees the dots and figures out what letter they represent. it is impossible to just look at it and see the message.

Author:  turingmasta [ Mon Sep 15, 2008 10:00 am ]
Post subject:  RE:Cypher Image

I still can't see it. I even opened the image in turing and everything.

I think I can see the faint outline of the "T" if I cross my eyes...

EDIT: Now I just have a headache... Sad I HATE subliminal messages...

Author:  Zeroth [ Mon Sep 15, 2008 10:16 am ]
Post subject:  Re: Cypher Image

@turingmasta the information for each letter is encoded in a square 15x15, using black and white pixels as a form of binary code. Unless you have an uncommonly weird brain, there should be no way you can just "see" the information.

Author:  SNIPERDUDE [ Mon Sep 15, 2008 2:18 pm ]
Post subject:  RE:Cypher Image

Hmm, he's a robot! Can you teach me to read binary too?

Author:  btiffin [ Mon Sep 15, 2008 2:30 pm ]
Post subject:  RE:Cypher Image

For actual code in pictures, check out Piet (a toy programming language).

This url shows some samples. I'm still amazed at computing PI, with a better approximation when using bigger circles. And note the sample displays the code zoomed out and then the actual tiny executable 1:1 pixel images.

http://www.dangermouse.net/esoteric/piet/samples.html

Cheers

Author:  Warchamp7 [ Wed Sep 17, 2008 8:30 am ]
Post subject:  Re: RE:Cypher Image

turingmasta @ Mon Sep 15, 2008 10:00 am wrote:
I still can't see it. I even opened the image in turing and everything.

I think I can see the faint outline of the "T" if I cross my eyes...

EDIT: Now I just have a headache... Sad I HATE subliminal messages...


Is this guy for real lol

Author:  [Gandalf] [ Wed Sep 17, 2008 4:41 pm ]
Post subject:  Re: Cypher Image

Getting really off topic, not to mention the presence of a probable troll, and it seems any real discussion has ended.
This thread is locked


: