blob: 920e9d080608c23e1b2e7d5c83ba5852a86fe3eb [file] [log] [blame]
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -07001<?xml version = "1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3"DTD/xhtml1-strict.dtd">
4<html xmlns = "http://www.w3.org/1999/xhtml">
5
6<head>
Jeff Thompson8ecc0762012-08-18 17:09:11 -07007 <title>Test SHA-256</title>
Jeff Thompson7328c5d2012-08-18 17:04:58 -07008 <script language="JavaScript" type="text/javascript" src="../securityLib/jsbn.js"></script>
9 <script language="JavaScript" type="text/javascript" src="../securityLib/jsbn2.js"></script>
10 <script language="JavaScript" type="text/javascript" src="../securityLib/rsa.js"></script>
11 <script language="JavaScript" type="text/javascript" src="../securityLib/rsa2.js"></script>
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070012
Jeff Thompson7328c5d2012-08-18 17:04:58 -070013 <script language="JavaScript" type="text/javascript" src="../securityLib/sha1.js"></script>
14 <script language="JavaScript" type="text/javascript" src="../securityLib/sha256.js"></script>
15 <script language="JavaScript" type="text/javascript" src="../securityLib/sha512.js"></script>
16 <script language="JavaScript" type="text/javascript" src="../securityLib/md5.js"></script>
17 <script language="JavaScript" type="text/javascript" src="../securityLib/ripemd160.js"></script>
18 <script language="JavaScript" type="text/javascript" src="../securityLib/base64.js"></script>
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070019
Jeff Thompson7328c5d2012-08-18 17:04:58 -070020 <script language="JavaScript" type="text/javascript" src="../securityLib/rsapem-1.1.min.js"></script>
21 <script language="JavaScript" type="text/javascript" src="../securityLib/rsasign-1.2.min.js"></script>
22 <script language="JavaScript" type="text/javascript" src="../securityLib/asn1hex-1.1.min.js"></script>
23 <script language="JavaScript" type="text/javascript" src="../securityLib/x509-1.1.min.js"></script>
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070024
Meki Cherkaoui8f173612012-06-06 01:05:40 -070025 <script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/sha256.js"></script>
26
27
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070028 <script type="text/javascript">
29 function hash(){
30
31 var input = document.getElementById('contentname').value;
32
Meki Cherkaoui8f173612012-06-06 01:05:40 -070033 var output = "TEST1 "+hex_sha256(input);
34
35 output+= "<br />";
36
jeff6c388572012-09-02 15:30:17 -070037 output += "reference " +CryptoJS.SHA256(input);
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070038
39 document.getElementById('result').innerHTML = output;
40
41 }
42
43 </script>
44
45
46</head>
47<body >
48 <form>
49
50
51
Jeff Thompson8ecc0762012-08-18 17:09:11 -070052 Please Enter Text to Hash:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
Meki Cherkaoui88d59cd2012-05-14 07:34:58 -070053
54 </form>
55 <button onclick="hash()">Hash</button>
56
57 <p id="result"></p>
58
59</body>
jeff6c388572012-09-02 15:30:17 -070060</html>