From msuinfo!agate!ames!pacbell.com!att-out!cbnewsh!wcs Sat May  8 17:34:21 1993
Newsgroups: sci.crypt,alt.sources
Path: msuinfo!agate!ames!pacbell.com!att-out!cbnewsh!wcs
From: wcs@cbnewsh.cb.att.com (Bill Stewart 908-949-0705 erebus.att.com!wcs)
Subject: otp.c - one-time pad program
Organization: personal research and education
Date: Sat, 8 May 1993 05:28:32 GMT
Message-ID: <C6p0Jn.8C9@cbnewsh.cb.att.com>
Followup-To: sci.crypt
Lines: 124
Xref: msuinfo sci.crypt:16390 alt.sources:7682

There's been some discussion about one-time pads, so I've written a simple
program that XORs two files together, and does simple management functions
like writing the unused bits of the pad into a new file, and
either failing or reusing the pad multiple times if the pad runs out early.

It's not usable for encryption outside the US, because that would require two
different people to securely exchange an identical set of random numbers,
which the U.S. Government would disapprove of :-)
But it's a simple demonstration of how two files can be XORed together,
using obvious techniques available in the public domain, and
furthermore includes correct use of the underutilized getopt() routine.

Disclaimer: It's Public Domain, Free, Not Copyrighted, Not Copylefted,
you may use it for anything you like, commercial or otherwise,
except in support of initiation of force against other people*,
I expressly make no guarantees about its usefulness for anything,
my employer had nothing to do with it, and the user bears all
responsibility for any consequences of using it.
In particular, please don't use otp to xor files into themselves;
they tend to be truncated, which will not be what you intended :-)

*Political Diatribe:  This program is not copyrighted,
so I can't enforce restrictions on its use, but you don't have my
permission to use it to support initiating force against anybody,
and if you work for a government, that's probably your job.
I guess that's a copyanarchist or something.....


