Doubt in unescape encryption

-1

I have this script on the site, but this short excerpt is encrypted and I wanted to change it because it is an email to contact. When I change this part that is encrypted, the text gets scrambled and meaningless; how would I have to proceed to make the change in the right format?

        function contact() {
            prompt('You can contact us at:', unescape(('636f6e746163744069702d6170692e636f6d').replace(/(..)/g, '%$1')));
            return false
        }
    
asked by anonymous 15.07.2017 / 23:18

1 answer

0

This is not encryption, far from it. For encryption it should at least have a key, which does not exist.

Only seeing 636f6e746163744069702d6170692e636f6d already says that this is a hexadecimal (after all goes from 0 to F), with almost total certainty.

unescape works using % following two-digit hexadecimal ("% HH", where HH is hexadecimal), as other languages use \x (I believe most others also use this format). This is why replace(/(..)/g, '%$1') exists, just to add the % to every two characters, making a hexadecimal valid for Javascript.

So the email is exactly [email protected] . If you want to change this email simply code / convert the value to hexadecimal, for example using:

function hexx(str) {
  hex = '';

  for (var i = 0; i < str.length; i++) {
    hex += str.charCodeAt(i).toString(16);
  }

  document.getElementsByTagName("exibe")[0].innerHTML = "unescape(('" + hex + "').replace(/(..)/g, '%$1'));";

}
<input onkeyup="hexx(this.value)"><br>
<exibe></exibe>
    
17.07.2017 / 14:43