UNPKG

twofish

Version:

Javascript Twofish implementation.

38 lines (35 loc) 1.01 kB
<!DOCTYPE html> <html ng-app="sound"> <head> <title>test</title> </head> <body> <script type="text/javascript" src="src/twofish.js"> </script> <script type="text/javascript"> (function () { var IV = IV = [ 180, 106, 2, 96, //b4 6a 02 60 176, 188, 73, 34, //b0 bc 49 22 181, 235, 7, 133, //b5 eb 07 85 164, 183, 204, 158 //a4 b7 cc 9e; ]; var twF = twofish(IV) , key = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] , ct = [20, 37, 228, 187, //14 25 e4 bb 61, 89, 245, 87, //3d 59 f5 57 52, 175, 38, 58, //34 af 26 3a 96, 9, 121, 1] //60 09 79 01 , cpt = twF.decryptCBC(key, ct) , probablePt = [94, 160, 128, 0, //5e a0 80 00 0, 1, 6, 1, //00 01 06 01 0, 0, 0, 0, //00 00 00 00 0, 232, 28, 0]; //00 e8 1c 00 console.log('cpt', cpt); console.log('probablePT', probablePt); }()); </script> </body> </html>