-
Notifications
You must be signed in to change notification settings - Fork 2
/
hash.html
97 lines (90 loc) · 3.01 KB
/
hash.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>Web Crypto Samples</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="polycrypt/common/util.js"></script>
<script src="polycrypt/front/polycrypt.js"></script>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
.signature-valid {
background-color: #dff0d8;
color: #468847;
}
.signature-invalid {
background-color: #f0dfd8;
color: #884647;
}
</style>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span> <span
class="icon-bar"></span> <span class="icon-bar"></span> <span
class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Crypto samples</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse"
id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Hash</a></li>
<li ><a href="sign.html">Sign</a></li>
<li><a href="encrypt.html">Encrypt & Decrypt</a></li>
</ul>
<ul class="nav navbar-nav pull-right">
<li><a href="debug.html"><span class="glyphicon glyphicon-link"></span></a></li>
</ul>
</div>
</nav>
<section class="container lead">
This example demonstrates the usage of the <code>digest()</code> function using the <code>SHA-256</code> hashing function.
</section>
<section class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#encryptBody">Hash</a>
</h3>
</div>
<div id="encryptBody">
<div class="panel-body">
<form role="form">
<div class="form-group">
<label for="message">Message</label>
<textarea class="form-control" rows="4" id="message"></textarea>
</div>
<div class="form-group">
<label for="hash">Hash</label>
<textarea class="form-control" rows="1" id="hash"></textarea>
</div>
</form>
</div>
</div>
</div>
</section>
<section class="container" style="margin-top:20px;">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">Log</h3>
</div>
<div id="logContainer" class="panel-body pre-scrollable" style="height:200px">
</div>
</div>
</section>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/lib/jquery-2.0.3.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/lib/bootstrap.min.js"></script>
<script src="js/lib/base64.js"></script>
<script src="js/utils.js"></script>
<script src="js/hash.js"></script>
</body>
</html>