From d03921ce12b0e9de9bec79b81d3b2f851de87dfb Mon Sep 17 00:00:00 2001 From: tedu Date: Sun, 13 Jul 2014 19:40:57 +0000 Subject: [PATCH] calling this "encryption" makes me cringe. "slightly obfuscated" is better. --- games/adventure/hdr.h | 4 ++-- games/adventure/io.c | 26 +++++++++++++------------- games/adventure/save.c | 6 +++--- games/adventure/setup.c | 4 ++-- games/adventure/vocab.c | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/games/adventure/hdr.h b/games/adventure/hdr.h index aa03bd319cf..bb5c72c50eb 100644 --- a/games/adventure/hdr.h +++ b/games/adventure/hdr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hdr.h,v 1.12 2003/06/03 03:01:37 millert Exp $ */ +/* $OpenBSD: hdr.h,v 1.13 2014/07/13 19:40:57 tedu Exp $ */ /* $NetBSD: hdr.h,v 1.2 1995/03/21 12:05:02 cgd Exp $ */ /*- @@ -83,7 +83,7 @@ struct hashtab { /* hash table for vocabulary */ char *atab; /* pointer to actual string */ } voc[HTSIZE]; -#define SEED 1815622 /* "Encryption" seed */ +#define SEED 1815622 /* "obfuscation" seed */ struct text { #ifdef OLDSTUFF diff --git a/games/adventure/io.c b/games/adventure/io.c index 0c4c699db08..bcf49254567 100644 --- a/games/adventure/io.c +++ b/games/adventure/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.17 2009/10/27 23:59:23 deraadt Exp $ */ +/* $OpenBSD: io.c,v 1.18 2014/07/13 19:40:57 tedu Exp $ */ /* $NetBSD: io.c,v 1.3 1995/04/24 12:21:37 cgd Exp $ */ /*- @@ -175,18 +175,18 @@ char *inptr; /* Pointer into virtual disk */ int outsw = 0; /* putting stuff to data file? */ const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l"; -const char *tape = iotape; /* pointer to encryption tape */ +const char *tape = iotape; /* pointer to obfuscation tape */ int next(void) /* next virtual char, bump adr */ { int ch; - ch=(*inptr ^ random()) & 0xFF; /* Decrypt input data */ - if (outsw) { /* putting data in tmp file */ + ch=(*inptr ^ random()) & 0xFF; /* Deobfuscate input data */ + if (outsw) { /* putting data in tmp file */ if (*tape == 0) - tape = iotape; /* rewind encryption tape */ - *inptr = ch ^ *tape++; /* re-encrypt and replace value */ + tape = iotape; /* rewind obfuscation tape */ + *inptr = ch ^ *tape++; /* re-obfuscate and replace value */ } inptr++; return (ch); @@ -201,7 +201,7 @@ rdata(void) /* "read" data from virtual file */ char ch; inptr = data_file; /* Pointer to virtual data file */ - srandom(SEED); /* which is lightly encrypted. */ + srandom(SEED); /* which is slightly obfuscated.*/ clsses = 1; for (;;) { /* read data sections */ @@ -276,7 +276,7 @@ rnum(void) /* read initial location num */ { char *s; - tape = iotape; /* restart encryption tape */ + tape = iotape; /* restart obfuscation tape */ for (s = nbf, *s = 0;; s++) if ((*s = next()) == TAB || *s == '\n' || *s == LF) break; @@ -530,7 +530,7 @@ mspeak(int msg) } /* - * Read, decrypt, and print a message (not ptext) + * Read, deobfuscate, and print a message (not ptext) * msg is a pointer to seek address and length of mess */ void @@ -541,7 +541,7 @@ speak(const struct text *msg) s = msg->seekadr; nonfirst = 0; while (s - msg->seekadr < msg->txtlen) { /* read a line at a time */ - tape = iotape; /* restart decryption tape */ + tape = iotape; /* restart deobfuscation tape */ while ((*s++ ^ *tape++) != TAB); /* read past loc num */ /* assume tape is longer than location number */ /* plus the lookahead put together */ @@ -560,7 +560,7 @@ speak(const struct text *msg) } /* - * Read, decrypt an print a ptext message + * Read, deobfuscate, and print a ptext message * msg is the number of all the p msgs for this place * assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c */ @@ -580,12 +580,12 @@ pspeak(int m, int skip) nonfirst = 0; while (s - tbuf < msg->txtlen) { /* read line at a time */ - tape = iotape; /* restart decryption tape */ + tape = iotape; /* restart dobfuscation tape */ for (numst = s; (*s ^= *tape++) != TAB; s++) ; /* get number */ save = *s; /* Temporarily trash the string (cringe) */ - *s++ = 0; /* decrypting number within the string */ + *s++ = 0; /* deobfuscation number within the string */ if (atoi(numst) != 100 * skip && skip >= 0) { while ((*s++ ^ * tape++) != LF) /* flush the line */ diff --git a/games/adventure/save.c b/games/adventure/save.c index 45885ac005d..483dd8a309b 100644 --- a/games/adventure/save.c +++ b/games/adventure/save.c @@ -1,4 +1,4 @@ -/* $OpenBSD: save.c,v 1.8 2009/10/27 23:59:23 deraadt Exp $ */ +/* $OpenBSD: save.c,v 1.9 2014/07/13 19:40:57 tedu Exp $ */ /* $NetBSD: save.c,v 1.2 1995/03/21 12:05:08 cgd Exp $ */ /*- @@ -139,7 +139,7 @@ save(const char *outfile) fwrite(&sum, sizeof(sum), 1, out); /* Here's the random() key */ for (p = save_array; p->address != NULL; p++) { for (s = p->address, i = 0; i < p->width; i++, s++) - *s = (*s ^ random()) & 0xFF; /* Lightly encrypt */ + *s = (*s ^ random()) & 0xFF; /* Slightly obfuscate */ fwrite(p->address, p->width, 1, out); } fclose(out); @@ -167,7 +167,7 @@ restore(const char *infile) for (p = save_array; p->address != NULL; p++) { fread(p->address, p->width, 1, in); for (s = p->address, i = 0; i < p->width; i++, s++) - *s = (*s ^ random()) & 0xFF; /* Lightly decrypt */ + *s = (*s ^ random()) & 0xFF; /* deobfuscate */ } fclose(in); diff --git a/games/adventure/setup.c b/games/adventure/setup.c index cab495bcd7a..9db2d1c5a90 100644 --- a/games/adventure/setup.c +++ b/games/adventure/setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setup.c,v 1.9 2009/10/27 23:59:23 deraadt Exp $ */ +/* $OpenBSD: setup.c,v 1.10 2014/07/13 19:40:57 tedu Exp $ */ /* $NetBSD: setup.c,v 1.2 1995/03/21 12:05:10 cgd Exp $ */ /*- @@ -36,7 +36,7 @@ /* * Setup: keep the structure of the original Adventure port, but use an * internal copy of the data file, serving as a sort of virtual disk. It's - * lightly encrypted to prevent casual snooping of the executable. + * lightly obfuscated to prevent casual snooping of the executable. * * Also do appropriate things to tabs so that bogus editors will do the right * thing with the data file. diff --git a/games/adventure/vocab.c b/games/adventure/vocab.c index 5326c962fb4..683f9a08747 100644 --- a/games/adventure/vocab.c +++ b/games/adventure/vocab.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vocab.c,v 1.13 2009/10/27 23:59:23 deraadt Exp $ */ +/* $OpenBSD: vocab.c,v 1.14 2014/07/13 19:40:57 tedu Exp $ */ /* $NetBSD: vocab.c,v 1.2 1995/03/21 12:05:13 cgd Exp $ */ /*- @@ -154,7 +154,7 @@ vocab(const char *word, int type, int value) for (s = word, t = h->atab; *s;) *t++ = *s++ ^ '='; *t = 0 ^ '='; - /* encrypt slightly to thwart core reader */ + /* obfuscate slightly to frustrate core reader */ /* printf("Stored \"%s\" (%d ch) as entry %d\n", */ /* word, length(word), adr); */ return (0); /* entry unused */ -- 2.20.1