[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding Test



On Wed, 28 Oct 1998, Ben Nes Michael wrote:

> I would like to make a program that will print a message (for example
> hello) but the word wont be seen when the file is edited.
> 
> I used C program and printf but after I compiled it I still could see
> the word inside it with text editor.

You mean, with strings ;) ? Use something called rot13. There is source
code somewhere. It's a Caesar code, e.g. to encode:

c = c + 13;

and to decode:

c = c - 13;

However, there are 26 letters in the alphabet, and 26/2 = 13 so if you
have only letters you can restrict to perform the operation only on
letters, e.g., input char in int c, output in same, int d is temp. : 

if(isalpha(c)) {
	d = islower (c) ? 'a' : 'A';
	c = ((c - d) + 13) % 26 + d;
}

Which encodes and then decodes the text, but not numbers in it.

There is no end to these and other methods ;)

Peter