in order write simple nodejs app talking server written in java have implement following functionality nodejs. public class crypto { cipher decipher; byte[] salt = { (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x0a, (byte) 0x0b, (byte) 0x0c, (byte) 0x0d }; int iterationcount = 10; public crypto(string pass) { try { keyspec keyspec = new pbekeyspec(pass.tochararray(), salt, iterationcount); secretkey key = secretkeyfactory.getinstance( "pbewithmd5andtripledes").generatesecret(keyspec); ecipher = cipher.getinstance("pbewithmd5andtripledes/cbc/pkcs5padding"); algorithmparameterspec paramspec = new pbeparameterspec(salt, iterationcount); decipher.init(cipher.decrypt_mode, key, paramspec); } catch (exception ex) { } } } i use crypto module of nodejs var crypto = require('crypto'), pass = new buffer(wek), salt = new buffer([0x01, 0x02, 0x03, 0x0...
Comments
Post a Comment