0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Extension to jsbn which adds facilities for asynchronous RSA key generation. Primarily created to avoid execution timeout on mobile devices. This gem integrates rsasync with Rails asset pipeline for easy of use.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0
>= 3.0

Runtime

~> 3.2.1
>= 3.0
 Project Readme

RSAsync for Rails Assets Pipeline

RSAsync Javascript asynchronous rsa key generation - extends jsbn.

Usage

  • Include rsasync-rails in the Gemfile:

    #!ruby
    gem 'rsasync-rails', '13.2.11.1', git: 'https://bitbucket.org/gimiscale/rsasync-rails.git'
    
  • Add to app/assets/javascripts/applications.js:

    #!javascript
    // RSA keygen, encoding, decoding, etc...
    //= require rsasync-rails
    // RSA (public/private) key formatting for SSH
    //= require ssh-format-rails
    

    Optional:

    #!javascript
    // SHA-1 hash function
    //= require jsbn-sha1-rails
    
    // Elliptic Curve Math
    //= require jsbn-ecc-rails
    
  • For best results, put code like following in your main HTML document.

    #!html
    <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
    
  • Example use in JavaScript:

    #!javascript
    key = new RSAKey();
    key.generateAsync(512, "03", function(){
        var pubKey = generatePublicKey(key);
        var priKey = generatePrivateKeyBlock(key);
        alert(pubKey);
        alert(priKey);
    });
    

License

See LICENSE.md.