Category : C Source Code
Archive   : CRYPT.ZIP
Filename : CRYPTEST.C
Output of file : CRYPTEST.C contained in archive : CRYPT.ZIP
/* */
/* CRYPTEST.C */
/* */
/* This program is a demo of the included CRYPT.C encryption function. */
/* This algorithm is reasonably secure and runs at about 17,000 */
/* chars/sec. on a 10 MHz AT clone. This algorithm is identical to, */
/* and therfore compatible with, that used in the following packages: */
/* */
/* 1. Mike Smedley's CXL windowing library for Zortech, Turbo, */
/* Microsoft, and Power C. */
/* 2. Steve Margison's SMZT and SMTC libraries for Zortech and */
/* Turbo C. */
/* 3. Bob Stout's LYNX and CRYPT utilities ver 3.0 or later. */
/* Avalilable as part of the MicroFirm Toolkit utilty package. */
/* */
/* Copyright 1987-1989 by Robert B. Stout dba MicroFirm */
/* All rights reserved. */
/* */
/* NOTE: Although copyrighted, this code along with CRYPT.C may be */
/* be freely used in any application whatsoever as long as no */
/* one else claims authorship. In other words, use it to your */
/* heart's content and you don't even have to give me credit, */
/* but don't try to copyright it or say that you wrote it. */
/* */
/* Bob Stout */
/* */
/************************************************************************/
#include
#include
#include
#define BUF_SIZ 32768
extern char *cryptext;
extern int crypt_length;
void crypt(char *);
main(int argc, char *argv[])
{
unsigned i, n;
char *buf, *p;
FILE *infile, *outfile;
if (4 > argc)
{
puts("\aCRYPT: input_file output_file key");
abort();
}
assert(buf = (char *)malloc(BUF_SIZ));
assert(infile = fopen(argv[1], "rb"));
assert(outfile = fopen(argv[2], "wb"));
cryptext = argv[3];
crypt_length = strlen(cryptext);
while (n = fread(buf, 1, BUF_SIZ, infile))
{
p = buf;
for (i = 0; i < n; ++i)
crypt(p++);
fwrite(buf, 1, n, outfile);
}
fclose(infile);
fclose(outfile);
exit(0);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/