Meki Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame] | 1 | <?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 Thompson | 8ecc076 | 2012-08-18 17:09:11 -0700 | [diff] [blame] | 7 | <title>Test SHA-256</title>
|
Jeff Thompson | 7328c5d | 2012-08-18 17:04:58 -0700 | [diff] [blame] | 8 | <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 Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame] | 12 |
|
Jeff Thompson | 7328c5d | 2012-08-18 17:04:58 -0700 | [diff] [blame] | 13 | <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 Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame] | 19 |
|
Jeff Thompson | 7328c5d | 2012-08-18 17:04:58 -0700 | [diff] [blame] | 20 | <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 Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame] | 24 |
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 25 | <script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/sha256.js"></script>
|
| 26 |
|
| 27 |
|
Meki Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame] | 28 | <script type="text/javascript">
|
| 29 | function hash(){
|
| 30 |
|
| 31 | var input = document.getElementById('contentname').value;
|
| 32 |
|
Meki Cherkaoui | 8f17361 | 2012-06-06 01:05:40 -0700 | [diff] [blame] | 33 | var output = "TEST1 "+hex_sha256(input);
|
| 34 |
|
| 35 | output+= "<br />";
|
| 36 |
|
jeff | 6c38857 | 2012-09-02 15:30:17 -0700 | [diff] [blame^] | 37 | output += "reference " +CryptoJS.SHA256(input);
|
Meki Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame] | 38 |
|
| 39 | document.getElementById('result').innerHTML = output;
|
| 40 |
|
| 41 | }
|
| 42 |
|
| 43 | </script>
|
| 44 |
|
| 45 |
|
| 46 | </head>
|
| 47 | <body >
|
| 48 | <form>
|
| 49 |
|
| 50 |
|
| 51 |
|
Jeff Thompson | 8ecc076 | 2012-08-18 17:09:11 -0700 | [diff] [blame] | 52 | Please Enter Text to Hash:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
|
Meki Cherkaoui | 88d59cd | 2012-05-14 07:34:58 -0700 | [diff] [blame] | 53 |
|
| 54 | </form>
|
| 55 | <button onclick="hash()">Hash</button>
|
| 56 |
|
| 57 | <p id="result"></p>
|
| 58 |
|
| 59 | </body>
|
jeff | 6c38857 | 2012-09-02 15:30:17 -0700 | [diff] [blame^] | 60 | </html>
|