Last active
April 21, 2024 04:12
-
-
Save leomastoras/d843eb336abee9c036ecb871774a0ac9 to your computer and use it in GitHub Desktop.
JavaScript Invisible Code
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
// Transforms any text to a zero width string thus | |
// making it invisible | |
// Call with 2nd param true to decode invisible text | |
// into original | |
// ------------------------------ | |
// masterleo@gmail.com 18/11/2021 | |
const ghost = ($,ǃ) => (($,ǃ,g,h,o,s,t)=>( | |
[g][g][g]('λ={'+`${[][g](124)}` | |
[o](/./g,(λ,x)=>λ[g][h](x)) | |
[o](/[^a-z\d+/=]/gi,'') | |
[o](/./g,(λ,x)=>`"${λ}":"${s=λ[g][h](8288+x/16|0,8288+x%16)}","${s}":"${λ}",`) | |
[o](/,$/,'};'))(), t=λ, | |
ǃ.at() == 'e' ? | |
btoa(window[ǃ]($))[o](/./g,λ=>t[λ]) : | |
window[ǃ](atob($[o](/../g,λ=>t[λ]))) | |
)) | |
($,(ǃ?'de':'en')+'codeURI','constructor','fromCodePoint','replace'); | |
//make sample code invisible | |
let hidden = ghost("open`https://youtu.be/dQw4w9WgXcQ`"); | |
console.log(hidden); | |
//reveal hidden code | |
let shown = ghost(hidden, true); | |
console.log(shown, true); | |
// execute | |
\u0065val(shown); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment