Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin committed Apr 13, 2002
1 parent f374ee3 commit 94e5eb3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
46 changes: 36 additions & 10 deletions README
@@ -1,8 +1,8 @@
$Id: README,v 1.6 2001/09/25 17:32:11 marvin Exp $
$Id: README,v 1.7 2002/04/13 01:04:03 marvin Exp $

XOR Cipher implementation and breaking

By Marvin (marvin@rootbusters.net)
By Thomas Habets <thomas@habets.pp.se>


Introduction
Expand All @@ -14,7 +14,7 @@ It's been many years since I first implemented XOR encryption, and then it
was just with an 8-bit key. Here's a variable key-length implementation and a
program for breaking using a ciphertext-only attack (known/chosen
plaintext/ciphertext is so trivial I broke them when I first implemented the
8-bit version with them when I was eight years old).
8-bit version when I was eight years old).
This program was inspired by the excellent book 'Applied cryptography' by Bruce
Schneier. ISBN 0-471-11709-9 or 0-471-12845-7. Buy it, read it. Love it.

Expand All @@ -29,7 +29,8 @@ number of zeroes (equal bytes) are counted. This is called counting
coincidences. When the number of zeroes is high the shift value is potentially
a multiple of the key length. The one that stands out most is checked with
statistics (with a frequency table) to get the key. To check with statistics on
all key-lengths in key-length interval (-m and -M) use the -a switch.
all key-lengths in key-length interval (-m and -M) use the -a switch (with -v
for one key per keylength).

Compiling
---------
Expand All @@ -50,12 +51,13 @@ file.xor = output 'ciphertext' filename

Decryption
----------
Same as encryption
Same as encryption.

Cryptanalyzing (cracking/breaking)
----------------------------------
'./xor-analyze -h' will give you some help.
All tests will work (are successfully cryptanalyzed) without parameters.
All tests will work (are successfully cryptanalyzed) without any parameters
except ciphertext and frequency table.

Frequency table generation
--------------------------
Expand All @@ -72,22 +74,46 @@ FAQ
---
Q: The windows version doesn't work/needs file X/crashes the system.

A: Here kid, here's a nickel. Go buy yourself a *real* OS.
A: Here's a nickel kid, go buy yourself a *real* OS.
If the windows version doesn't work, I won't be able to debug it myself.
The windows version is created under Linux using a cross-compiler. And since
I don't have windows, it's enough for me if it just compiles.
I don't cate about the windows version.

As someone once said: I can code the unix stuff for free, but if you want me
to program in windows, you have to pay me.
---
Q: Where can I find a compiled version (as in: "I run windows and can't code")

A: ftp://ftp.nss.nu/pub/synscan/arping-0.3-BINARY.tar.gz
A: ftp://ftp.habets.pp.se/pub/synscan/xor-analyze-*-BINARY.tar.gz
---
Q: I can't seem to crack this file, I'm sending it to you as an attachment.
Will you take a look at it?

A: Probably not. If you can't crack it with this program, it probably means
that I would have to spend quite a while trying. And unless you can give me
a sufficient reason to do so (like money or a favor or something) I don't
really feel like doing other peoples work.

And even if you offer money, I won't hessitate to report you to the proper
authorities if I suspect you are trying to get me involved in stolen or
otherwise dubious data.
---

Misc
----
I developed this program until it worked, and no longer. Looking at the code
now I think it should be rewritten, and maybe I'll do that some day.

If you send a patch that adds/fixes something, it'll probably be added, but
suggestions and requests will most likely not be implemented (by me) before
the rewrite.

Maybe I'll do the rewrite during the summer of 2002. But then again, maybe not.

License
-------
It's all GPL, see the LICENSE file.

-------------------------------------------------------------------------------
Send questions/suggestions/patches/rants/money/sparcs to marvin@rootbusters.net
------------------------------------------------------------------------------
Send questions/suggestions/patches/rants/money/sparc64s to thomas@habets.pp.se
5 changes: 3 additions & 2 deletions xor-analyze.cc
Expand Up @@ -16,7 +16,7 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: xor-analyze.cc,v 1.11 2002/04/07 23:22:28 marvin Exp $
* $Id: xor-analyze.cc,v 1.12 2002/04/13 01:04:03 marvin Exp $
*/
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -27,13 +27,14 @@

#ifdef WIN32_CROSS
extern "C" {
#include "/home/thompa/src/fcrackzip-0.2.4/getopt.h"
#include "getopt.h"
}
#endif

const char *version = "0.4";

class xor_analyze {
private:
/* pass 2 */
unsigned int keylen;
float freq[256];
Expand Down

0 comments on commit 94e5eb3

Please sign in to comment.