;; | --------------------------------------------------------------------------- ;; | MI_Encrypt - Encrypt a String using the DosLib function ;; | --------------------------------------------------------------------------- ;; | Arguments: 'Str' - String to be encrypted ;; | 'Key' - Encryption Key ;; | Returns : The encrypted String ;; | Updated : August 11, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun MI_Encrypt( Str Key / fptr tmp _Str ) (setq tmp (MI_GetTempDir) _Str nil ) (if tmp (progn (setq tmp (strcat tmp "$GeoToolsTemp$.tmp") fptr (open tmp "w") ) (if fptr (progn (write-line Str fptr) (close fptr) (if (dos_encrypt tmp Key) (progn (setq fptr (open tmp "r")) (if fptr (progn (setq _Str (read-line fptr)) (close fptr) )) ) (princ "\nError: Encryption NOT successful.") ) (vl-file-delete tmp) ) (princ "\nError: Could not open temporary file.") ) ) (alert "Internal error: Windows TEMP directory has not been set. Please set this directory before resuming.") ) _Str )