You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using node.js v9.4.0 and npm v5.6.0 @angular 5 :)
i install "npm install cryptlib --save"
then @ ts file i type
var cryptLib = require('cryptlib');
iv = cryptLib.generateRandomIV(16); //16 bytes = 128 bit
key = cryptLib.getHashSha256('my secret key', 32); //32 bytes = 256 bits
encryptedText = cryptLib.encrypt('This is the text to be encrypted', key, iv);
then when run i have error -> _crypto2.default.randomBytes is not a function at CryptLib.generateRandomIV (CryptLib.js:125)
i change code to be
var cryptLib = require('cryptlib');
var plainText = "908197542145";
var key = "A@KLS@plnDGKlzwdNMKDcvmohd$$GH";
var iv = "@ko47kd3n851hmo9";
var encryptedString = cryptlib.encrypt(plainText, key, iv);
I have error _crypto2.default.createCipheriv is not a functiont at CryptLib._encryptDecrypt (CryptLib.js:89)
The text was updated successfully, but these errors were encountered:
using node.js v9.4.0 and npm v5.6.0
@angular 5 :)
i install "npm install cryptlib --save"
then @ ts file i type
var cryptLib = require('cryptlib');
iv = cryptLib.generateRandomIV(16); //16 bytes = 128 bit
key = cryptLib.getHashSha256('my secret key', 32); //32 bytes = 256 bits
encryptedText = cryptLib.encrypt('This is the text to be encrypted', key, iv);
then when run i have error -> _crypto2.default.randomBytes is not a function at CryptLib.generateRandomIV (CryptLib.js:125)
i change code to be
var cryptLib = require('cryptlib');
var plainText = "908197542145";
var key = "A@KLS@plnDGKlzwdNMKDcvmohd$$GH";
var iv = "@ko47kd3n851hmo9";
var encryptedString = cryptlib.encrypt(plainText, key, iv);
I have error _crypto2.default.createCipheriv is not a functiont at CryptLib._encryptDecrypt (CryptLib.js:89)
The text was updated successfully, but these errors were encountered: