jssha256 0.1

jssha256 is a compact JavaScript implementation of the SHA256 secure hash function.

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
GPL (GNU General Public License) 
USER RATING:
5.0/5 1
DEVELOPED BY:
B. Poettering
HOMEPAGE:
point-at-infinity.org
CATEGORY:
ROOT \ Security
jssha256 is a compact JavaScript implementation of the SHA256 secure hash function. HMAC calculation is also available.

Example

The following code example computes the SHA256 hash value of the string 'abc'.

SHA256_init();
SHA256_write("abc");
digest = SHA256_finalize();
digest_hex = array_to_hex_string(digest);

Get the same result by calling the shortcut function SHA256_hash:

digest_hex = SHA256_hash("abc");

In the following example the calculation of the HMAC of the string 'abc' using the key 'secret key' is shown.

HMAC_SHA256_init("secret key");
HMAC_SHA256_write("abc");
mac = HMAC_SHA256_finalize();
mac_hex = array_to_hex_string(mac);

Again, the same can be done more conveniently:

mac_hex = HMAC_SHA256_MAC("secret key", "abc");

Last updated on October 18th, 2006

#JavaScript implementation #SHA256 implementation #HMAC-SHA256 implementation #jssha256 #JavaScript #implementation #SHA256

Add your review!

SUBMIT