1、加密global type f_encrypt from function_objectend typeforward prototypesglobal function string f_encrypt (string st_text, string st_key)end prototypesglobal function string f_encrypt (string st_text, string
2、// Function: uf_pub_encrypt() *// Descirption: 用给定的密钥加密字符串 *// Parameters: string st_text 待加密字串 *// string st_key 密钥 *// *// Return: <加密后字串> *// *// Author: rain *// Date: 2002.11.05 *
3、string st_textencryptlong lg_textlen,lg_keylen,lg_keylong lg_loopIF isnull(st_key) OR isnull(st_text) THEN RETURN ''lg_keylen = len(st_key)FOR lg_loop = 1 TO lg_keylenlg_key = lg_key + (asc(mid(st_key,lg_loop,1)) * lg_loop)IF lg_key > 255 THEN lg_key = lg_key - 255
4、NEXTDO While lg_key > 255lg_氯短赤亻key = lg_key - 255LOOPLONG lg忧溲枷茫_cbytelg_textlen = Len(st_text)FOR lg_loop = 1 TO lg_textlenlg_cbyte = asc(mid(st_text,lg_loop,1)) + lg_keyIF lg_cbyte > 255 THEN lg_cbyte = lg_cbyte - 255
5、st_textencrypt = st_textencrypt + char(lg_cbyte)lg_key = lg_key + lg_cbyteIF lg_key > 255 THEN lg_key = lg_key - 255NEXTRETURN st_textencryptend function
6、//解密global type f_decrypt from function_objectend typeforward prototypesglobal function string f_decrypt (string st_text, string st_key)end prototypesglobal function string f_decrypt (string st_text, string