navneet83 / Cross-platform-AES-encryption

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

C# code and Objective C code gives two different set of results #42

Open swa6589 opened 8 years ago

swa6589 commented 8 years ago

We have followed exactly the same approach given here for IOS and C#. But unfortunately we are getting two different results.

We hardcoded IV key and Secret key and tested. Even this scenario into different results.

Let us know that any one has resolved this issue.

Any help is appreciated.

Thanks in advance

katpurz commented 8 years ago

I'm seeing the same thing. I have my Android and iOS apps producing the same encrypted result (they both use the same IV) but I can't get the windows side to produce the same result... have you found a fix for this, per chance?

katpurz commented 8 years ago

Update: I solved my problem... the "how to use" code for CS showed this line wrong. once I corrected to 32, I now get the same results from C#/iOS/Android:

string key = CryptLib.getHashSha256("1111111111111111", 32); //32 bytes = 256 bits