1 if(!dojo._hasResource["dojox.encoding.tests.crypto.Blowfish"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dojox.encoding.tests.crypto.Blowfish"] = true;
3 dojo.provide("dojox.encoding.tests.crypto.Blowfish");
4 dojo.require("dojox.encoding.crypto.Blowfish");
7 var message="The rain in Spain falls mainly on the plain.";
9 var base64Encrypted="WI5J5BPPVBuiTniVcl7KlIyNMmCosmKTU6a/ueyQuoUXyC5dERzwwdzfFsiU4vBw";
10 var dxc=dojox.encoding.crypto;
12 tests.register("dojox.encoding.crypto.tests.Blowfish", [
13 function testEncrypt(t){
15 t.assertEqual(base64Encrypted, dxc.Blowfish.encrypt(message, key));
16 doh.debug("testEncrypt: ", new Date()-dt, "ms.");
18 function testDecrypt(t){
20 t.assertEqual(message, dxc.Blowfish.decrypt(base64Encrypted, key));
21 doh.debug("testDecrypt: ", new Date()-dt, "ms.");
23 function testShortMessage(t){
27 var enc=dxc.Blowfish.encrypt(msg, pwd);
28 var dec=dxc.Blowfish.decrypt(enc, pwd);
29 t.assertEqual(dec, msg);
30 doh.debug("testShortMessage: ", new Date()-dt, "ms.");