This commit is contained in:
unknown
2018-11-07 22:04:09 +00:00
parent 062f292fcc
commit 4bd022a89c
2 changed files with 187 additions and 19 deletions

View File

@@ -7,26 +7,10 @@
<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="favicon.js"></script>
<script src="md5.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;
})
}
page = document.documentElement.outerHTML;
pagemd5 = md5(document.documentElement.outerHTML);
</script>
<style>
html, body {