2017-09-29 03:17:44 +02:00

70 lines
2.4 KiB
HTML

<!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"/>
<link type="text/css" rel="stylesheet" href="../static/css/style-page.css" media="screen,projection"/>
<link type="text/css" rel="stylesheet" href="../static/css/materialize.css" media="screen,projection"/>
</head>
<body class="staticrypt-body">
<div class="staticrypt-page">
<div class="staticrypt-form">
<div class="staticrypt-instructions">
<p class="staticrypt-title">{{ gallery.title }}</p>
</div>
<hr class="staticrypt-hr">
<form id="staticrypt-form" action="#" method="post">
<div id="error" style="color: red; padding-bottom: 10px; height: 20px;"></div>
<input id="staticrypt-password"
type="password"
name="password"
placeholder="passphrase"
autofocus/>
<button class="btn waves-effect waves-light" type="submit" name="action">ENTER
</button>
</form>
</div>
</div>
<footer class="page-footer blue-grey darken-1">
<div class="footer-copyright blue-grey darken-2">
<div class="container center">
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>
</div>
</div>
</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) {
document.getElementById("error").innerHTML = "Wrong keyword entry."
return;
}
document.write(plainHTML);
document.close();
});
</script>
</body>
</html>