[Botan-devel] using botan with a javascript crypto library

jonny ram jonniram at gmail.com
Thu Jul 8 20:52:35 EDT 2010

Just an update. I solved my problem by using the javascript library upon
which JCT is based, which is called jsbn:


It turns out that it works perfectly with this library, so (as Jack
suggested) whatever caused the infinite loop is indeed specific to JCT and
whatever modifications it made to it. Anyone interested in using Botan in
concert with a JS library should definitely give this a try!

On Wed, Jul 7, 2010 at 9:02 AM, jonny ram <jonniram at gmail.com> wrote:

> Right, if it's just a JCT problem I may have to look elsewhere, though
> decent RSA implementations in JS are quite scarce. Regarding inverse_mod, I
> actually did use that when I made the Botan key that the test script uses,
> though for the exponent I think I did new BigInt(65537) instead of get_e().
>  On Wed, Jul 7, 2010 at 8:02 AM, Jack Lloyd <lloyd at randombit.net> wrote:
>> On Tue, Jul 06, 2010 at 07:33:29PM -0400, jonny ram wrote:
>> > Haven't had any luck yet as far as getting Botan keys to work. I even
>> hashed
>> > them on both sides to make sure it's not just an issue with the way JCT
>> > decodes base 64 or something, but the hashes are identical. If you have
>> any
>> > time, I've attached a simple test script with the private keys I
>> generated
>> > included, and it lets you choose which key to use. The botan key was
>> > generated with the method you suggested (and it will lock up your
>> browser or
>> > tab if you choose it). I appreciate any help.
>> I'll take a look at this later today if I have time, but this really
>> sounds like an issue with JCT.
>> > > Instead of get_d(), give it the result of (get_p()-1)*(get_q()-1)
>> > > as the private key.
>> I made a mistake here: the private key for JCT should be:
>>   inverse_mod(key.get_e(), (key.get_p()-1)*(key.get_q()-1));
>> inverse_mod is declared in numthry.h
>> -Jack
>> _______________________________________________
>> botan-devel mailing list
>> botan-devel at randombit.net
>> http://lists.randombit.net/mailman/listinfo/botan-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20100708/325af980/attachment.html>

More information about the botan-devel mailing list