66 lines
2.4 KiB
HTML
Raw Normal View History

2017-09-27 13:48:21 +02:00
<!doctype html>
<html class="staticrypt-html">
<head>
<meta charset="utf-8">
<title>{{ gallery.title }} · {{ settings.title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- do not cache this page -->
<meta http-equiv="cache-control" content="max-age=0"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT"/>
<meta http-equiv="pragma" content="no-cache"/>
2017-09-29 01:30:43 +02:00
<link type="text/css" rel="stylesheet" href="../static/css/style-page.css" media="screen,projection"/>
2017-09-27 13:48:21 +02:00
</head>
<body class="staticrypt-body">
<div class="staticrypt-page">
<div class="staticrypt-form">
<div class="staticrypt-instructions">
2017-09-29 01:30:43 +02:00
<img id="logo" src="./../static/img/logo.svg">
2017-09-27 13:48:21 +02:00
<p class="staticrypt-title">{{ gallery.title }}</p>
</div>
<hr class="staticrypt-hr">
<form id="staticrypt-form" action="#" method="post">
2017-09-29 01:30:43 +02:00
<div id="error" style="color: red; padding-bottom: 10px; height: 20px;"></div>
2017-09-27 13:48:21 +02:00
<input id="staticrypt-password"
type="password"
name="password"
placeholder="passphrase"
autofocus/>
<input type="submit" class="staticrypt-decrypt-button" value="ENTER"/>
</form>
</div>
</div>
2017-09-29 01:30:43 +02:00
<footer style="position: absolute;">
<p>Generated using <a href="https://github.com/psycojoker/prosopopee">Prosopopée</a> · content under <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a> · atom logo by <a href="https://thenounproject.com/jjjon/">Jonathan Li</a> under <a href="https://creativecommons.org/licenses/by/3.0/">CC-BY</a></p>
2017-09-27 13:48:21 +02:00
</footer>
<script type="text/javascript" src="../static/js/crypto-js.min.js" charset="utf-8"></script>
<script>
document.getElementById('staticrypt-form').addEventListener('submit', function(e) {
e.preventDefault();
var passphrase = document.getElementById('staticrypt-password').value,
encryptedMsg = '{{ ciphertext }}';
try{
var plainHTML = CryptoJS.AES.decrypt(encryptedMsg, passphrase).toString(CryptoJS.enc.Utf8);
}
catch(err) {
2017-09-29 01:30:43 +02:00
document.getElementById("error").innerHTML = "Wrong keyword entry."
2017-09-27 13:48:21 +02:00
return;
}
document.write(plainHTML);
document.close();
});
</script>
</body>
</html>