a
This commit is contained in:
10
decrypt.html
10
decrypt.html
@@ -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>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<title>browserPGP | Encrypt</title>
|
||||
<meta name="description" content="Encrypt 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 pubkey = document.getElementById("pubKey").value
|
||||
|
||||
@@ -29,6 +30,7 @@
|
||||
openpgp.encrypt(options).then(ciphertext => {
|
||||
encrypted = ciphertext.data // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
|
||||
document.getElementById("result").value = encrypted;
|
||||
document.getElementById("progressbar").className = "progress-bar bg-success";
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -80,7 +82,7 @@
|
||||
<div class="col-sm">
|
||||
<div class="form-group">
|
||||
<label for="exampleFormControlTextarea1">Input Text</label>
|
||||
<textarea class="form-control" id="text" rows="5" placeholder="So basically, I'm monky."></textarea>
|
||||
<textarea class="form-control" id="text" rows="5" placeholder="Secret Message"></textarea>
|
||||
</div>
|
||||
<button type="button" onclick="encryptDecryptFunction()" class="btn btn-primary">Encrypt</button>
|
||||
</div>
|
||||
|
||||
5
gen.html
5
gen.html
@@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<title>browserPGP | Key Gen</title>
|
||||
<meta name="description" content="Generate PGP keys 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">
|
||||
@@ -93,6 +93,9 @@
|
||||
</div>
|
||||
<small id="emailHelp" class="form-text text-danger">This may take some time and cause browser lag.</small>
|
||||
<br>
|
||||
<div class="form-group progress">
|
||||
<div class="progress-bar" role="progressbar" id="progressbar" style="width: 100%"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="button" onclick="encryptDecryptFunction()" class="btn btn-primary">Generate</button>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<title>browserPGP</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="description" content="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">
|
||||
|
||||
17
sign.html
17
sign.html
@@ -12,12 +12,14 @@
|
||||
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
|
||||
const msg = document.getElementById("msg").value
|
||||
|
||||
const privKeyObj = (await openpgp.key.readArmored(privkey)).keys[0]
|
||||
|
||||
if (passphrase) {
|
||||
await privKeyObj.decrypt(passphrase)
|
||||
}
|
||||
@@ -28,8 +30,14 @@
|
||||
};
|
||||
|
||||
openpgp.sign(options).then(function(signed) {
|
||||
if (signed.data) {
|
||||
cleartext = signed.data; // '-----BEGIN PGP SIGNED MESSAGE ... END PGP SIGNATURE-----'
|
||||
document.getElementById("result").value = cleartext;
|
||||
document.getElementById("progressbar").className = "progress-bar bg-success";
|
||||
} else {
|
||||
document.getElementById("result").value = 'Signing failed.';
|
||||
document.getElementById("progressbar").className = "progress-bar bg-danger";
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@@ -75,7 +83,7 @@
|
||||
<div class="col-sm">
|
||||
<div class="form-group">
|
||||
<label for="exampleFormControlTextarea1">Message</label>
|
||||
<textarea class="form-control" style="font-size: 10px;" rows="10" id="msg" placeholder=""></textarea>
|
||||
<textarea class="form-control" rows="6" id="msg" placeholder="Message to be signed. Don't sign anything vague as it could be used by someone to pretend to be you, include dates and specifics."></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleFormControlTextarea1">PGP Privkey</label>
|
||||
@@ -87,12 +95,15 @@
|
||||
<label for="exampleInputEmail1">Privkey Passphrase</label>
|
||||
<input type="password" class="form-control" id="pass" placeholder="Enter passphrase">
|
||||
</div>
|
||||
<button type="button" onclick="encryptDecryptFunction()" class="btn btn-primary">Decrypt</button>
|
||||
<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">Sign</button>
|
||||
</div>
|
||||
<div class="col-sm" style="height:100%;">
|
||||
<div class="form-group">
|
||||
<label for="exampleFormControlTextarea1">PGP Message</label>
|
||||
<textarea class="form-control" rows="10" placeholder="So basically, I'm monky." id="result" readonly></textarea>
|
||||
<textarea class="form-control" style="font-size: 10px;" rows="20" placeholder="-----BEGIN PGP SIGNED MESSAGE-----" id="result" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
16
verify.html
16
verify.html
@@ -11,6 +11,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 pubkey = document.getElementById("pubKey").value
|
||||
const cleartext = document.getElementById("signMsg").value
|
||||
@@ -23,7 +24,11 @@
|
||||
openpgp.verify(options).then(function(verified) {
|
||||
validity = verified.signatures[0].valid; // true
|
||||
if (validity) {
|
||||
document.getElementById("result").value('signed by key id ' + verified.signatures[0].keyid.toHex());
|
||||
document.getElementById("result").value = 'Signed by key id ' + verified.signatures[0].keyid.toHex();
|
||||
document.getElementById("progressbar").className = "progress-bar bg-success";
|
||||
} else {
|
||||
document.getElementById("progressbar").className = "progress-bar bg-danger";
|
||||
document.getElementById("result").value = 'Verification wrong or failed. DO NOT TRUST.';
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -76,14 +81,17 @@
|
||||
<div class="col-sm">
|
||||
<div class="form-group">
|
||||
<label for="exampleFormControlTextarea1">Public Key</label>
|
||||
<textarea class="form-control" id="pubKey" rows="5" placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"></textarea>
|
||||
<textarea class="form-control" style="font-size: 10px;" id="pubKey" rows="10" placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"></textarea>
|
||||
</div>
|
||||
<button type="button" onclick="encryptDecryptFunction()" class="btn btn-primary">Encrypt</button>
|
||||
<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">Verify</button>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="form-group">
|
||||
<label for="exampleFormControlTextarea1">PGP Output</label>
|
||||
<textarea class="form-control" style="font-size: 10px;" rows="10" id="result" placeholder="-----BEGIN PGP MESSAGE-----" readonly></textarea>
|
||||
<textarea class="form-control" style="font-size: 10px;" rows="10" id="result" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user