PluginProbe
CryptX / 3.4.3
CryptX v3.4.3
4.2.1 4.2.0 4.1.1 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.9 2.0 2.1 2.2 2.3 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 All 93 releases
cryptx / js / cryptx.js

cryptx.js in CryptX 3.4.3, at js/cryptx.js

38 lines 944 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const UPPER_LIMIT = 8364;
2 const DEFAULT_VALUE = 128;
3
4 /**
5 * Decrypts an encrypted string using a specific encryption algorithm.
6 *
7 * @param {string} encryptedString - The encrypted string to be decrypted.
8 * @returns {string} The decrypted string.
9 */
10 function DeCryptString(encryptedString) {
11 let charCode = 0;
12 let decryptedString = "mailto:";
13 let encryptionKey = 0;
14
15 for (let i = 0; i < encryptedString.length; i += 2) {
16 encryptionKey = encryptedString.substr(i, 1);
17 charCode = encryptedString.charCodeAt(i + 1);
18
19 if (charCode >= UPPER_LIMIT) {
20 charCode = DEFAULT_VALUE;
21 }
22
23 decryptedString += String.fromCharCode(charCode - encryptionKey);
24 }
25
26 return decryptedString;
27 }
28
29 /**
30 * Redirects the current page to the decrypted URL.
31 *
32 * @param {string} encryptedUrl - The encrypted URL to be decrypted and redirected to.
33 * @return {void}
34 */
35 function DeCryptX( encryptedUrl )
36 {
37 location.href=DeCryptString( encryptedUrl );
38 }