1 /* $Id: crypt.c,v 1.4 2003-10-10 09:36:34 btb Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
17 * Encryption function for the cheat codes
26 char crypt_rcsid[] = "$Id: crypt.c,v 1.4 2003-10-10 09:36:34 btb Exp $";
33 //#include "inferno.h"
35 char *jcrypt (char *plainstring)
38 static char cryptstring[20];
40 len=strlen (plainstring);
44 for (i = 0; i < len; i++)
48 for (t = 0; t < 8; t++)
50 cryptstring[i] ^= (plainstring[t] ^ plainstring[i % (t + 1)]);
56 return ((char *)cryptstring);