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

Parameters for deriveBits and PBKDF2 #19

Open
dirkcuys opened this issue Oct 20, 2022 · 1 comment
Open

Parameters for deriveBits and PBKDF2 #19

dirkcuys opened this issue Oct 20, 2022 · 1 comment

Comments

@dirkcuys
Copy link

dirkcuys commented Oct 20, 2022

The W3C standard specifies that Pbkdf2Params should have a hash attribute in the format:

hash: { name: "SHA-512" }

But looking at MDN it's specified to just take a string as the value of hash

{
   name: "PBKDF2",
   salt,
   iterations: 100000,
   hash: "SHA-256",
},

Unfortunately Node.js webcrypto also does this and that makes it difficult to use this library to get isomorphic encryption across browser, nodejs and react-native.

It would be possible to accommodate this inconsistency in the code. Would that be a change(PR) that would be considered?

@ljoy913
Copy link
Contributor

ljoy913 commented Oct 24, 2022

It should accept both forms, I'll fix this soon and get back to you. Thanks!

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