76 lines
3.2 KiB
HTML
76 lines
3.2 KiB
HTML
<html>
|
|
<head>
|
|
<title>browserPGP</title>
|
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
|
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<script src="openpgp.min.js"></script>
|
|
<script src="favicon.js"></script>
|
|
<script>
|
|
|
|
openpgp.initWorker({ path:'openpgp.worker.min.js' }) // set the relative web worker path
|
|
|
|
const encryptDecryptFunction = async() => {
|
|
// put keys in backtick (``) to avoid errors caused by spaces or tabs
|
|
const pubkey = document.getElementById("pubKey").value
|
|
|
|
const options = {
|
|
message: openpgp.message.fromText(document.getElementById("text").value), // input as Message object
|
|
publicKeys: (await openpgp.key.readArmored(pubkey)).keys, // for encryption
|
|
}
|
|
|
|
console.log(options);
|
|
|
|
openpgp.encrypt(options).then(ciphertext => {
|
|
encrypted = ciphertext.data // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
|
|
document.getElementById("result").value = encrypted;
|
|
})
|
|
}
|
|
</script>
|
|
<style>
|
|
html, body {
|
|
height: 95%;
|
|
}
|
|
div.main {
|
|
padding:20px;
|
|
height: 100%;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
<a class="navbar-brand" href="/">
|
|
<img src="/logo.svg" width="30" height="30" class="d-inline-block align-top" alt="">
|
|
browserPGP
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/encrypt.html">Encrypt</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/decrypt.html">Decrypt</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/gen.html">Key Generator</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="#">More to come.</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
<div class="main">
|
|
<h1 class="display-4">browserPGP</h1>
|
|
<a>A website that makes using PGP simple and secure. All work is done client side, so no private data leaves your computer.<br><br>If you want to be extra secure, disable internet while using this site.<br><br>- ar0n#1462</a>
|
|
<br><br>
|
|
<img src="pgp.png">
|
|
</div>
|
|
</body>
|
|
</html>
|