-
May 25th, 2002, 09:05 PM
#11
Okay fine, maybe ROT13 isn't the best encryption method around...
But... it still kicks ass, IMHO!
-
May 25th, 2002, 10:16 PM
#12
Code:
/* ROT13 by Jethro
1337 3ncrypt10n!
jethrojones@gmx.net
*/
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
int count;
FILE *in,*out;
if(argc < 3) {
printf("ROT13 by Jethro\n");
printf("Usage: rot13 <source file> <destination file>");
return 0;
}
in = fopen(argv[1], "rb");
out = fopen(argv[2], "wb");
while(( count = getc(in)) != EOF)
{
count = count ^ 13;
putc(count, out);
}
return 0;
}
To the comments this is unbreakable? They are VERY false....this is extremely breakable. Anyone with the program would know that you are xoring each value in the plaintext by 13 or 1101 binary. Since all ASCII letters can be shown by FFh in hex for 1111 1111b in binary, and lets say you have an ASCII message of "the dog" it comes out to a stream of binary looking like this:
Code:
t= 01110100
h=01101000
e=01100101
=00100000
d=01100100
o=01101111
g=01100111
These are just the ASCII values for the words "the dog" including the space. Now, lets see what the program is doing to them?
Code:
01110100 01101000 01100101 00100000 01100100 01101111 01100111 'is the message
00001101 00001101 00001101 00001101 00001101 00001101 00001101 'is the 'key'
01111001 01100101 01101000 00101101 01101001 01100010 01101010 'is our ciphertext (actually a binary stream)
Now for *why* this program is vurnerable, we are going to analyze the ciphertext and "leak" information about the plaintext without knowing anything.....
Code:
01111001 01100101 01101000 00101101 'first part of the messge ("the<space>')
01101001 01100010 01101010 00000000 'second part of message ("dog")
00010000 00000111 00000010 00101101 'a REALLY messed up message but the key is now negated...:)
01110100 01101000 01100101 'is the word "the" xoring the previous value...
01100100 01101111 01100111 'we now have the word dog, as output....
basically what we did was, since we know the key is repeated (or at least are guessing it to be repeated, we simply took half the message, xored it by the other half (in this case negating the keys effect on it) then we line thethethethethethethe up at different offsets along the new ciphertext, and it will leak information from the ciphertext, allowing us to find the key if we take the ciphertext and xor the leaked data out of it. Just thought I would bring this up, as your program is SEVERELY flawed...
-
May 25th, 2002, 11:08 PM
#13
Originally posted here by shr1k3
I also think, that rot13 in a computer context is simply adding 13 to the ASCII code of a letter and being careful that you roll over when the value crosses the upper boundry (i.e. 122 dec / 90 dec, excluding numbers).
have fun!
shr1k3
Ok i'm a bit confused here. You say "adding 13"; adding exactly 13 of what?
ROT13 is short for ROTate 13 characters.
So A would become M yes?
[Edit]
Here's the source to a ROT13 program.
-
May 25th, 2002, 11:12 PM
#14
you would be correct, it was used (and still used) to post offensive material to newsgroups..... It is by no means supposed to be secure... Although what is posted here is just as breakable, it is not ROT13...
-
May 26th, 2002, 01:48 PM
#15
Well I thought everybody was going to "get it" but I was actually joking. I just wanted to show my lovely program . When I said that ROT13 was uncrackable, well that would be a kind of stupid statement to make!
Cheeseball: You're absolutely right!
-
May 26th, 2002, 05:47 PM
#16
Sorry...I am too serious sometimes.... Also BTW....I am still playing with it....but on my page under the projects there is an implementation of a onetime pad (currently statically done because I have not started checking the filesize or stuff like that), but it technically is secure.......(it also causes dataloss in the version I wrote, ahhh...buggy!) anyway......
-
May 26th, 2002, 06:32 PM
#17
Originally posted here by jethro
Well, I don't wanna be excused of somehow over-selling my program, but if the Nazis had used ROT13 instead of the Enigma yolk, you'd all be singing a different anthem! It's uncrackable!
*quiet laugh* good one *quiet chuckle* hehe
-
May 26th, 2002, 07:19 PM
#18
I think if you exchange count ^ 13 to count ^ *argv[3] in my wee program, you will get XOR.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|