navneet83 / Cross-platform-AES-encryption

Basic cross platform AES encryption
Apache License 2.0
320 stars 152 forks source link

Android and C# getHashSha256 Difference #14

Open mrtcn opened 9 years ago

mrtcn commented 9 years ago

First of all thanks for the great library This is actually not a big issue but on how to use section

Android hashes the key as follows; string key = CryptLib.getHashSha256("my secret key", 31); C# hashes as follows; String key = CryptLib.SHA256("my secret key", 32); //32 bytes = 256 bit

Which gave us at the beginning different results then I have changed the C# code to use 32bytes and results were identical.

navneet83 commented 9 years ago

Thanks for reporting this one! I'll test and fix the code accordingly.