home *** CD-ROM | disk | FTP | other *** search
- Welcome to the incredibly flexible Cydec module! With it you will be able
- to encrypt/decrypt IFF graphics and sound files using YOUR OWN ENCRYPTION
- ALGORITHMS! You may even decide to come up with multiple encryption types.
- Or you can opt to simply use the method supplied in the cydec.c file. The
- key to this operation is that the loadILBM and load_iff_sound functions
- call the cydec module to identify encryption techniques, and, if identified,
- call your decrytion function when reading data. All you need do to make
- this work is simply link your programs with the cydec.o module. However,
- for unencrypted applications, you need not link with this module, as the stub
- functions supplied in the library will simply not recognize any encryption
- techniques. Also supplied are the programs gs_cypher and gs_decypher. As
- you probably guessed, these programs allow you to encrypt or decrypt files.
- They automatically recognize ILBM graphics files and 8SVX sound files.
- The encryption program gs_cypher calls the cydec module for an ID to be used
- with the file, then calls your encryption function when rewriting the data.
- Since the resultant file is rewritten (via a temporary file while writing) and
- the original version destroyed, you can decrypt it with the gs_decypher
- program. This will restore the file to it's original form. If you change the
- cydec.c module (or write an equivelent assembler module), you'll need to
- relink gs_cypher.obj and gs_decypher.obj to recreate these programs.
-
-
- FILE TYPES:
-
- IFF ILBM = 0
- IFF 8SVX = 1
-
-
- ENCRYPTION PROCESS:
-
- 1) gs_cypher calls gs_cypher_block with the file type to get an encryption
- header. Make sure this is unique, as this header is used to identify
- your encryption method. The header may be any length up to 4096 bytes.
- This call is the key to resetting and selecting the encryption algorithm.
- Subsequent calls to the encryption function must assume that the proper
- encryption algorithm is the one selected with the last call to
- gs_cypher_block.
- 2) While rewriting the data file, gs_cypher calls gs_encrypt_data to
- process the data before writing it back out.
-
-
- DECRYPTION PROCESS:
-
- 1) The loadILBM function or the load_iff_sound function calls
- gs_identify_cypher with the header found in the file, and its length.
- If your program recognizes the header, then subsequent calls to the
- decryption function must assume this decryption algorithm. Again,
- when gs_identify_cypher is called, this is your key to reset the
- algorithm.
- 2) The loadILBM function or the load_iff_sound function calls
- gs_decrypt_data if the encryption method was properly identified.
-
-
- THE LINK PROCESS (examples):
-
- execute the cypher.link script provided in the GameSmith directory to
- rebuild the gs_cypher and gs_decypher programs. See notes in the script
- itself for linking with a compiler or assembler system other than SAS.
-
- slink lib:c.o myprogram.o cydec.o lib lib:sc.lib,GameSmith:GameSmith.lib
-
-
- HINTS:
-
- Even if you don't want to change the algorithm, change the header string
- slightly in the cydec.c module. This will make your encrypted files your own.
- Nobody else will be able to use them. Remember to relink with gs_cypher.obj
- and gs_decypher.obj before encrypting you files!
-
- If you change the encryption algorithm intended for sound files, test out the
- encrypted version using the SND program supplied on the example disk (without
- relinking it to recognize your encryption method). It should sound nothing
- like the original file (like the default encryption method will do).
-
- WARNING! *NEVER* change the cydec_proto.h file. The cydec functions will
- always be called in the same manner by loadILBM, load_iff_sound, gs_cypher,
- and gs_decypher.
-