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

Crypto.JS PBKDF2 Results Differnt then .Net Rfc2898DeriveBytes #137

Open
GoogleCodeExporter opened this issue Sep 11, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Using the same Salt and Secret Phrase for both C# and Crypto.js (Lets just 
use a SessionID ans an example to make is simple)

2. Java Code:
var salt = CryptoJS.SHA256("<%=Session.SessionID%>");
var key256Bits = CryptoJS.PBKDF2("<%=Session.SessionID%>", salt, { keySize: 256 
/ 32 });
$("#TextBox3").val(key128Bits.toString(CryptoJS.enc.Base64));

3. C# Code
SHA256 sha = SHA256.Create();
Rfc2898DeriveBytes ByteMake = new Rfc2898DeriveBytes(Session.SessionID, 
sha.ComputeHash(UTF8Encoding.UTF8.GetBytes(Session.SessionID)));
TextBox2.Text = Convert.ToBase64String(ByteMake.GetBytes(32));


What is the expected output? What do you see instead?
I would expect the results to be identical in each text box.


What version of the product are you using? On what operating system?
Crypto.js - Version 3.1.2
Asp.net 4.5 
Windows Server 2012 R2

Please provide any additional information below.

Original issue reported on code.google.com by coldfiredragon on 30 Jul 2014 at 8:45

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

No branches or pull requests

1 participant