Merge branch 'master' into theme-auto-detection

This commit is contained in:
Vijay Soni 2024-12-27 13:41:39 +05:30 committed by GitHub
commit 02f45e545d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 16 deletions

22
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"version": "10.19.2", "version": "10.19.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cyberchef", "name": "cyberchef",
"version": "10.19.2", "version": "10.19.4",
"hasInstallScript": true, "hasInstallScript": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
@ -115,7 +115,7 @@
"babel-plugin-dynamic-import-node": "^2.3.3", "babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-transform-builtin-extend": "1.1.2", "babel-plugin-transform-builtin-extend": "1.1.2",
"base64-loader": "^1.0.0", "base64-loader": "^1.0.0",
"chromedriver": "^127.0.2", "chromedriver": "^130.0.0",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"colors": "^1.4.0", "colors": "^1.4.0",
"copy-webpack-plugin": "^12.0.2", "copy-webpack-plugin": "^12.0.2",
@ -3982,12 +3982,12 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.6.7", "version": "1.7.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
"integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.4", "follow-redirects": "^1.15.6",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"proxy-from-env": "^1.1.0" "proxy-from-env": "^1.1.0"
} }
@ -5093,14 +5093,14 @@
} }
}, },
"node_modules/chromedriver": { "node_modules/chromedriver": {
"version": "127.0.2", "version": "130.0.0",
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-127.0.2.tgz", "resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-130.0.0.tgz",
"integrity": "sha512-mYfJ/8FqzsdFOs2rPiAI4y0suFnv78cRnzZK0MHdSfSIDeRPbqZz0rNX4lrXt14hXc9vqXa+a8cMxlrhWtXKSQ==", "integrity": "sha512-1g1eMoKF22Uh6l8DTFOPvWLovINPrkAMw7yDHlF6Rx+4W4JI9aGdCZ2Cx7c181hUgALU1oSKGH3uKNryYM5DaQ==",
"dev": true, "dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@testim/chrome-version": "^1.1.4", "@testim/chrome-version": "^1.1.4",
"axios": "^1.6.7", "axios": "^1.7.4",
"compare-versions": "^6.1.0", "compare-versions": "^6.1.0",
"extract-zip": "^2.0.1", "extract-zip": "^2.0.1",
"proxy-agent": "^6.4.0", "proxy-agent": "^6.4.0",

View file

@ -1,6 +1,6 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"version": "10.19.2", "version": "10.19.4",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.", "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>", "author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef", "homepage": "https://gchq.github.io/CyberChef",
@ -55,7 +55,7 @@
"babel-plugin-dynamic-import-node": "^2.3.3", "babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-transform-builtin-extend": "1.1.2", "babel-plugin-transform-builtin-extend": "1.1.2",
"base64-loader": "^1.0.0", "base64-loader": "^1.0.0",
"chromedriver": "^127.0.2", "chromedriver": "^130.0.0",
"cli-progress": "^3.12.0", "cli-progress": "^3.12.0",
"colors": "^1.4.0", "colors": "^1.4.0",
"copy-webpack-plugin": "^12.0.2", "copy-webpack-plugin": "^12.0.2",

View file

@ -60,7 +60,7 @@ class RSASign extends Operation {
const privateKey = forge.pki.decryptRsaPrivateKey(key, password); const privateKey = forge.pki.decryptRsaPrivateKey(key, password);
// Generate message hash // Generate message hash
const md = MD_ALGORITHMS[mdAlgo].create(); const md = MD_ALGORITHMS[mdAlgo].create();
md.update(input, "utf8"); md.update(input, "raw");
// Sign message hash // Sign message hash
const sig = privateKey.sign(md); const sig = privateKey.sign(md);
return sig; return sig;

View file

@ -8,6 +8,7 @@ import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs"; import OperationError from "../errors/OperationError.mjs";
import forge from "node-forge"; import forge from "node-forge";
import { MD_ALGORITHMS } from "../lib/RSA.mjs"; import { MD_ALGORITHMS } from "../lib/RSA.mjs";
import Utils from "../Utils.mjs";
/** /**
* RSA Verify operation * RSA Verify operation
@ -37,6 +38,11 @@ class RSAVerify extends Operation {
type: "text", type: "text",
value: "" value: ""
}, },
{
name: "Message format",
type: "option",
value: ["Raw", "Hex", "Base64"]
},
{ {
name: "Message Digest Algorithm", name: "Message Digest Algorithm",
type: "option", type: "option",
@ -51,7 +57,7 @@ class RSAVerify extends Operation {
* @returns {string} * @returns {string}
*/ */
run(input, args) { run(input, args) {
const [pemKey, message, mdAlgo] = args; const [pemKey, message, format, mdAlgo] = args;
if (pemKey.replace("-----BEGIN RSA PUBLIC KEY-----", "").length === 0) { if (pemKey.replace("-----BEGIN RSA PUBLIC KEY-----", "").length === 0) {
throw new OperationError("Please enter a public key."); throw new OperationError("Please enter a public key.");
} }
@ -60,7 +66,8 @@ class RSAVerify extends Operation {
const pubKey = forge.pki.publicKeyFromPem(pemKey); const pubKey = forge.pki.publicKeyFromPem(pemKey);
// Generate message digest // Generate message digest
const md = MD_ALGORITHMS[mdAlgo].create(); const md = MD_ALGORITHMS[mdAlgo].create();
md.update(message, "utf8"); const messageStr = Utils.convertToByteString(message, format);
md.update(messageStr, "raw");
// Compare signed message digest and generated message digest // Compare signed message digest and generated message digest
const result = pubKey.verify(md.digest().bytes(), input); const result = pubKey.verify(md.digest().bytes(), input);
return result ? "Verified OK" : "Verification Failure"; return result ? "Verified OK" : "Verification Failure";