[Tutor] binary, ascii, steganography
davea at ieee.org
Fri Mar 18 10:54:27 CET 2011
On 01/-10/-28163 02:59 PM, jaco erasmus wrote:
> Hi there, list
> The other day I got bored at work and decided to give this programming thing
> a try, since Rick Romero said it's becoming all the rage these days.
> Eventually, I want to end up writing a steganography program, but for now I
> am still an idiot playing around with text files, substituting letters in a
> text file with letters from my secret message. Not really all that
> impressive, but you've got to start somewhere, right?
> Here's where I become a tech idiot:
> Eventually, I want to hide messages in photos by changing the value of
> pixels in the photos, and then compare the two to each other. The I suppose
> I'll take the resulting 1's and 0's and, somehow, change them into binary or
> something so that I can eventually magically make them letters. How do I do
> Baby steps, first, though. For the moment, I just want to compare 2 text
> files, have similar letters give me 0 and different letters give me 1. I
> want to take those and turn them into letters. How would I do that?
> Thanks in advance.
Welcome to the tutor group. You've come to the right place for beginner
questions. But people naturally expect you to show you've put some
effort into the problem, rather than just asking for an answer.
The main key to writing a successful program is decomposing the task
into pieces you can solve. If you can do that reliably, you can solve a
problem that otherwise appears much too complex for your abilities.
So, if you want to compare two text files, the first question is how to
get their contents, probably as text objects. Probably you want to use
open() and readline() functions, and compose some form of loop.
So, start by writing a program that reads and prints a single text file.
Next, see how you would open and read a second text file without losing
Next, you need to decide just how different these text files are going
to be. If you have one text file with the Gettysburg Address, and the
other one saying "Hello World", do you want to reject the data, or what?
From your wording, I'd guess you're assuming the text files are nearly
the same, with the same number of lines, in the same order, and with
just a few characters different in each line.
More information about the Tutor