0% found this document useful (0 votes)
84 views3 pages

En Cripta Dor

This document defines several public functions for encrypting, decrypting, and retrieving strings and keys. The of_set function encrypts a raw string using a key. The of_getraw and of_getencrypted functions return the raw and encrypted strings. The of_setkey function sets the encryption key. Other functions allow decrypting strings, retrieving a hardcoded password, and getting database configuration labels.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views3 pages

En Cripta Dor

This document defines several public functions for encrypting, decrypting, and retrieving strings and keys. The of_set function encrypts a raw string using a key. The of_getraw and of_getencrypted functions return the raw and encrypted strings. The of_setkey function sets the encryption key. Other functions allow decrypting strings, retrieving a hardcoded password, and getting database configuration labels.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

string is_raw string is_encrypted string is_key="CGI" Public function of_set (string thestr) returns string Public function

of_getraw (none) returns string Public function of_getencrypted (none) returns string Public function of_setkey (string thekey) returns string Public function of_set (string thetext,string thekey) returns string Public function of_decrypt (string thetext,string thekey) returns string Public function of_key_pass (none) returns string Public function of_decrypt (string thestr) returns string Public function of_getlabel (ref string as_segmento,ref string as_database,ref s tring as_logid,ref string as_servername,ref string as_dbparm,ref string as_passw ord,ref string as_serverip) returns (none) //Public function of_set (string thestr) returns string //string thestr string retval string tempstr string tstr integer sourceptr integer keyptr integer keylen integer sourcelen integer tempval integer tempkey retval = THIS.is_raw THIS.is_raw = thestr keyptr = 1 keylen = len(THIS.is_key) sourcelen = len(THIS.is_raw) THIS.is_encrypted = "" FOR sourceptr = 1 TO sourcelen //6 tempval = asc(right(THIS.is_raw,sourcelen - sourceptr + 1)) tempkey = asc(right(THIS.is_key,keylen - keyptr + 1)) tempval += tempkey DO WHILE tempval > 255 //10 IF tempval > 255 THEN //11 tempval = tempval - 255 END IF //11 LOOP //10 tstr = char(tempval) THIS.is_encrypted = THIS.is_encrypted + tstr keyptr ++ IF keyptr > len(THIS.is_key) THEN keyptr = 1 NEXT //6 RETURN THIS.is_encrypted //Public function of_getraw (none) returns string RETURN THIS.is_raw //Public function of_getencrypted (none) returns string

RETURN THIS.is_encrypted //Public function of_setkey (string thekey) returns string //string thekey string retval retval = THIS.is_key THIS.is_key = thekey RETURN retval //Public function of_set (string thetext,string thekey) returns string //string thetext //string thekey of_setkey(thekey) RETURN of_set(thetext) //Public function of_decrypt (string thetext,string thekey) returns string //string thetext //string thekey of_setkey(thekey) RETURN of_decrypt(thetext) //Public function of_key_pass (none) returns string RETURN "PASSWORD" //Public function of_decrypt (string thestr) returns string //string thestr string retval string tempstr string tstr integer sourceptr integer keyptr integer keylen integer sourcelen integer tempval integer tempkey THIS.is_encrypted = thestr keyptr = 1 keylen = len(THIS.is_key) sourcelen = len(THIS.is_encrypted) THIS.is_raw = "" FOR sourceptr = 1 TO sourcelen //5 tempval = asc(right(THIS.is_encrypted,len(THIS.is_encrypted) - sourceptr + 1)) tempkey = asc(right(THIS.is_key,len(THIS.is_key) - keyptr + 1)) tempval -= tempkey DO WHILE tempval < 0 //9 IF tempval < 0 THEN //10

tempval = tempval + 255 END IF //10 LOOP //9 tstr = char(tempval) THIS.is_raw = THIS.is_raw + tstr keyptr ++ IF keyptr > len(THIS.is_key) THEN keyptr = 1 NEXT //5 retval = THIS.is_raw RETURN retval //Public function of_getlabel (ref string as_segmento,ref string as_database,ref string as_logid,ref string as_servername,ref string as_dbparm,ref string as_pas sword,ref string as_serverip) returns (none) //string as_segmento //string as_database //string as_logid //string as_servername //string as_dbparm //string as_password //string as_serverip as_segmento = "DB_SIGAMEF" as_database = "2" as_logid = "5" as_serverip = "3" as_dbparm = "1" as_password = "4" as_servername = "6"

You might also like