Fix decrypt operation

This commit is contained in:
Matt C 2018-01-12 11:45:16 +00:00
parent bfbefb7318
commit f07263ca2a
3 changed files with 10932 additions and 10943 deletions

21621
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,122 +1,120 @@
{ {
"name": "cyberchef", "name": "cyberchef",
"version": "7.4.0", "version": "7.4.0",
"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",
"copyright": "Crown copyright 2016", "copyright": "Crown copyright 2016",
"license": "Apache-2.0", "license": "Apache-2.0",
"keywords": [ "keywords": [
"cipher", "cipher",
"cypher", "cypher",
"encode", "encode",
"decode", "decode",
"encrypt", "encrypt",
"decrypt", "decrypt",
"base64", "base64",
"xor", "xor",
"charset", "charset",
"hex", "hex",
"encoding", "encoding",
"format", "format",
"cybersecurity", "cybersecurity",
"data manipulation", "data manipulation",
"data analysis" "data analysis"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/gchq/CyberChef/" "url": "https://github.com/gchq/CyberChef/"
}, },
"main": "build/node/CyberChef.js", "main": "build/node/CyberChef.js",
"bugs": "https://github.com/gchq/CyberChef/issues", "bugs": "https://github.com/gchq/CyberChef/issues",
"devDependencies": { "devDependencies": {
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
"babel-loader": "^7.1.2", "babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.0",
"babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0", "babel-preset-es2015": "^6.24.1",
"babel-preset-es2015": "^6.24.1", "babel-preset-stage-0": "^6.24.1",
"babel-preset-stage-0": "^6.24.1", "css-loader": "^0.28.7",
"css-loader": "^0.28.7", "exports-loader": "^0.6.4",
"exports-loader": "^0.6.4", "extract-text-webpack-plugin": "^3.0.2",
"extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.6",
"file-loader": "^1.1.6", "grunt": ">=1.0.1",
"grunt": ">=1.0.1", "grunt-accessibility": "~5.0.0",
"grunt-accessibility": "~5.0.0", "grunt-chmod": "~1.1.1",
"grunt-chmod": "~1.1.1", "grunt-concurrent": "^2.3.1",
"grunt-concurrent": "^2.3.1", "grunt-contrib-clean": "~1.1.0",
"grunt-contrib-clean": "~1.1.0", "grunt-contrib-copy": "~1.0.0",
"grunt-contrib-copy": "~1.0.0", "grunt-eslint": "^20.1.0",
"grunt-eslint": "^20.1.0", "grunt-exec": "~3.0.0",
"grunt-exec": "~3.0.0", "grunt-execute": "^0.2.2",
"grunt-execute": "^0.2.2", "grunt-jsdoc": "^2.2.0",
"grunt-jsdoc": "^2.2.0", "grunt-webpack": "^3.0.2",
"grunt-webpack": "^3.0.2", "html-webpack-plugin": "^2.30.1",
"html-webpack-plugin": "^2.30.1", "imports-loader": "^0.7.1",
"imports-loader": "^0.7.1", "ink-docstrap": "^1.3.2",
"ink-docstrap": "^1.3.2", "jsdoc-babel": "^0.3.0",
"jsdoc-babel": "^0.3.0", "less": "^2.7.3",
"less": "^2.7.3", "less-loader": "^4.0.5",
"less-loader": "^4.0.5", "postcss-css-variables": "^0.8.0",
"postcss-css-variables": "^0.8.0", "postcss-import": "^11.0.0",
"postcss-import": "^11.0.0", "postcss-loader": "^2.0.9",
"postcss-loader": "^2.0.9", "style-loader": "^0.19.1",
"style-loader": "^0.19.1", "url-loader": "^0.6.2",
"url-loader": "^0.6.2", "val-loader": "^1.1.0",
"val-loader": "^1.1.0", "web-resource-inliner": "^4.2.0",
"web-resource-inliner": "^4.2.0", "webpack": "^3.10.0",
"webpack": "^3.10.0", "webpack-dev-server": "^2.9.7",
"webpack-dev-server": "^2.9.7", "webpack-node-externals": "^1.6.0",
"webpack-node-externals": "^1.6.0", "worker-loader": "^1.1.0"
"worker-loader": "^1.1.0" },
}, "dependencies": {
"dependencies": { "babel-polyfill": "^6.26.0",
"babel-polyfill": "^6.26.0", "bignumber.js": "^5.0.0",
"bignumber.js": "^5.0.0", "bootstrap": "^3.3.7",
"bootstrap": "^3.3.7", "bootstrap-colorpicker": "^2.5.2",
"bootstrap-colorpicker": "^2.5.2", "bootstrap-switch": "^3.3.4",
"bootstrap-switch": "^3.3.4", "crypto-api": "^0.7.5",
"crypto-api": "^0.7.5", "crypto-js": "^3.1.9-1",
"crypto-js": "^3.1.9-1", "diff": "^3.3.1",
"diff": "^3.4.0", "es6-promisify": "^5.0.0",
"diff": "^3.3.1", "escodegen": "^1.9.0",
"es6-promisify": "^5.0.0", "esmangle": "^1.0.1",
"escodegen": "^1.9.0", "esprima": "^4.0.0",
"esmangle": "^1.0.1", "exif-parser": "^0.1.12",
"esprima": "^4.0.0", "file-saver": "^1.3.3",
"exif-parser": "^0.1.12", "google-code-prettify": "^1.0.5",
"file-saver": "^1.3.3", "jquery": "^3.2.1",
"google-code-prettify": "^1.0.5", "js-crc": "^0.2.0",
"jquery": "^3.2.1", "js-sha3": "^0.7.0",
"js-crc": "^0.2.0", "jsbn": "^1.1.0",
"js-sha3": "^0.7.0", "jsonpath": "^1.0.0",
"jsbn": "^1.1.0", "jsrsasign": "8.0.4",
"jsonpath": "^1.0.0", "kbpgp": "^2.0.76",
"jsrsasign": "8.0.4", "lodash": "^4.17.4",
"kbpgp": "^2.0.76", "loglevel": "^1.6.0",
"lodash": "^4.17.4", "loglevel-message-prefix": "^3.0.0",
"loglevel": "^1.6.0", "moment": "^2.20.1",
"loglevel-message-prefix": "^3.0.0", "moment-timezone": "^0.5.14",
"moment": "^2.20.1", "node-forge": "^0.7.1",
"moment-timezone": "^0.5.14", "node-md6": "^0.1.0",
"node-forge": "^0.7.1", "nwmatcher": "^1.4.3",
"node-md6": "^0.1.0", "otp": "^0.1.3",
"nwmatcher": "^1.4.3", "sladex-blowfish": "^0.8.1",
"otp": "^0.1.3", "sortablejs": "^1.7.0",
"sladex-blowfish": "^0.8.1", "split.js": "^1.3.5",
"sortablejs": "^1.7.0", "utf8": "^3.0.0",
"split.js": "^1.3.5", "vkbeautify": "^0.99.3",
"utf8": "^3.0.0", "xmldom": "^0.1.27",
"vkbeautify": "^0.99.3", "xpath": "0.0.27",
"xmldom": "^0.1.27", "zlibjs": "^0.3.1"
"xpath": "0.0.27", },
"zlibjs": "^0.3.1" "scripts": {
}, "start": "grunt dev",
"scripts": { "build": "grunt prod",
"start": "grunt dev", "test": "grunt test",
"build": "grunt prod", "docs": "grunt docs"
"test": "grunt test", }
"docs": "grunt docs" }
}
}

View file

@ -145,7 +145,6 @@ const PGP = {
armored: plainPubKey, armored: plainPubKey,
}); });
} catch (err) { } catch (err) {
console.error(err);
throw `Could not import public key: ${err}`; throw `Could not import public key: ${err}`;
} }
@ -155,13 +154,10 @@ const PGP = {
encrypt_for: key, encrypt_for: key,
}); });
} catch (err) { } catch (err) {
console.error(err); throw `Couldn't encrypt message with provided public key: ${err}`;
throw `Could encrypt message to provided public key: ${err}`;
} }
console.log(encryptedMessage); return encryptedMessage.toString();
return encryptedMessage;
}, },
async runDecrypt(input, args) { async runDecrypt(input, args) {
@ -187,10 +183,10 @@ const PGP = {
keyfetch: keyring, keyfetch: keyring,
}); });
} catch (err) { } catch (err) {
throw `Could decrypt message to provided private key: ${err}`; throw `Couldn't decrypt message with provided private key: ${err}`;
} }
return plaintextMessage; return plaintextMessage.toString();
}, },
}; };