Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions