Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_crypto2.default.createCipheriv is not a function #4

Open
alshymaaArfah opened this issue Jan 22, 2018 · 1 comment
Open

_crypto2.default.createCipheriv is not a function #4

alshymaaArfah opened this issue Jan 22, 2018 · 1 comment

Comments

@alshymaaArfah
Copy link

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)

@srujanadevi
Copy link

I am facing the same problem. Did u got the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants