Encrypt dan Decrypt JavaScript

Encrypt dan Decrypt JavaScript
Dagruel

Encrypt JavaScript

Pertama siapkan Script yang akan Di Encrypt contoh script dibawah.

var prevScrollpos = window.pageYOffset;
var DagShare = document.getElementsByClassName('DagruelShare');
window.onscroll = function() {
  var currentScrollPos = window.pageYOffset;
  if (prevScrollpos > currentScrollPos) {
    DagShare[0].classList.remove('tampil');
  } else {
    DagShare[0].classList.add('tampil');
  }
  prevScrollpos = currentScrollPos;
}

Buka website dibawah dan tempelkan script yang akan di Encrypt lalu klik "Obfuscate"

https://javascriptobfuscator.com/Javascript-Obfuscator.aspx

Jika sudah maka script nya berubah menjadi seperti dibawah.

var _0xa7d3=["x70x61x67x65x59x4Fx66x66x73x65x74","x44x61x67x72x75x65x6Cx53x68x61x72x65","x67x65x74x45x6Cx65x6Dx65x6Ex74x73x42x79x43x6Cx61x73x73x4Ex61x6Dx65","x6Fx6Ex73x63x72x6Fx6Cx6C","x74x61x6Dx70x69x6C","x72x65x6Dx6Fx76x65","x63x6Cx61x73x73x4Cx69x73x74","x61x64x64"];
var prevScrollpos=window[_0xa7d3[0]];
var DagShare=document[_0xa7d3[2]](_0xa7d3[1]);
window[_0xa7d3[3]]= function()
{
	var _0x42e4x3=window[_0xa7d3[0]];
	if(prevScrollpos> _0x42e4x3)
	{
		DagShare[0][_0xa7d3[6]][_0xa7d3[5]](_0xa7d3[4])
	}
	else 
	{
		DagShare[0][_0xa7d3[6]][_0xa7d3[7]](_0xa7d3[4])
	}
	prevScrollpos= _0x42e4x3
}

Tidak sampai disini script tersebut perlu dibungkus lagi, kalian bisa menggunakan salah satu tools dari web dibawah.

http://dean.edwards.name/packer/
http://codeamaze.com/code-minifier/javascript-obfuscator/

Jika sudah kalian bungkus dengan tools diatas maka hasilnya akan seperti ini.

Packer (Dean Edwards)

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('f 8=["\n\b\i\9\t\u\o\o\c\9\e","\v\b\i\g\w\9\d\x\y\b\g\9","\i\9\e\z\d\9\h\9\p\e\c\A\B\C\d\b\c\c\D\b\h\9","\j\p\c\q\g\j\d\d","\e\b\h\n\r\d","\g\9\h\j\E\9","\q\d\b\c\c\F\r\c\e","\b\s\s"];f k=l[8[0]];f m=G[8[2]](8[1]);l[8[3]]=H(){f a=l[8[0]];I(k>a){m[0][8[6]][8[5]](8[4])}J{m[0][8[6]][8[7]](8[4])}k=a}',46,46,'||||||||_0xa7d3|x65||x61|x73|x6C|x74|var|x72|x6D|x67|x6F|prevScrollpos|window|DagShare|x70|x66|x6E|x63|x69|x64|x59|x4F|x44|x75|x53|x68|x45|x42|x79|x43|x4E|x76|x4C|document|function|if|else'.split('|'),0,{}))

Packed (CodeAmaze)

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p;}('f 8=["\q\a\i\9\w\A\n\n\b\9\d","\z\a\i\g\B\9\c\D\C\a\g\9","\i\9\d\y\c\9\e\9\p\d\b\u\t\v\c\a\b\b\x\a\e\9","\m\p\b\o\g\m\c\c","\d\a\e\q\r\c","\g\9\e\m\H\9","\o\c\a\b\b\F\r\b\d","\a\s\s"];f j=k[8[0]];f l=J[8[2]](8[1]);k[8[3]]=G(){f h=k[8[0]];E(j>h){l[0][8[6]][8[5]](8[4])}I{l[0][8[6]][8[7]](8[4])}j=h}',46,46,'||||||||_0xa7d3|x65|x61|x73|x6C|x74|x6D|var|x72|_0x42e4x3|x67|prevScrollpos|window|DagShare|x6F|x66|x63|x6E|x70|x69|x64|x79|x42|x43|x59|x4E|x45|x44|x4F|x75|x68|x53|if|x4C|function|x76|else|document'.split('|'),0,{}))

Decrypt JavaScript

Buka website dibawah dan tempelkan script yang sudah di Encrypt lalu klik "Unpack"

https://matthewfl.com/unPacker.html

Salin script yang sudah di Unpack dan tempelkan script nya di web berikut.

https://beautifier.io/

Maka script tersebut akan kembali seperti semula, seperti script paling atas.

Sekian dari saya terima kasih, jika ada yang ingin ditanyakan silahkan berkomentar dibawah.

Comments