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_DECODEST( <cString> | <cMemvar> [, <nLength> ] )


Parameters

<cString>
Character string to decrypt.

<cMemvar>
Alternative to <cString>. Memory variable containing a string to 
decrypt.

<nLength>
Length of the string.


Returns

The resulting decrypted string.


Description

The specified string is decrypted with the current N_SETKEY(). 
N_SETKEY() must be set to the same key as was originally used to 
encrypt the data. N_DECODEST() does not verify that you have set the 
correct key.

If the encrypted string is passed as a memory variable, the resulting 
unencrypted string is stored in the memory variable. If <nLength> is 
specified, then the first <nLength> characters of the string will be 
decrypted. If <nLength> is omitted, or if it is greater than the length 
of the string, then the entire string will be decrypted.

Note  Encrypting or decrypting does not change the length of the 
data.


Example

// Read and decrypt an encrypted text file
nHandle = FOPEN('memo.txt')
// Get length of file
nLength = FSEEK(nHandle, 0, 2)

// Back to BOF
FSEEK(nHandle, 0, 0)

// Read encrypted data
cBuffer = SPACE(nLength)
FREAD(nHandle, @cBuffer, nLength)

N_SETKEY(cKeyValue)
// Decrypt
N_DECODEST(@cBuffer, nLength)


See Also: N_ENCODEST() N_SETKEY()

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