05-25 days

zhaozj2021-02-08  252

After watching the netizen Everjoe commented, I improved the program, in fact, the W series function is replaced with a B series, and then supports Chinese encryption.

The revised all code enters:

Function Usercode (Password As String) AS String 'User Password Encryption DIM IL_bit, IL_X, IL_Y, IL_Z, IL_LEN, I AS Long Dim IL_OUT AS STRING IL_LEN = LeNB (Password) IL_X = 0 IL_Y = 0 IS_OUT = "" "for i = 1 to il_len il_bit = ASCB (MIDB (Password, I, 1)) 'B series support Chinese IL_Y = (IL_bit * 13 mod 256) IL_X IS_OUT = IS_OUT & ChRB (FIX (IL_Y))' Take INT and FIX Differences : FIX correction negative IL_X = IL_bit * 13/256 Next IS_out = IS_OUT & ChRB (fix (il_x)) Password = IL_EL_LEN = lenb (password) IL_X = 0 IL_Y = 0 is_out = "" for i = 1 to il_len il_bit = ASCB (MIDB (Password, I, 1)) 'Take the first 4-bit value IL_Y = IL_bit / 16 64 IS_OUT = IS_OUT & ChRB (fix (IL_Y))' Take 4-bit value IL_Y = (IL_bit MOD 16) 64 Is_out = is_out & chrb (fix (il_y)) Next UserCode = IS_OUTEND FUNCTION

Function UserDecode (Password As String) AS String 'Password Decryption DIM IS_OUT AS STRING DIM IL_X, IL_Y, IL_LEN, I, IL_BIT AS LONG

IL_LEN = lenb (password) IL_X = 0 IL_Y = 0 is_out = "" for i = 1 to il_len step 2 IL_bit = ASCB (MIDB (Password, I, 1)) 'Take the first 4-bit value IL_Y = (IL_bit - 64) * 16 'Take 4 digits value' DD = ASCW (MID (Password, i 1, 1)) - 64 IL_Y = IL_Y ASCB (MIDB (Password, i 1, 1) - 64 is_out = is_out & chrb (IL_Y) Next

IL_X = 0 IL_Y = 0 password = IS_OUT IS_OUT = ""

转载请注明原文地址:https://www.9cbs.com/read-1241.html

New Post(0)