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

Functionality doesn't match CyrptoJS, no documented alternative #2

Closed
kyeotic opened this issue Jun 4, 2012 · 5 comments
Closed

Functionality doesn't match CyrptoJS, no documented alternative #2

kyeotic opened this issue Jun 4, 2012 · 5 comments

Comments

@kyeotic
Copy link

kyeotic commented Jun 4, 2012

The CryptoJS documentation offers this single example of using PBKDF2:

var salt = CryptoJS.lib.WordArray.random(128/8);

var key128Bits = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 128/32 });
var key256Bits = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 256/32 });
var key512Bits = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 512/32 });

var key512Bits1000Iterations = CryptoJS.PBKDF2("Secret Passphrase", salt, { keySize: 512/32, iterations: 1000 });

The first line will not work with this, indicating WordArray is not a method. Is there an alterante method in the module for generating a salt?

Also, when calling the second line with a salt generated manually, I get an invalid array length error.

How can this module be used to generate a hash? You have no examples.

@Chandrakala14
Copy link

Chandrakala14 commented Sep 5, 2017

Hi tyrsius,
I am also facing same issue, Did you find solution ?

@kyeotic
Copy link
Author

kyeotic commented Sep 5, 2017

@Chandrakala14 No I didn't.

@crcer
Copy link

crcer commented Feb 9, 2018

Is there any solution now?
I am also facing this issue....

@garrows
Copy link

garrows commented Oct 21, 2018

I think your problem is salt is not a string.

@kyeotic
Copy link
Author

kyeotic commented Oct 22, 2018

@garrows You think the reason that the first line throws an error is that the variable salt is not a string? I don't see how that could be possible. The value of salt is not accessed in the first line. The variable is declared and assigned on that line, it doesn't even get a value because the assignment throws an error.

@kyeotic kyeotic closed this as completed Dec 29, 2021
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

4 participants