Get the App
SLTechnology News&Howtos  ›  Development  › 

How to understand PHP encryption function Javascript/Js decryption function

Shulou Source: shulou.com Published: 2022-06-03 07:37:46 10月11日 Update

This article focuses on "how to understand the PHP encryption function Javascript/Js decryption function", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "how to understand the PHP encryption function Javascript/Js decryption function"!

"123456" in the following function code is an encrypted key, which you can change at will.

Php encryption, js decryption, seems to be meaningless, mainly key will be seen in js.

But it may be used in some places.

PHP encryption function

The copy code is as follows:

Js decryption function:

The copy code is as follows:

Function strencode (string) {

Key = calcMD5 ('123456')

String = Base64.decode (string)

Len = key.length

Code =''

For (I = 0; I < string.length; iTunes +) {

K = I% len

Code + = String.fromCharCode (string.charCodeAt (I) ^ key.charCodeAt (k))

}

Return Base64.decode (code)

}

Alert (strencode ('PGZ6Cz40Z1JCWCYNRVtSDwsvfVsIexpcEFN0DU0OSQkXQUIPCQxnV1NLDA9SSw8PF1JhWxAHZ18FAGIncUFiFS5yWxAuClxUf15fXA=='))

PHP encryption & JS decryption 2

The copy code is as follows:

Tags: Function encryption code content learning practical deeper nothing hello interest place practicality practical meaning simple operation method more friends bit by bit website Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Redmi Docker OPPO Reno MySQL