-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (70 loc) · 1.63 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Web Crypto API Example</title>
</head>
<body>
<h2>Web Crypto API Example</h2>
<form id="form" autocomplete="off">
<input
type="text"
placeholder="Enter text to be encrypted & decrypted"
name="text"
id="text"
/>
<button id="submit-btn" style="margin-top: 10px" type="submit">
Submit
</button>
</form>
<hr />
<div class="flex">
<h3>Encoded Text (Binary format): </h3>
<h4 id="encoded-text">--</h4>
</div>
<div class="flex">
<h3>Encrypted Text: </h3>
<h4 id="encrypted-text">--</h4>
</div>
<div class="flex">
<h3>Decrypted + Decoded Text: </h3>
<h4 id="decrypted-text">--</h4>
</div>
<style>
.flex {
display: flex;
align-items: center;
}
h3,
h4 {
margin: 10px 0;
color: rgba(0, 0, 0, 0.73);
word-break: break-word;
}
#text {
padding: 8px 12px;
font-size: 16px;
width: 80%;
}
#submit-btn {
color: #fff;
background-color: #0d6efd;
border-color: #0d6efd;
padding: 0.375rem 0.75rem;
font-size: 1rem;
border-radius: 0.25rem;
}
body {
max-width: 600px;
margin: 0 auto;
font-family: sans-serif;
padding: 10px;
}
* {
box-sizing: border-box;
}
</style>
<script type="module" src="./index.js"></script>
</body>
</html>