Simple encryption decryption original shape

xiaoxiao2021-03-06  61

'encryption:

'Applicable to any character, "&" "" "" "" "" "" "" "" "" "" Chinese character, etc.

'Simply encrypt, you can transform into displacement encryption, such as an increase in each character ASC code value or reduced a number

'Can be transformed into shift random encryption.

'For example, there is a random number in front of each character, indicating that the character ASC code value increases or decreases this random number.

Function encode (x)

For i = 1 to len (x)

Tempnum = HEX (ASC (MID (X, I, 1)))))

IF LEN (TEMPNUM) = 4 THEN

ENCODE = Encode & CSTR (Tempnum)

Else

Encode = Encode & "00" & CSTR (Tempnum)

END IF

NEXT

END FUNCTION

'Decryption:

Function decode (x)

For i = 1 to Len (x) STEP 4

Decode = decode & chr (int ("& H" & MID (x, i, 4))))))

NEXT

END FUNCTION

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

New Post(0)