-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsm3.php
50 lines (45 loc) · 1.19 KB
/
sm3.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>SM3 加密</title>
<style>
body {
margin: 0;
padding: 0;
font-family: 'Microsoft Yahei', "simsun";
}
.main {
width: 800px;
height: auto;
margin: 0 auto;
}
</style>
</head>
<body>
<?php
require_once 'src/functions.php';
$sm3 = sm3(@$_POST["area"]);
?>
<div class="main">
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>">
<h1>SM3 算法实现测试</h1>
<textarea name="area" cols="100" rows="5" required></textarea>
<input type="submit" value="加密" />
</form>
<span>原文内容:</span>
<?php
echo @$_POST["area"];
?>
<br>
<span>加密结果:</span>
<?php
if (@$_POST["area"] != null) {
echo $sm3;
}
?>
</div>
</body>
</html>