What's new? | Help | Directory | Sign in
Google
jslibs
standalone Javascript development environment with general purpose native libraries.
  
  
  
  
    
Search
for
Updated Mar 10, 2008 by soubok
Labels: doc
jscrypt  
jscrypt module

- source - main -

jscrypt module

jscrypt is a cryptographic toolkit that provides developers with a vast array of well known published block ciphers, one-way hash functions, chaining modes, pseudo-random number generators, public key cryptography and a plethora of other routines. The underlying native code of this module is based on LibTom library.

Static functions


jscrypt::AsymmetricCipher class

Functions

Properties

Example

Data (or key) encryption using RSA:

LoadModule('jsstd');
LoadModule('jscrypt');
var fortuna = new Prng('fortuna');
fortuna.AutoEntropy(123); // give more entropy

//Alice
var alice = new AsymmetricCipher('RSA', 'md5', fortuna);
alice.CreateKeys(1024);
var publicKey = alice.publicKey;

//Bob
var bob = new AsymmetricCipher('RSA', 'md5', fortuna);
bob.publicKey = publicKey;
var encryptedData = bob.Encrypt('Alice, I love you !');

//Alice
Print( alice.Decrypt(encryptedData), '\n' );


jscrypt::Hash class

This class is used to create block Hash objects.

Functions

  • Process( string )
  • Process a block of memory though the hash.

Properties

Static functions

Static properties


jscrypt::Prng class

This class is used to create pseudo random number generators objects.

Functions

  • AutoEntropy( size )
  • Automaticaly add size bits of entropy to the current prng.

Static properties


jscrypt::Cipher class

Functions

Properties

Static properties


- source - top - main -



Sign in to add a comment