This commit is contained in:
exams228
2018-11-12 10:03:12 +00:00
parent c9a5964ae6
commit be663acc50
6 changed files with 44 additions and 16 deletions

View File

@@ -2,7 +2,7 @@
<head>
<title>browserPGP | Decrypt</title>
<meta name="description" content="Decrypt PGP in browser, simple and secure.">
<meta name="keywords" content="PGP,online,browser,javascript,github,live,secure,key generator,encrypt,decrypt,sign,verify">
<meta name="keywords" content="browserPGP,PGP,online,browser,javascript,github,live,secure,key generator,encrypt,decrypt,sign,verify">
<meta name="author" content="ar0n#1462">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
@@ -16,6 +16,7 @@
openpgp.initWorker({ path:'openpgp.worker.min.js' }) // set the relative web worker path
const encryptDecryptFunction = async() => {
document.getElementById("progressbar").className = "progress-bar progress-bar-striped progress-bar-animated";
// put keys in backtick (``) to avoid errors caused by spaces or tabs
const privkey = document.getElementById("privKey").value
const passphrase = document.getElementById("pass").value
@@ -32,8 +33,8 @@
}
openpgp.decrypt(options).then(plaintext => {
console.log(plaintext.data)
document.getElementById("result").value = plaintext.data;
document.getElementById("progressbar").className = "progress-bar bg-success";
})
}
</script>
@@ -91,12 +92,15 @@
<label for="exampleInputEmail1">Privkey Passphrase</label>
<input type="password" class="form-control" id="pass" placeholder="Enter passphrase">
</div>
<div class="form-group progress">
<div class="progress-bar" role="progressbar" id="progressbar" style="width: 100%"></div>
</div>
<button type="button" onclick="encryptDecryptFunction()" class="btn btn-primary">Decrypt</button>
</div>
<div class="col-sm" style="height:100%;">
<div class="form-group">
<label for="exampleFormControlTextarea1">Message</label>
<textarea class="form-control" rows="10" placeholder="So basically, I'm monky." id="result" readonly></textarea>
<textarea class="form-control" rows="10" placeholder="Secret Message" id="result" readonly></textarea>
</div>
</div>
</div>