Menu

Unable to generate RSA key

Help
Anonymous
2012-09-21
2014-09-03
  • Anonymous

    Anonymous - 2012-09-21

    Dears,

    I'm stack with generation of RSA key using pidCrypt.RSA.generate(B,E) method when the exponent is > 1.

    The following code generate an error:

    var securityModule = new pidCrypt.RSA();
    securityModule.generate(1024, 17);
    

    The error is :

    jsbn.fs (line 687)
     b.nextBytes(x);
    b is undefined
    

    Please help.

    Warm regards

    Younes Ouadi

     
  • Anonymous

    Anonymous - 2012-09-22

    Dears,

    I will be very thankful to get some quick feedback on my question. I have to decide whether pidCrypt is suitable for a very urgent development or not. In this development, the keys should be generated by the client and hence the above code is critical for the selection.

    Warm regards

    Younes Ouadi
     

     
  • Anonymous

    Anonymous - 2012-09-22

    Dears,

    After many attempts, I have found a workaround. It consists of supplying the exponent as a string instead of a number, very strange indeed!

    So the above code should be as follow :

    var securityModule = new pidCrypt.RSA();
    securityModule.generate(1024, "11");
    

    By the way, the exponent should be expressed in HEX instead of DEC.

    I hope the maintainer of 'jsbn.js'  find a time to fix this issue.

    Warm regards

    Younes Ouadi

     
  • Morris

    Morris - 2014-09-03

    Thank you! I was struggling with the same issue in jsbn.js!

     

Log in to post a comment.

MongoDB Logo MongoDB