Re: [android-developers] Re: hash functions
On Wed, May 11, 2011 at 7:34 AM, Bob Kerns <rwk@acm.org> wrote:
> More precisely, you iterate this:
> hash = f(hash)
> where f is some function that is expensive, and does not collapse the space
> of possible values into some smaller set. One way to accomplish this would
> be:
> f(hash) = hash <xor> sha1(hash).
> I went with SHA1 above, because I want to tie this to PBKDF2, which Nikolay
> referenced.
Do you mean you implemented this yourself? Not that it's too hard to do, but
Android has the Bouncy Castle JCE provider, so all you have to do is usually:
SecretKeyFactory factory = SecretKeyFactory.getInstance(KEYGEN_ALGORITHM)
KeySpec keySpec = new PBEKeySpec(password, salt, numInterations, keyLen);
SecretKey key = factory.generateSecret(keySpec);
where KEYGEN_ALGORITHM is a supported PBE algorithm.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home