Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.
/ rsasync-rails Public archive

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.

License

Notifications You must be signed in to change notification settings

GiMiScale/rsasync-rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages