pb加密解密方法
1、加密
global type f_encrypt from function_object
end type
forward prototypes
global function string f_encrypt (string st_text, string st_key)
end prototypes
global 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_textencrypt
long lg_textlen,lg_keylen,lg_key
long lg_loop
IF isnull(st_key) OR isnull(st_text) THEN RETURN ''
lg_keylen = len(st_key)
FOR lg_loop = 1 TO lg_keylen
lg_key = lg_key + (asc(mid(st_key,lg_loop,1)) * lg_loop)
IF lg_key > 255 THEN lg_key = lg_key - 255
4、NEXT
DO While lg_key > 255
lg_key = lg_key - 255
LOOP
LONG lg_cbyte
lg_textlen = Len(st_text)
FOR lg_loop = 1 TO lg_textlen
lg_cbyte = asc(mid(st_text,lg_loop,1)) + lg_key
IF lg_cbyte > 255 THEN lg_cbyte = lg_cbyte - 255
5、st_textencrypt = st_textencrypt + char(lg_cbyte)
lg_key = lg_key + lg_cbyte
IF lg_key > 255 THEN lg_key = lg_key - 255
NEXT
RETURN st_textencrypt
end function
6、//解密
global type f_decrypt from function_object
end type
forward prototypes
global function string f_decrypt (string st_text, string st_key)
end prototypes
global function string f_decrypt (string st_text, string