Simplest way to obfuscate and deobfuscate a string in JavaScript

前端 未结 3 1522
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 17:04

I\'m looking for a way to obfuscate and deobfuscate a string in JavaScript; by which I mean encryption and decryption when security is not an issue. Ideally something native

3条回答
  •  没有蜡笔的小新
    2020-12-04 17:27

    It's worth noting that

    (![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]

    evaluates to the string "fail" without ever looking like a string. Seriously, enter it into node and be amazed. You can spell anything in JavaScript by being crazy.

提交回复
热议问题