home *** CD-ROM | disk | FTP | other *** search
- /*********************
- *
- * ut_crypt.c - data encryption functions.
- *
- * Purpose: This file contains an encryption routine for single byte
- * encoding and decoding of data.
- *
- * Blackstar C Function Library
- * (c) Copyright 1985,1989 Sterling Castle Software
- *
- *******/
-
- #include "blackstr.h"
-
-
- /********
- *
- * ut_crypt(buff,key,nbytes) - encrypt buffer of nbytes using key
- *
- **/
-
- void ut_crypt(char *buff, char key, int nbytes)
- {
- int i;
-
- for (i=0; i<nbytes; ++i) {
- if(*buff)
- *buff^= key; /* use bitwise xor */
- ++buff;
- }
- }
-