Tuesday, December 13th, 2005

Dojo Toolkit Javascript Cryptography Library

Category: Dojo, Toolkit

Tom Trenka has been hacking away on dojo.crypto.*.

Dojo now has implementations of MD5, and Blowfish. The implementations are designed to be self-standing and singleton objects, making them easy to use and implement.

Coming soon we will see:

  • Rijindael/AES
  • SHA-1, SHA-256, SHA-384, and SHA-512
  • Twofish
  • DES/TripleDES, RSA, and Serpent

Code Example

dojo.require("dojo.crypto.MD5");

var message = "The rain in Spain falls mainly on the plain.";
var base64 = "OUhxbVZ1Mtmu4zx9LzS5cA==";
var hex = "3948716d567532d9aee33c7d2f34b970";

var result = dojo.crypto.MD5.compute(message);
jum.assertEquals("MD5:toBase64", base64, result);
	
var result = dojo.crypto.MD5.compute(message, dojo.crypto.MD5.outputTypes.Hex);
jum.assertEquals("MD5:toHex", hex, result);

Posted by Dion Almaer at 5:03 am
2 Comments

+++--
3.5 rating from 11 votes

2 Comments »

Comments feed

Excellent. I can cross that off my list as something I need to implement in the future :)

Comment by Gregory Pierce — December 13, 2005

fix: ojo.crypto.MD5.outputTypes.Hex doesn’t work, it must be ojo.crypto.outputTypes.Hex ;)

Comment by xergio — July 19, 2006

Leave a comment

You must be logged in to post a comment.