Monday, June 13, 2011

[android-developers] Re: Using jbcrypt in app

So after more digging, I've discovered that the library actually just
runs much slower when used in my Android app. Testing it as a
standalone algorithm, jbcrypt hashes several strings per second, but
under the same conditions within the app its takes close to 6 minutes
to run! There is a paramater that I can tweak that controls the
number of rounds of hashing to apply - the work factor increases
exponentially as 2**log_rounds. If I push this value to its lowest
limit, the hashing happens within 5 seconds or so. Still not ideal,
but possibly acceptable.

I'm wondering if anybody has any ideas why this type of performance
difference exists in the execution of the same piece of code. What
types of limitions does Android place on memory/CPU that is available
to apps? I believe I might be able to move forward with what I have
now, but I would still like to better understand what is causing the
issue.

Thanks,

SImon


On Jun 13, 3:24 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Mon, Jun 13, 2011 at 3:10 PM, Simon <simon.wilkin...@gmail.com> wrote:
> > I have.  Its within the 'private byte[] crypt_raw(byte password[],
> > byte salt[], int log_rounds)' method, within the for loop where
> > key(password) and key(salt) are being called.  It never gets past this
> > loop.
>
> Well, I don't know anything about their code. Perhaps they are
> tripping over some subtle difference between Dalvik and a standard
> Java VM. However, if you can get this far, you should be able to work
> with the library's authors to try to figure out why you're in a
> (presumably) infinite loop.
>
> Perhaps somebody else has already done this and will chime in on the thread.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!

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

No comments:

Post a Comment