; Load the cypher UDF
Call 'path\cypher.k61' ; NOTE - This is pre-tokenized - use the correct version!
; rest of your code inits go here...
; Read and decrypt the password from an INI file
; Note that the extension is .CFG and not .INI, the section is "NETCMD", and
; the value read is "PVal". This simply makes the data less obvious as
; the file is plain text.
$Password = ReadProfileString('path\startup.cfg', 'NETCMD', 'PVal')
; decrypt the password using a pre-defined key.
; Permanent/embedded key - the script must be edited, tokenized, and distributed to change this
;$CypherKey = 704
; Stored Key - can be written when the password is encoded and can be changed anytime
; When I use this method, I don't use this value directly but have some permanent
; value in the scripts that adds, subtracts, or otherwise alters this by a fixed amount,
; thus, this external value is only part of the key. In this example, I treat the key
; as a string and add a digit to the beginning and end
$CypherKey = Val('8' + ReadProfileString('path\startup.cfg', 'NETCMD', 'CVal') + '5')
; Cycle Length (# of "codewheels") - set to 0 for default of 2048
$Len = 0
; Set the direction (1=encode,0=decode in this example, must be opposite of value used when encoding)
; This can also be read from the .CFG file
$Dir = 0
; Now we can decrypt the Password
$Password = Cypher($Password, $CypherKey, $Dir, $Len)
; with the password now stored in the variable in clear text, the rest of your script
; can continue here..