jQuery.pidCrypt: Encrypt form values using RSA and AES

Recommend this page to a friend!
  Info   View files View files (39)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-06 (Yesterday) RSS 2.0 feedNot enough user ratingsTotal: 338 All time: 125 This week: 4Up
Version License JavaScript version Categories
jquery-pidcrypt 1.0.2GNU General Publi...1.0jQuery, Cryptography
Description 

Author

This is a jQuery plug-in to encrypt form values using RSA public keys.

It uses RSA public keys generated on the server side to encrypt data from form values.

It also implements a keyring per URL of encrypted public keys like an SSH keyring. The AES-CBC-256 cipher is used to encrypt local keyring entries.

The plug-in can use different types of storage containers to store and retrieve the data such as cookies, session and local.

A given callback function may be invoked when the data is processed.

A modal window appears to let the user pick one key when more than three public keys exist.

It supports Content-MD5 checksum and CSRF attack prevention headers.

Picture of Jason Gerfen
  Performance   Level  
Name: Jason Gerfen <contact>
Classes: 7 packages by
Country: United States United States
Age: 48
All time rank: 122 in United States United States
Week rank: 6 Up2 in United States United States Equal
Innovation award
Innovation award
Nominee: 4x

Winner: 2x

Details

#jQuery plugin to impliment RSA public key encryption Utilizes the pidCrypt libraries for client public key encryption while the associated PHP class uses OpenSSL to generate the necessary private/public key pairs used by this plug-in Fork me @ https://www.github.com/jas-/jQuery.pidCrypt ## REQUIREMENTS: * jQuery libraries (required - http://www.jquery.com) * pidCrypt RSA & AES libraries (required - https://www.pidder.com/pidcrypt/) * jQuery cookie plugin (optional - http://plugins.jquery.com/files/jquery.cookie.js.txt) * OpenSSL < 0.9.8 * PHP < 5.3 * A modern browser (doh!) ## FEATURES: * Multiple key support * AES-256-CBC encryption of all keyring data * Modal window dialog for selection of appropriate keyring entry when multiple keys exist * HTML5 localStorage support * HTML5 sessionStorage support * Cookie support * Debugging output ## SCREENSHOT: Here is an screenshot of an impelmentation bound to a form with multiple public keys forcing a modal window pop-up along with debugging output at the bottom showing the encrypted public keys stored within the HTML5 storage options. ![jQuery.pidCrypt](https://raw.github.com/jas-/jQuery.pidCrypt/master/screenshots/screenshot-1.png) ## OPTIONS: * appID: Optional CSRF token * storage: HTML5 localStorage, sessionStorage and cookies supported * callback: Optional function used once server recieves encrypted data * preCallback: Optional function to perform prior to form submission * errCallback: Optional function to perform on errors ## EXAMPLES: Here are a few usage examples to get you started Default usage using HTML5 localStorage ```javascript $('#form').pidCrypt(); ``` Default Using HTML5 sessionStorage ```javascript $('#form').pidCrypt({storage:'sessionStorage'}); ``` Default using cookies (requires the jQuery cookie plug-in) ```javascript $('#form').pidCrypt({storage:'cookie'}); ``` Example of using the callback method to process server response ```javascript $('#form').pidCrypt({callback:function(){ console.log(this); }}); ``` Example of using the preCallback method to load a function prior to form submission ```javascript $('#form').pidCrypt({preCallback:function(){ console.log(this); }}); ``` Example of using the errCallback method to load a function on error ```javascript $('#form').pidCrypt({preCallback:function(){ console.log(this); }}); ``` Example of enabling a custom CSRF token (sets the X-Alt-Referer header value) ```javascript $('#form').pidCrypt({appID:'<?php echo $_SESSION['csrf-token']; ?>'}); ``` Author: Jason Gerfen <jason.gerfen@gmail.com> License: GPL (see LICENSE)

  Files folder image Files  
File Role Description
Files folder imagelibs (3 directories)
Files folder imagescreenshots (1 file)
Files folder imagetests (2 files)
Accessible without login Plain text file example.html Example Sample output
Accessible without login Plain text file GUIDE.md Doc. Auxiliary data
Accessible without login Plain text file LICENSE Data Auxiliary data
Accessible without login Plain text file README.md Doc. Auxiliary data

  Files folder image Files  /  libs  
File Role Description
Files folder imageclasses (3 files)
Files folder imagecss (1 file)
Files folder imagejs (2 files, 1 directory)

  Files folder image Files  /  libs  /  classes  
File Role Description
  Accessible without login Plain text file class.ajax.php Data Auxiliary data
  Accessible without login Plain text file class.libraries.php Data Auxiliary data
  Accessible without login Plain text file class.openssl.php Data Auxiliary data

  Files folder image Files  /  libs  /  css  
File Role Description
  Accessible without login Plain text file style.css Data Auxiliary data

  Files folder image Files  /  libs  /  js  
File Role Description
Files folder imagepidCrypt (1 directory)
  Accessible without login Plain text file jquery.pidCrypt.js Class Application script
  Accessible without login Plain text file jquery.pidCrypt.min.js Class Application script

  Files folder image Files  /  libs  /  js  /  pidCrypt  
File Role Description
Files folder imagejavascripts (1 file, 2 directories)

  Files folder image Files  /  libs  /  js  /  pidCrypt  /  javascripts  
File Role Description
Files folder imagecompressed (16 files)
Files folder imageoriginal scripts (9 files)
  Accessible without login Plain text file gpl-3.0.txt Data Auxiliary data

  Files folder image Files  /  libs  /  js  /  pidCrypt  /  javascripts  /  compressed  
File Role Description
  Accessible without login Plain text file aes_cbc_c.js Appl. Application script
  Accessible without login Plain text file aes_core_c.js Appl. Application script
  Accessible without login Plain text file aes_ctr_c.js Appl. Application script
  Accessible without login Plain text file asn1_c.js Appl. Application script
  Accessible without login Plain text file compress_all.sh Output Sample output
  Accessible without login Plain text file jsbn_c.js Appl. Application script
  Accessible without login Plain text file md5_c.js Appl. Application script
  Accessible without login Plain text file pidcrypt_c.js Appl. Application script
  Accessible without login Plain text file pidcrypt_util_c.js Appl. Application script
  Accessible without login Plain text file prng4_c.js Appl. Application script
  Accessible without login Plain text file rng_c.js Appl. Application script
  Accessible without login Plain text file rsa_c.js Appl. Application script
  Accessible without login Plain text file sha1_c.js Appl. Application script
  Accessible without login Plain text file sha256_c.js Appl. Application script
  Accessible without login Plain text file sha512_c.js Appl. Application script
  Accessible without login Plain text file string_extend_c.js Appl. Application script

  Files folder image Files  /  libs  /  js  /  pidCrypt  /  javascripts  /  original scripts  
File Role Description
  Accessible without login Plain text file asn1.js Class Class source
  Accessible without login Plain text file jsbn.js Class Class source
  Accessible without login Plain text file md5.js Aux. Auxiliary script
  Accessible without login Plain text file prng4.js Class Class source
  Accessible without login Plain text file rng.js Example Example script
  Accessible without login Plain text file rsa.js Class Class source
  Accessible without login Plain text file sha1.js Example Example script
  Accessible without login Plain text file sha256.js Example Example script
  Accessible without login Plain text file sha512.js Class Class source

  Files folder image Files  /  screenshots  
File Role Description
  Accessible without login Image file screenshot-1.png Data Auxiliary data

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file config.php Data Auxiliary data
  Accessible without login Plain text file default.php Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:338
This week:0
All time:125
This week:4Up