Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - <u>if you are upgrading from an earlier version of netlib, you must </u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
If you are upgrading from an earlier version of NetLib, you must 
Convert your old encrypted files before using any encryption 
functions in NetLib 6.0.

To convert your old files, use the utility OLDNEW.PRG provided on 
your installation diskette. Or, if you prefer, decode existing 
encrypted files using the old version of N_DECODE, which remains in 
the library under a new name, _N_DECODE().


Syntax

N_DECODE( <cSource>, <cTarget> )


Parameters

<cSource>
Name of the encrypted file. A path may be included.

<cTarget>
Name for the unencrypted file. A path may be included.


Returns

True if the operation completed successfully.
False if the file does not exist or could not be opened.


Description

A new, unencrypted file is created using the name specified in 
<cTarget>. The source file is left unchanged to ensure that it remains 
uncorrupted if an I/O error should occur during decryption. If 
decryption is successful, you can delete the encrypted source.

Files being decrypted must not be in use on any station, including the 
current one.

Before attempting to decrypt a file, you must first set the key used to 
encrypt it by calling N_SETKEY(). Once you have set the encryption key, 
you can verify that it is the correct key for the file by calling 
N_CODELVL().

When decrypting a DBF file, remember to decrypt the associated .NTX. 
and .DBT files if you plan to use them.


Example

// First set the encryption key.
N_SETKEY(cKeyValue)

// Then check if file was encrypted with current key.
IF N_CODELVL('encode.dbf') = 2

   // Decrypt to a new file.
   IF N_DECODE('encode.dbf' , 'clear.dbf')
      ? 'File successfully decrypted.'

   ELSE
      ? 'Decryption failed.'

   ENDIF
ENDIF



See Also: N_CODELVL() N_ENCODE() N_SETKEY()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson