safe2link/index.html

55 lines
1.5 KiB
HTML

<html>
<head>
<title>Safe2link</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- script type="text/javascript" src="Blowfish.js"></script -->
<script type="text/javascript" src="http://yandex.st/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="blowfish.js"></script>
</head>
<body>
<h1>Safe2link</h1>
<p>based on <a href="https://git.fuwafuwa.moe/iqbalrifai/safe2link">blowfish+base64 safelink</a></p>
<form>
<p>Put the link below if you want to secure it:</p>
<textarea name="text" rows="12" cols="70"></textarea><br/>
<p>Password:</p>
<p>If you want to add a password to secure</p>
<input type="text" name="password" size="56" /><br/>
<input type="submit" name="encrypt" value="Encrypt">
<br/>
<p>Encrypted message</p>
<textarea name="result" rows="12" cols="70"></textarea>
</form>
<script type="text/javascript">
$(function() {
$('input[name=encrypt]').submit(function(event) {
event.preventDefault();
});
$('input[name=encrypt]').click(function(event) {
try {
var key = $('input[name=password]').val();
var text = $('textarea[name=text]').val();
var bf = new Blowfish(key);
var res = bf.encrypt(text);
res = bf.base64Encode(res);
$('textarea[name=result]').val(res);
} catch(ex) {
if (window.console && console.log) {
console.log(ex)
}
}
return false;
});
</script>
</body>
</html>