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>
|
| 7 | <title>NDN Request Example</title>
|
| 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>
|
| 12 |
|
| 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>
|
| 19 |
|
| 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>
|
| 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 |
|
| 37 | output += "TEST2 " +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 |
|
| 52 | Please Enter a Text to sign:<br /><input id="contentname" type="text" name="CONTENTNAME" value="/PARC/abc" /> <br />
|
| 53 |
|
| 54 | </form>
|
| 55 | <button onclick="hash()">Hash</button>
|
| 56 |
|
| 57 | <p id="result"></p>
|
| 58 |
|
| 59 | </body>
|
| 60 | </html> |