Last active
May 30, 2024 17:00
-
-
Save zedd3v/1585403f43265cdca88a3afa47bd45c8 to your computer and use it in GitHub Desktop.
PerimeterX Payload decode & encode functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface EncodeOptions { | |
shift?: boolean; | |
shiftAmount?: number; | |
base64?: boolean; | |
} | |
export interface DecodeOptions extends EncodeOptions {} | |
export const decodePayload = (payload: string, options: DecodeOptions = {}): string => { | |
let { shift, base64, shiftAmount } = options; | |
base64 ??= true; | |
shift ??= true; | |
shiftAmount ??= 50; | |
const string = base64 ? Buffer.from(payload, 'base64').toString() : payload; | |
let d = ''; | |
for (let i = 0; i < string.length; i++) { | |
d += shift ? String.fromCharCode(string.charCodeAt(i) ^ shiftAmount) : string[i]; | |
} | |
return d; | |
}; | |
export const encodePayload = (payload: string, options: EncodeOptions = {}): string => { | |
let { shift, base64, shiftAmount } = options; | |
base64 ??= true; | |
shift ??= true; | |
shiftAmount ??= 50; | |
let e = ''; | |
for (let i = 0; i < payload.length; i++) { | |
e += shift ? String.fromCharCode(payload.charCodeAt(i) ^ shiftAmount) : payload[i]; | |
} | |
return base64 ? Buffer.from(e).toString('base64') : e; | |
}; |
It was updated to a new encryption; will not be released yet
If you need a quick decoding tool, use my website https://antibot.io/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@zedd3v
I tried your code, it partially decoded the final output. Is there anyway to contact you via email?