PasswordDeriveBytes(.net 2.0) for iPhone

2019-02-28 02:29发布

问题:

I want to use PasswordDeriveBytes(RSA PBKDF1) of .NET 2.0 within iPhone. How could i achieve the same exact implementation? Are there any methods or libraries for it? I especially want it for using a salt.

Thanks

回答1:

Since MS implementation is not totally following the PKCS#5 specification the easiest way would be to convert Mono (C#) source code into Objective C. That will get you very close to MS implementation (everything except a very bad bug :-). In any case I suggest you stick to the specification (don't get more bytes that what it's designed to provide).

https://raw.github.com/mono/mono/master/mcs/class/corlib/System.Security.Cryptography/PasswordDeriveBytes.cs