n0va_sa

Hash me again

Sep 15th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // https://ringzer0team.com/challenges/14/
  2.  
  3. function binaryAgent(str) {
  4.     var binString = '';
  5.    
  6.     str.split(' ').map(function(bin) {
  7.         binString += String.fromCharCode(parseInt(bin, 2));
  8.       });
  9.     return binString;
  10. }
  11. $.getScript("https://cdn.rawgit.com/emn178/js-sha512/master/src/sha512.js", function(){
  12.         // selecting the message from SRC
  13.         let selectorBox = $(".message").text();
  14.         // Removing the unnecessary stuffs from the message
  15.         let arr= [];
  16.         selectorBox = selectorBox.split("\n")[2].substring(2,selectorBox.lenght);
  17.         arr = selectorBox.match(/.{1,8}/g);
  18.         res = '';
  19.         for(var i=0;i<arr.length;i++){
  20.          res += binaryAgent(arr[i]);
  21.         }
  22.         var encrypted_ = sha512(res);
  23.         window.location.href += '/' + encrypted_;
  24. });
Add Comment
Please, Sign In to add comment