Table of Contents
Installing
CyberChef uses the Grunt build system, so it's very easy to install. You'll need to carry out the following steps to get going:
- Install Git
- Install Node.js version 24 (nvm is usually a good way of managing your Node versions)
git clone https://github.com/gchq/CyberChef.gitcd CyberChefnpm install
npm will then install all the dependencies needed to build and run CyberChef.
Consider adding
export NODE_OPTIONS=--max_old_space_size=2048to your~/.bashrcfile. If you attempt to build a production version of CyberChef, you may get a "JavaScript heap out of memory" error if you do not set this environment variable. You can also runnpm run setheapsizeto do this but it will not persist between terminal sessions.
Compiling
Note that CyberChef only supports bash-based dev environments, so primarily Linux and Mac. You may be able to get a build working on Windows, but it is not officially supported.
npm has been configured with several scripts to aid in the development process:
npm start
Use this when developing new functionality. It will launch a web server on port 8080 hosting an uncompressed, development version of CyberChef, accessible by browsing to
localhost:8080. Whenever a source file is modified, the development version will be rebuilt automatically.
npm run build
When you are ready to create a production build, run this command. It will lint, test, compile and compress all the source files and create a production-ready build in
build/prod/.
npm run node
This will package up CyberChef as a NodeJS library. More info on this can be found here: https://github.com/gchq/CyberChef/wiki/Node-API
npm test
This will run all the pre-configured tests and output the results to stdout.
Repository structure
.editorconfig- Text editor conventions stored in a cross-compatible formatbabel.config.js- - Babel transpilation configurationbuild/prod/- This folder contains the most recently built production version of CyberChef including the inline version. It is populated by runninggrunt prod.
CHANGELOG.mdCODE_OF_CONDUCT.mdCONTRIBUTING.mdDockerfile- Dockerfile for building a containerised deployment of CyberChefeslint.config.mjs- ESLint code linting configurationGruntfile.js- Grunt build process configurationLICENSE- The Apache 2.0 licence informationnightwatch.json- Nightwatch browser testing configuationpackage.json- npm configuration and a list of all the dependenciespackage-lock.json- frozen version of the above with all dependencies (automatically generated bynpm install)postcss.config.js- PostCSS configurationREADME.md- An introduction to CyberChefSECURITY.mdsrc/core/- Core CyberChef files that make up the heart of the applicationconfig/- Files specifying the operation configurationsmodules/- Automatically generated module referencesscripts/- Scripts for automating parts of the maintenance and build processes
dishTypes/- definitions of the types that can be passed in and out of operationserrors/- Custom error typeslib/- Libraries containing shared code for multiple operationsoperations/- Operation objectsvendor/- Libraries that cannot currently be imported through npm
node/- Wrappers for the NodeJS version of CyberChefconfig/- Files specifying the special operation configurations for the NodeJS versionscripts/- Scripts for automating parts of the maintenance and build processes
- `web/ - The code which makes up the CyberChef web app
- `html/
- `index.html - The CyberChef page structure
static/- files included as-is in the web appfonts/- font filesimages/- various images used within the web applogo/- logos
stylesheets/- styling for the appcomponents/- individual UI componentslayout/- layout for main UI compnonentsoperations/themes/- Look and feel stylesutils/- additional style compononents
utils/- functionality for major UI componentswaiters/workers/
- `html/
tests/- CyberChef test suitebrowser/- Browser functional testsoutput/- Output/logs from the browser tests
lib/- library files used by individual testsnode/- tests for Node APIsampleData/tests/- individual test suiteslib/- libraries used by test suites
operations/- Unit tests for the Operationstests/- Individual operation test suites
samples/- Sample data used in testingfiles/- Sample file data
webpack.config.js- Webpack configuration