a
This commit is contained in:
22
index.html
22
index.html
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user