This repository has been archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
view.html
58 lines (54 loc) · 1.69 KB
/
view.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>txt</title>
<link rel="stylesheet" type="text/css" href="/txt/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/txt/lzstring.js" type="text/javascript"></script>
<script src="/txt/crypt.js" type="text/javascript"></script>
<script type="text/javascript">
// safety
document.cookie.split(';')
.forEach((c) => {
document.cookie = c
.replace(/^ +/, '')
.replace(/=.*/, `=;expires=${new Date().toUTCString()};path=/`)
})
try {
window.localStorage.clear()
window.sessionStorage.clear()
} catch {
// most likely in private mode
}
d = window.location.hash.slice(1)
const splithash = d.split('#')
const decrypt = () => {
const key = document.getElementById('k').value
try {
const decryptedContent = LZString
.decompressFromUint8Array(
mjsCrypt.decryptUint8Array(splithash[0], key))
document.body.innerText = decryptedContent
if (!decryptedContent) {
document.body.innerText = 'Failed'
}
} catch {
document.body.innerText = 'Failed'
}
}
</script>
</head>
<body>
<noscript>This site requires JavaScript.</noscript>
Password:
<input id="k" type="password" onkeydown="if (event.keyCode == 13) decrypt()"></input>
<input onclick="decrypt()" type="button" text="Ok" value="OK"></input>
<br><br>
<nav>
<small>
<a href="/">Write Something</a>
</small>
</nav>
</body>
</html>