Doubts about encrypted JS code

4

I wanted to know if this code is encrypted here:

$(document)["\x72\x65\x61\x64\x79"](function(){$("\x23\x6A\x71\x75\x65\x72\x79\x5F\x6A\x70\x6C\x61\x79\x65\x72\x5F\x31")["\x6A\x50\x6C\x61\x79\x65\x72"]({ready:function(event){$(this)["\x6A\x50\x6C\x61\x79\x65\x72"]("\x73\x65\x74\x4D\x65\x64\x69\x61",{oga:"\x68\x74\x74\x70\x3A\x2F\x2F\x36\x34\x2E\x33\x31\x2E\x33\x30\x2E\x39\x31\x3A\x39\x38\x39\x36\x2F\x3B\x73\x74\x72\x65\x61\x6D\x2F\x31"})},swfPath:"\x6A\x73",supplied:"\x6F\x67\x61",wmode:"\x77\x69\x6E\x64\x6F\x77",smoothPlayBar:true,keyEnabled:true})});$(function(){if( typeof playlist==="\x75\x6E\x64\x65\x66\x69\x6E\x65\x64"){playlist=[{artist:"\x6F\x75\x72\x6F",title:"\x54\x65\x63\x68\x6E\x6F\x6C\x6F\x67\x69\x63",mp3:"\x68\x74\x74\x70\x3A\x2F\x2F\x36\x34\x2E\x33\x31\x2E\x33\x30\x2E\x39\x31\x3A\x39\x38\x39\x36\x2F\x3B\x73\x74\x72\x65\x61\x6D\x2F\x31"},{artist:"\x44\x61\x66\x74\x20\x50\x75\x6E\x6B",title:"\x48\x75\x6D\x61\x6E\x20\x41\x66\x74\x65\x72\x20\x41\x6C\x6C",mp3:"\x68\x74\x74\x70\x3A\x2F\x2F\x63\x6F\x6E\x65\x63\x74\x72\x61\x64\x69\x6F\x2E\x63\x6F\x6D\x2E\x62\x72\x2F\x70\x6C\x61\x79"}]};var currentTrack=0;var numTracks=playlist["\x6C\x65\x6E\x67\x74\x68"];$("\x2E\x70\x6C\x61\x79\x65\x72\x2D\x6E\x65\x78\x74")["\x63\x6C\x69\x63\x6B"](function(){player["\x70\x6C\x61\x79\x4E\x65\x78\x74"]()});$("\x2E\x70\x6C\x61\x79\x65\x72\x2D\x70\x72\x65\x76")["\x63\x6C\x69\x63\x6B"](function(){player["\x70\x6C\x61\x79\x50\x72\x65\x76\x69\x6F\x75\x73"]()});player=$("\x2E\x70\x6C\x61\x79\x65\x72")["\x6A\x50\x6C\x61\x79\x65\x72"]({ready:function(){player["\x6A\x50\x6C\x61\x79\x65\x72"]("\x73\x65\x74\x4D\x65\x64\x69\x61",playlist[currentTrack]);player["\x70\x6C\x61\x79\x43\x75\x72\x72\x65\x6E\x74"]();},ended:function(){$(this)["\x70\x6C\x61\x79\x4E\x65\x78\x74"]()},play:function(){$("\x2E\x70\x6C\x61\x79\x65\x72\x2D\x63\x75\x72\x72\x65\x6E\x74\x2D\x74\x72\x61\x63\x6B")["\x74\x65\x78\x74"](playlist[currentTrack]["\x61\x72\x74\x69\x73\x74"]+"\x20\x2D\x20"+playlist[currentTrack]["\x74\x69\x74\x6C\x65"])},swfPath:"\x6A\x73\x2F\x70\x6C\x75\x67\x69\x6E\x73\x2F\x6A\x70\x6C\x61\x79\x65\x72\x2F",supplied:"\x6D\x70\x33",cssSelectorAncestor:"",cssSelector:{play:"\x23\x62\x74\x5F\x70\x6C\x61\x79",pause:"\x23\x62\x74\x5F\x70\x61\x75\x73\x65",stop:"\x23\x62\x74\x5F\x70\x61\x75\x73\x65",seekBar:"\x2E\x70\x6C\x61\x79\x65\x72\x2D\x74\x69\x6D\x65\x6C\x69\x6E\x65",playBar:"\x2E\x70\x6C\x61\x79\x65\x72\x2D\x74\x69\x6D\x65\x6C\x69\x6E\x65\x2D\x63\x6F\x6E\x74\x72\x6F\x6C"},size:{width:"\x31\x70\x78",height:"\x31\x70\x78"}});player["\x70\x6C\x61\x79\x4E\x65\x78\x74"]=function(){currentTrack=(currentTrack==(numTracks-1))?0:++currentTrack;player["\x70\x6C\x61\x79\x43\x75\x72\x72\x65\x6E\x74"]();};player["\x70\x6C\x61\x79\x50\x72\x65\x76\x69\x6F\x75\x73"]=function(){currentTrack=(currentTrack==0)?numTracks-1:--currentTrack;player["\x70\x6C\x61\x79\x43\x75\x72\x72\x65\x6E\x74"]();};player["\x70\x6C\x61\x79\x43\x75\x72\x72\x65\x6E\x74"]=function(){player["\x6A\x50\x6C\x61\x79\x65\x72"]("\x73\x65\x74\x4D\x65\x64\x69\x61",playlist[currentTrack])["\x6A\x50\x6C\x61\x79\x65\x72"]("\x70\x6C\x61\x79")};});

If yes, how can I decrypt it?

    
asked by anonymous 10.11.2015 / 19:06

4 answers

10

The code is not encrypted, only partially obfuscated. Whoever did this took advantage of the fact that JavaScript strings can contain any escaped UTF-16 character in \xNN format, where NN is the hexadecimal character code.

If you actually encrypt a JS code, it will no longer be usable because browsers would not be able to interpret it. So the only solution to try to make it difficult to code properly is to dazzle it, which is not much use since it is easily reversible.

    
10.11.2015 / 19:21
3

It is a type of obfuscator , can be done through online service also like this: link

I have seen some that work through npm, for example, but I never got the same result from this online. I never went deep into the subject, but I always used that online that always served well, always ran correctly online and everything.

But I repeat, I never went deep into the subject and, as far as I know, I never found a tool that could reverse this obfuscator .

Edit:

Note that this type of encryption is different from an 'uglify' that will only roughly 'rename' its functions.

Edit2:

Based on the other answers, I have seen that it does not work the way I had learned.

    
10.11.2015 / 19:11
2

It is in Hexadecimal. I asked myself why they do that.

link

This site above decrypts. From what I've seen are the names of the encrypted elements.

Looking like this:

$(document)["ready"](function() {
    $("#jquery_jplayer_1")["jPlayer"]({
        ready: function(event) {
            $(this)["jPlayer"]("setMedia", {
                oga: "http://64.31.30.91:9896/;stream/1"
            })
        },
        swfPath: "js",
        supplied: "oga",
        wmode: "window",
        smoothPlayBar: true,
        keyEnabled: true
    })
});
$(function() {
    if (typeof playlist === "undefined") {
        playlist = [{
            artist: "ouro",
            title: "Technologic",
            mp3: "http://64.31.30.91:9896/;stream/1"
        }, {
            artist: "Daft Punk",
            title: "Human After All",
            mp3: "http://conectradio.com.br/play"
        }]
    };
    var currentTrack = 0;
    var numTracks = playlist["length"];
    $(".player-next")["click"](function() {
        player["playNext"]()
    });
    $(".player-prev")["click"](function() {
        player["playPrevious"]()
    });
    player = $(".player")["jPlayer"]({
        ready: function() {
            player["jPlayer"]("setMedia", playlist[currentTrack]);
            player["playCurrent"]();
        },
        ended: function() {
            $(this)["playNext"]()
        },
        play: function() {
            $(".player-current-track")["text"](playlist[currentTrack]["artist"] + " - " + playlist[currentTrack]["title"])
        },
        swfPath: "js/plugins/jplayer/",
        supplied: "mp3",
        cssSelectorAncestor: "",
        cssSelector: {
            play: "#bt_play",
            pause: "#bt_pause",
            stop: "#bt_pause",
            seekBar: ".player-timeline",
            playBar: ".player-timeline-control"
        },
        size: {
            width: "1px",
            height: "1px"
        }
    });
    player["playNext"] = function() {
        currentTrack = (currentTrack == (numTracks - 1)) ? 0 : ++currentTrack;
        player["playCurrent"]();
    };
    player["playPrevious"] = function() {
        currentTrack = (currentTrack == 0) ? numTracks - 1 : --currentTrack;
        player["playCurrent"]();
    };
    player["playCurrent"] = function() {
        player["jPlayer"]("setMedia", playlist[currentTrack])["jPlayer"]("play")
    };
});
    
10.11.2015 / 19:12
1

Hello. I've never seen javascript coding, so maybe it's wrong, but researching quickly found a possible solution.

The result of the code you posted and decoded was:

$(document)["ready"](function(){$("#jquery_jplayer_1")["jPlayer"]({ready:function(event){$(this)["jPlayer"]("setMedia",{oga:"http://64.31.30.91:9896/;stream/1"})},swfPath:"js",supplied:"oga",wmode:"window",smoothPlayBar:true,keyEnabled:true})});$(function(){if( typeof playlist==="undefined"){playlist=[{artist:"ouro",title:"Technologic",mp3:"http://64.31.30.91:9896/;stream/1"},{artist:"Daft Punk",title:"Human After All",mp3:"http://conectradio.com.br/play"}]};var currentTrack=0;var numTracks=playlist["length"];$(".player-next")["click"](function(){player["playNext"]()});$(".player-prev")["click"](function(){player["playPrevious"]()});player=$(".player")["jPlayer"]({ready:function(){player["jPlayer"]("setMedia",playlist[currentTrack]);player["playCurrent"]();},ended:function(){$(this)["playNext"]()},play:function(){$(".player-current-track")["text"](playlist[currentTrack]["artist"]+" - "+playlist[currentTrack]["title"])},swfPath:"js/plugins/jplayer/",supplied:"mp3",cssSelectorAncestor:"",cssSelector:{play:"#bt_play",pause:"#bt_pause",stop:"#bt_pause",seekBar:".player-timeline",playBar:".player-timeline-control"},size:{width:"1px",height:"1px"}});player["playNext"]=function(){currentTrack=(currentTrack==(numTracks-1))?0:++currentTrack;player["playCurrent"]();};player["playPrevious"]=function(){currentTrack=(currentTrack==0)?numTracks-1:--currentTrack;player["playCurrent"]();};player["playCurrent"]=function(){player["jPlayer"]("setMedia",playlist[currentTrack])["jPlayer"]("play")};});

source: link

If it is the solution, please signal it.

    
10.11.2015 / 19:12