mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 01:06:16 -04:00
Merge branch 'feature-add-pgp-kbpgp' of https://github.com/tlwr/CyberChef into tlwr-feature-add-pgp-kbpgp
This commit is contained in:
commit
1143c23ad9
6 changed files with 982 additions and 4 deletions
154
src/core/config/OperationConfig.js
Executable file → Normal file
154
src/core/config/OperationConfig.js
Executable file → Normal file
|
@ -28,6 +28,7 @@ import MAC from "../operations/MAC.js";
|
|||
import MorseCode from "../operations/MorseCode.js";
|
||||
import NetBIOS from "../operations/NetBIOS.js";
|
||||
import PHP from "../operations/PHP.js";
|
||||
import PGP from "../operations/PGP.js";
|
||||
import PublicKey from "../operations/PublicKey.js";
|
||||
import Punycode from "../operations/Punycode.js";
|
||||
import Regex from "../operations/Regex.js";
|
||||
|
@ -4159,6 +4160,159 @@ const OperationConfig = {
|
|||
outputType: "string",
|
||||
args: []
|
||||
},
|
||||
"Generate PGP Key Pair": {
|
||||
module: "PGP",
|
||||
manualBake: true,
|
||||
description: "",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Key type",
|
||||
type: "option",
|
||||
value: PGP.KEY_TYPES
|
||||
},
|
||||
{
|
||||
name: "Key size",
|
||||
type: "option",
|
||||
value: PGP.KEY_SIZES
|
||||
},
|
||||
{
|
||||
name: "Password (optional)",
|
||||
type: "string",
|
||||
value: ""
|
||||
},
|
||||
{
|
||||
name: "Name (optional)",
|
||||
type: "string",
|
||||
value: ""
|
||||
},
|
||||
{
|
||||
name: "Email (optional)",
|
||||
type: "string",
|
||||
value: ""
|
||||
},
|
||||
]
|
||||
},
|
||||
"PGP Encrypt": {
|
||||
module: "PGP",
|
||||
manualBake: true,
|
||||
description: [
|
||||
"Input: the message you want to encrypt.",
|
||||
"<br><br>",
|
||||
"Arguments: the ASCII-armoured PGP public key of the recipient.",
|
||||
"<br><br>",
|
||||
"Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.",
|
||||
"<br><br>",
|
||||
"This function relies on kbpgp.js for the implementation of PGP.",
|
||||
].join("\n"),
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Public key of recipient",
|
||||
type: "text",
|
||||
value: ""
|
||||
},
|
||||
]
|
||||
},
|
||||
"PGP Decrypt": {
|
||||
module: "PGP",
|
||||
manualBake: true,
|
||||
description: [
|
||||
"Input: the ASCII-armoured PGP message you want to decrypt.",
|
||||
"<br><br>",
|
||||
"Arguments: the ASCII-armoured PGP private key of the recipient, ",
|
||||
"(and the private key password if necessary).",
|
||||
"<br><br>",
|
||||
"Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.",
|
||||
"<br><br>",
|
||||
"This function relies on kbpgp.js for the implementation of PGP.",
|
||||
].join("\n"),
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Private key of recipient",
|
||||
type: "text",
|
||||
value: ""
|
||||
},
|
||||
{
|
||||
name: "Private key passphrase",
|
||||
type: "string",
|
||||
value: ""
|
||||
},
|
||||
]
|
||||
},
|
||||
"PGP Sign": {
|
||||
module: "PGP",
|
||||
manualBake: true,
|
||||
description: [
|
||||
"Input: the cleartext you want to sign.",
|
||||
"<br><br>",
|
||||
"Arguments: the ASCII-armoured private key of the signer (plus the private key password if necessary)",
|
||||
"and the ASCII-armoured PGP public key of the recipient.",
|
||||
"<br><br>",
|
||||
"This operation uses PGP to produce an encrypted digital signature.",
|
||||
"<br><br>",
|
||||
"Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.",
|
||||
"<br><br>",
|
||||
"This function relies on kbpgp.js for the implementation of PGP.",
|
||||
].join("\n"),
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Private key of signer",
|
||||
type: "text",
|
||||
value: ""
|
||||
},
|
||||
{
|
||||
name: "Private key passphrase",
|
||||
type: "string",
|
||||
value: ""
|
||||
},
|
||||
{
|
||||
name: "Public key of recipient",
|
||||
type: "text",
|
||||
value: ""
|
||||
},
|
||||
]
|
||||
},
|
||||
"PGP Verify": {
|
||||
module: "PGP",
|
||||
description: [
|
||||
"Input: the ASCII-armoured encrypted PGP message you want to verify.",
|
||||
"<br><br>",
|
||||
"Arguments: the ASCII-armoured PGP public key of the signer, ",
|
||||
"the ASCII-armoured private key of the recipient (and the private key password if necessary).",
|
||||
"<br><br>",
|
||||
"This operation uses PGP to decrypt and verify an encrypted digital signature.",
|
||||
"<br><br>",
|
||||
"Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.",
|
||||
"<br><br>",
|
||||
"This function relies on kbpgp.js for the implementation of PGP.",
|
||||
].join("\n"),
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Public key of signer",
|
||||
type: "text",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "Private key of recipient",
|
||||
type: "text",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "Private key password",
|
||||
type: "string",
|
||||
value: "",
|
||||
},
|
||||
]
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
|
25
src/core/config/modules/PGP.js
Normal file
25
src/core/config/modules/PGP.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
import PGP from "../../operations/PGP.js";
|
||||
|
||||
|
||||
/**
|
||||
* PGP module.
|
||||
*
|
||||
* Libraries:
|
||||
* - kbpgp
|
||||
*
|
||||
* @author tlwr [toby@toby.codes]
|
||||
* @author Matt C [matt@artemisbot.uk]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.PGP = {
|
||||
"Generate PGP Key Pair": PGP.runGenerateKeyPair,
|
||||
"PGP Encrypt": PGP.runEncrypt,
|
||||
"PGP Decrypt": PGP.runDecrypt,
|
||||
"PGP Sign": PGP.runSign,
|
||||
"PGP Verify": PGP.runVerify,
|
||||
};
|
||||
|
||||
export default OpModules;
|
Loading…
Add table
Add a link
Reference in a new issue