A simple and practical VB encryptiondecryption algorithm

zhaozj2021-02-08  253

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 = LEN (Password) IL_X = 0 IL_Y = 0 IS_OUT = "" for i = 1 to il_len il_bit = ASCW (MID (Password, I, 1)) 'W Series Support Unicode IL_Y = (IL_bit * 13 MOD 256) IL_X IS_OUT = IS_OUT & ChRW (FIX (IL_Y))' Take INT and FIX Differences : FIX correction negative IL_X = IL_bit * 13/256 next is_out = is_out & chrw (fix (il_x)) password = IL_EL_LEN = LEN (Password) IL_X = 0 IL_Y = 0 is_OUT = "" for i = 1 to il_len il_bit = ASCW (MID (Password, I, 1)) 'Take the first 4-bit value IL_Y = IL_bit / 16 64 is_out = is_out & chrw (fix (il_y))' Take the 4-bit value IL_Y = (IL_bit MOD 16) 64 IS_OUT = IS_OUT & ChRW (FIX (IL_Y)) Next UserCode = IS_OUTEND FUNCTIONFUNCTION AS STRING 'Password Decryption DIM IS_OUT AS STRING DIM IL_X, IL_Y, IL_LEN, I, IL_BIT AS LONG

IL_LEN = LEN (Password) IL_X = 0 IL_Y = 0 IS_OUT = "" for i = 1 to il_len step 2 = 1 to = ascw (MID (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 ASCW (MID (Password, i 1, 1)) - 64 is_out = is_out & chrw (IL_Y) Next

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

IL_LEN = LEN (Password) IL_X = ASCW (MID (Password, IL_LEN, 1))

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

New Post(0)