Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: ESM Conversion #284

Merged
merged 204 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
204 commits
Select commit Hold shift + click to select a range
fc2828f
Added Magic operation with the ability to detect language, file type …
n1474335 Jan 14, 2018
a1624a9
Added detection patterns for non-standard Base64 alphabets, Base58 an…
n1474335 Jan 14, 2018
48f8ca6
Added detection patterns for Octal, Binary, Decimal, Hexdumps, HTML E…
n1474335 Jan 14, 2018
615a020
Added detection patterns for UNIX timestamps, Zlib deflate, Gzip, Zip…
n1474335 Jan 22, 2018
b035f6c
Added detection patterns for X.509 certs, Morse Code, Tar, images and…
n1474335 Jan 22, 2018
57314b7
Merge branch 'master' into feature-magic
n1474335 Jan 22, 2018
28abd00
Added speculative execution of recipes to determine the most likely d…
n1474335 Jan 22, 2018
6947d2a
Magic operation now displays an ordered table of the most likely deco…
n1474335 Jan 22, 2018
865ee6a
Magic operation tidying
n1474335 Jan 23, 2018
6624f25
Magic operation now detects UTF8 and gives a probability score for ea…
n1474335 Feb 10, 2018
23bdfd0
Magic operation now shows matching ops even if they are not run.
n1474335 Feb 10, 2018
2bc563b
Added support for 238 languages to the Magic operation.
n1474335 Feb 10, 2018
544d78f
The Magic operation now only checks the most commonly used Internet l…
n1474335 Feb 14, 2018
99ade42
Added 'Intensive mode' to the Magic operation, where it brute-forces …
n1474335 Feb 14, 2018
1760ab2
Recipe errors are now ignored in the Magic operation
n1474335 Feb 14, 2018
27ec4aa
Magic operation now recognises useful operations such as 'Render Imag…
n1474335 Feb 15, 2018
b3c52a8
Magic operation now brute forces character encodings. Linted.
n1474335 Feb 15, 2018
559741f
Fixed a few small bugs
n1474335 Feb 15, 2018
56d33ea
Magic operation now calculates the entropy of each option and display…
n1474335 Feb 19, 2018
d166dda
Started updating Bootstrap to v4
n1474335 Mar 2, 2018
5a7bb09
Fixed popovers in Bootstrap v4
n1474335 Mar 2, 2018
bcc8804
Updated buttons, fonts and collapse
n1474335 Mar 2, 2018
7d15bfe
initial functionality commit
Mar 16, 2018
20e54a8
add tests for setOperations
d98762625 Mar 22, 2018
2c68be3
add comments
d98762625 Mar 25, 2018
208cb05
reuse difference function for symmetric difference
d98762625 Mar 25, 2018
e8bb9e2
more comments
d98762625 Mar 25, 2018
951568c
use bind for partial application of power set function
d98762625 Mar 25, 2018
f3610e7
fix lint errors
d98762625 Mar 25, 2018
e403adb
fix more linting errors
d98762625 Mar 25, 2018
9b4fc3d
Converted the core to ES modules
n1474335 Mar 26, 2018
041cd9f
ESM: Added remaining Base64 ops and created a Base64 library. Added t…
n1474335 Apr 2, 2018
0011e9c
Added .editorconfig
n1474335 Apr 2, 2018
eeb1d0a
ESM: Added Hex ops and created a Hex library.
n1474335 Apr 2, 2018
fbb3a02
ESM: The operations index is now generated automatically
n1474335 Apr 2, 2018
083d2d1
ESM: Added Zlib ops and created a Zlib library.
n1474335 Apr 2, 2018
4988ead
Rotate module converted to ESM
Apr 3, 2018
7e86f02
Deleted legacy Rotate module
Apr 3, 2018
af51090
Added rotate ESM tests
mattnotmitt Apr 3, 2018
7ce1bf1
merge esm
d98762625 Apr 4, 2018
f491461
inital move of two ops
d98762625 Apr 4, 2018
fad4713
ESM: Tidied up Rotate operations
n1474335 Apr 6, 2018
ae55fde
Merge branch 'artemisbot-esm' into esm
n1474335 Apr 6, 2018
5f93c66
Pull SetUnion into its own operation
d98762625 Apr 6, 2018
03ecaa8
move Set Intersection into its own operation class
d98762625 Apr 6, 2018
b7ed1be
ESM: Added new List<File> Dish type. Added present() method for displ…
n1474335 Apr 6, 2018
852c95a
add Set Difference operation
d98762625 Apr 9, 2018
adc4f78
Add other set operations
d98762625 Apr 9, 2018
543dce5
remove setOps operation
d98762625 Apr 9, 2018
76f27db
pull from upstream
d98762625 Apr 9, 2018
bbc580e
Quick fix for empty recipe error. Changed deflate back to compression…
d98762625 Apr 9, 2018
955a082
add lint command to package.json. Remove old conflict remnants
d98762625 Apr 9, 2018
e99331f
ESM: Tidied up Set operations
n1474335 Apr 11, 2018
dc5ce31
ESM: .gitignore now ignores generated files
n1474335 Apr 11, 2018
23f69bd
Merge branch 'd98762625-set-operations' into esm
n1474335 Apr 11, 2018
4e38b09
ESM: Config scripts now run synchronously before webpack builds start
n1474335 Apr 11, 2018
30aa4e0
ESM: 'grunt test' now generates configs before running
n1474335 Apr 11, 2018
76a066a
The raw, unpresented dish is now returned to the app after baking, wh…
n1474335 Apr 21, 2018
a8aa1bc
Added File and JSON Dish types and updated types for compression ops.
n1474335 Apr 21, 2018
cc20ad9
Add OperationError error type and use for errors to be printed to the…
d98762625 Apr 27, 2018
0dbc7d4
Tidied up OperationError code.
n1474335 Apr 30, 2018
4cff1c8
Merge branch 'd98762625-op-errors' into esm
n1474335 Apr 30, 2018
1f87781
ESM: Added portOperation.mjs script. Added To and From Hexdump operat…
n1474335 May 6, 2018
be61419
ESM: Added remaining ByteRepr operations.
n1474335 May 6, 2018
0ca0e74
Merge branch 'esm' of github.com:gchq/CyberChef into esm
n1474335 May 7, 2018
6987e6b
ESM: Ported Bit shift, MAC address and Morse Code operations.
n1474335 May 7, 2018
f87666f
Converted Affine/Atbash operations to mjs & added tests
mattnotmitt May 9, 2018
789ec94
Converted Bifid & moved over tests
mattnotmitt May 9, 2018
6bec680
Converted Vignere, added more tests and cleaned stuff up
mattnotmitt May 9, 2018
350d10d
Added toggleString support
mattnotmitt May 11, 2018
2d6a563
Converted substitute operation, added tests & moved to OperationError
mattnotmitt May 11, 2018
a98d37e
Merged master into esm branch
n1474335 May 14, 2018
037e2f3
ESM: Ported StrUtils and NetBIOS operations.
n1474335 May 14, 2018
66c768f
ESM: Ported Tidy operations. Updated portOperation script to attempt …
n1474335 May 14, 2018
d327dd4
ESM: Ported SeqUtils operations
n1474335 May 14, 2018
cefe5bb
ESM: Ported Convert operations
n1474335 May 14, 2018
4008dbf
Merge remote-tracking branch 'upstream/esm' into esmconversion
mattnotmitt May 14, 2018
10005ce
ESM: Ported OS operations
n1474335 May 14, 2018
24e4e26
Converted RC4, RC4Drop and Derive EVP
mattnotmitt May 14, 2018
e6f19c3
Fixed linebreaks in test index (thanks VSCode)
mattnotmitt May 14, 2018
bad45f1
ESM: Ported DateTime operations
n1474335 May 14, 2018
cbb5e7c
Merge branch 'esmconversion' of https://github.com/artemisbot/CyberCh…
n1474335 May 14, 2018
61832a9
ESM: whitespace tidying
n1474335 May 14, 2018
a7d7632
ESM: Ported AES operations
n1474335 May 14, 2018
c9e9499
Merge remote-tracking branch 'upstream/esm' into esmconversion
mattnotmitt May 14, 2018
b8d39f4
Convert URL operations
mattnotmitt May 14, 2018
4fe34a4
port Sum operation
d98762625 May 15, 2018
2b0c327
Ported x86 Disassembler & PGP ops
mattnotmitt May 15, 2018
30288c6
add Subtract op
d98762625 May 15, 2018
bf28410
port multiply operation
d98762625 May 15, 2018
9de9302
port divide operation
d98762625 May 15, 2018
2716be3
port mean operation
d98762625 May 15, 2018
1198094
port median operation
d98762625 May 15, 2018
f79dd29
port standard deviation ops
d98762625 May 15, 2018
6ddc1b1
export Arithmetic funcs individually. Use existing Delim
d98762625 May 15, 2018
3bbfc13
create arithmetic specific delimiter options
d98762625 May 15, 2018
b8d3b33
ESM: Ported CharEnc operations
n1474335 May 15, 2018
285e512
Actually made these ops work
mattnotmitt May 15, 2018
3c214ce
Deleted PGP file
mattnotmitt May 15, 2018
e41eb3d
Merge branch 'port-arithmetic' of https://github.com/d98762625/CyberC…
n1474335 May 15, 2018
c90acd2
ESM: Added author tag to Sum op
n1474335 May 15, 2018
b3ee251
ESM: Port Extract.js module
mattnotmitt May 15, 2018
2e4f5b7
Changed all error returns to OperationErrors
mattnotmitt May 15, 2018
07715bd
ESM: Rewritten src/web/ in ESM format.
n1474335 May 15, 2018
03f4359
Imported OperationError to TranslateDateTimeFormat
mattnotmitt May 15, 2018
39ba83e
Created a Ip for now which contains all the helper functions, they ma…
May 15, 2018
5b6d57f
Ported "Parse IP Range".
May 15, 2018
8d2adfa
Updated the Ip core file with more required functions/variables
May 15, 2018
654596e
Ported "Parse IPv6 Address"
May 15, 2018
acb8a34
Merge branch 'esmconversion' of https://github.com/artemisbot/CyberCh…
n1474335 May 16, 2018
b760c2f
ESM: Fixed OperationError detection and tidied up ops.
n1474335 May 16, 2018
ebcc5bd
ESM: Added generateConfig calls to relevant grunt tasks
n1474335 May 16, 2018
84df055
ESM: Ported MS and Entropy operations
n1474335 May 16, 2018
f26d175
ESM: Ported Base58, Base and BCD operations
n1474335 May 16, 2018
5362508
ESM: Ported HTML, Unicode, Quoted Printable and Endian operations
n1474335 May 16, 2018
1920e9c
Added more content to the Ip.mjs file, required for other functions.
May 16, 2018
161f89c
Ported the TCPIPChecksum operation.
May 16, 2018
792218d
Ported the ChangeIPFormat operation.
May 16, 2018
b7bdd4e
Ported the GroupIPAddresses operation.
May 16, 2018
c17e897
Ported the ParseIPv4Header operation.
May 16, 2018
ea36687
Merge branch 'esm' of https://github.com/gchq/CyberChef into ip-convert
May 16, 2018
3ba12ae
Made variables non-private, and followed convention for the reference…
May 16, 2018
3fd1f4e
ESM: Ported all Hash and Checksum operations
n1474335 May 17, 2018
1dddcb4
ESM: Ported various tests for completed operations
n1474335 May 17, 2018
3f08fa3
update package-lock
d98762625 May 18, 2018
0f6ee68
edit setter in Register
d98762625 May 18, 2018
72d943a
Add register
d98762625 May 18, 2018
bca73b4
add Merge (without Fork). Add flowcontrol setter to Operation
d98762625 May 18, 2018
bfb405c
Add Jump
d98762625 May 18, 2018
ec0ecf5
add comments
d98762625 May 18, 2018
ee519c7
Merged esm branch into feature-magic. Ported FileType ops.
n1474335 May 20, 2018
093a7c8
ESM: Config files are now initialised correctly.
n1474335 May 20, 2018
9f52689
Merge branch 'esm' of github.com:gchq/CyberChef into esm
d98762625 May 21, 2018
046e1eb
Merge branch 'esm' into port-flowcontrol
d98762625 May 21, 2018
8ff6596
add other flowcontrol ops. Update tests
d98762625 May 21, 2018
10556f5
update comments
d98762625 May 21, 2018
4990a1f
ESM: Added file exists check to npm postinstall script.
n1474335 May 21, 2018
1472f82
Merge branch 'port-flowcontrol' of https://github.com/d98762625/Cyber…
n1474335 May 21, 2018
28b24b7
ESM: Tidied up FlowControl ops
n1474335 May 21, 2018
739e06d
Merge branch 'd98762625-port-flowcontrol' into esm
n1474335 May 21, 2018
eed28f6
ESM: Ported UUID, OTP, Numberwang and PHP operations
n1474335 May 21, 2018
749b051
ESM: Ported BSON, ToTable, Filetime and XKCD operations
n1474335 May 21, 2018
cefe3fc
ESM: Ported Bzip2, Diff and Tar operations
n1474335 May 21, 2018
0d1e531
ESM: Changed thrown errors to OperationErrors
n1474335 May 21, 2018
c29ea53
ESM: Ported Punycode, HTTP and PRNG operations
n1474335 May 21, 2018
189e077
Ported blowfish operations and library to ESM modules
mattnotmitt May 23, 2018
46b8b2f
Converted DES and TripleDES ops
mattnotmitt May 23, 2018
9ffab37
Converted PBKDF2 and RC2, enabled tests, deleted legacy Cipher file
mattnotmitt May 23, 2018
95f81ad
Ported Bitwise operations
mattnotmitt May 23, 2018
176e83a
Converted JS operations
mattnotmitt May 23, 2018
905bc66
ESM: Ported case converters, generic beautifier and syntax highlighting
mattnotmitt May 26, 2018
6768038
ESM: Tidied up recently ported ops
n1474335 May 27, 2018
ade056e
Merge branch 'artemisbot-esmconversion' into esm
n1474335 May 27, 2018
eb3a250
Ported rest of Code ops & enabled/fixed some tests
mattnotmitt May 27, 2018
709630f
Ported Image operations + some cleanup
mattnotmitt May 27, 2018
049656e
ESM: Ported PublicKey operations
mattnotmitt May 27, 2018
6a56118
ESM: Ported RegEx operations
mattnotmitt May 27, 2018
3f3a3e0
ESM: Tidied up recently added operations
n1474335 May 28, 2018
40b29d7
Merge branch 'artemisbot-esmconversion' into esm
n1474335 May 28, 2018
7f9a2ee
ESM: Tidied up IP operations
n1474335 May 28, 2018
be0fc75
Merge branch 'picapi-ip-convert' into esm
n1474335 May 28, 2018
60340fc
ESM: Removed legacy files
n1474335 May 29, 2018
78c1c4d
ESM: Added builder script to generate new operations. npm run newop
n1474335 May 29, 2018
6a4bc3c
ESM: Fixed PGP ops and added tests
n1474335 May 29, 2018
37c8d1b
ESM: Fixed OpModules import to make inline version function correctly
n1474335 May 29, 2018
a0f034b
ESM: Fixed magic errors
n1474335 Jun 1, 2018
1ef4f71
ESM: Added BackgroundWorkerWaiter for running Magic on output in the …
n1474335 Jun 3, 2018
40a1da1
Merge branch 'esm' of github.com:gchq/CyberChef into esm
n1474335 Jun 3, 2018
1ce6e32
Merged ESM into feature-bootstrap4. Started work on text inputs.
n1474335 Jun 9, 2018
27b0505
Merged ESM into feature-bootstrap4
n1474335 Jun 9, 2018
2bacd64
Converted operation arguments to material design
n1474335 Jun 10, 2018
7d410fc
Converted op-icons to material design and improved controls.
n1474335 Jun 10, 2018
4ca14ed
'From Hexdump' now supports an alternative style of Wireshark hexdump…
n1474335 Jun 13, 2018
4147ec7
Converted modals to Bootstrap 4 Material Design
n1474335 Jun 17, 2018
ab9bc7e
Fixed boolean arg checkboxes
n1474335 Jun 17, 2018
fa523e0
Changed banner icons to Material Design
n1474335 Jun 17, 2018
974ab29
Switched toggle string dropdown sides and removed form-control padding
n1474335 Jun 17, 2018
ba79144
Operation arguments are now arranged using CSS Grid
n1474335 Jun 18, 2018
7504f89
Fixed flow control operation argument text colour
n1474335 Jun 19, 2018
67dffbe
Actually fixed flow control operation argument text colour
n1474335 Jun 19, 2018
4338e26
Replaced Bootstrap alert with Material Design snackbar
n1474335 Jun 19, 2018
dcf3152
Operation cursor now indicates that it can be dragged
n1474335 Jun 19, 2018
052c32e
Arguments are now bordered white boxes again
n1474335 Jul 12, 2018
d182261
Switched to unbordered args
n1474335 Jul 13, 2018
a39e2c1
Fixed input and output cards
n1474335 Jul 13, 2018
ab44100
Changed table-condensed to table-sm
n1474335 Jul 13, 2018
651ca6c
Fixed all HTML operations
n1474335 Jul 15, 2018
ba5c503
Added Magic button and tweaked margins for Windows
n1474335 Jul 26, 2018
541e4ff
Added functionality to Magic button and improved the icon
n1474335 Jul 27, 2018
33b2fd8
Improved magic and staleness indicator animations
n1474335 Jul 27, 2018
035b6df
Added font and icon
n1474335 Jul 27, 2018
c3a3538
Linted
n1474335 Jul 27, 2018
2a55f13
Fixed themes for MD
n1474335 Aug 2, 2018
87b7721
Added Haversine distance operation
Dachande663 Aug 3, 2018
53b92ae
Further CSS tweaks
n1474335 Aug 3, 2018
a947e06
Added option to turn off background auto magic
n1474335 Aug 3, 2018
1b2d09c
Merge branch 'esm' into feature-bootstrap4
n1474335 Aug 3, 2018
c9635be
Merge branch 'feature-bootstrap4' into esm
n1474335 Aug 3, 2018
63e0e4e
Merge branch 'operation-haversine' of https://github.com/Dachande663/…
n1474335 Aug 3, 2018
ff59a9d
Moved Haversine Distance operation in categories
n1474335 Aug 3, 2018
bd34f6b
Merge branch 'Dachande663-operation-haversine' into esm
n1474335 Aug 3, 2018
8da9af8
Updated dependencies
n1474335 Aug 4, 2018
4dc6dac
Added CHANGELOG.md
n1474335 Aug 6, 2018
0453bd0
Removed phantomjs-prebuilt from direct dependencies
n1474335 Aug 6, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@
"modules": false,
"useBuiltIns": true
}]
],
"plugins": [
["babel-plugin-transform-builtin-extend", {
"globals": ["Error"]
}]
]
}
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
src/core/lib/**
src/core/config/MetaConfig.js
src/core/vendor/**
6 changes: 3 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parserOptions": {
"ecmaVersion": 8,
"ecmaVersion": 9,
"ecmaFeatures": {
"impliedStrict": true
},
Expand Down Expand Up @@ -84,12 +84,12 @@
"no-whitespace-before-property": "error",
"operator-linebreak": ["error", "after"],
"space-in-parens": "error",
"no-var": "error"
"no-var": "error",
"prefer-const": "error"
},
"globals": {
"$": false,
"jQuery": false,
"moment": false,
"log": false,

"COMPILE_TIME": false,
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ docs/*
!docs/*.conf.json
!docs/*.ico
.vscode
src/core/config/MetaConfig.js
src/core/config/modules/*
src/core/config/OperationConfig.json
src/core/operations/index.mjs

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "8.4"
- node
install: npm install
before_script:
- npm install -g grunt
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog
All notable changes to this project will be documented in this file.

## [8.0.0] - 2018-08-05
- Codebase rewritten using [ES modules](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/) and [classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) #284
- Operation architecture restructured to make adding new operations a lot simpler #284
- A script has been added to aid in the creation of new operations by running `npm run newop` @n1474335 #284
- 'Magic' operation added - [automated detection of encoded data](https://github.com/gchq/CyberChef/wiki/Automatic-detection-of-encoded-data-using-CyberChef-Magic) @n1474335 #239
- UI updated to use [Bootstrap Material Design](https://fezvrasta.github.io/bootstrap-material-design/) @n1474335 #248
- `JSON`, `File` and `List<File>` Dish types added @n1474335 #284
- `OperationError` type added for better handling of errors thrown by operations @d98762625 #296
- A `present()` method has been added, allowing operations to pass machine-friendly data to subsequent operations whilst presenting human-friendly data to the user @n1474335 #284
- Set operations added @d98762625 #281
- 'To Table' operation added @JustAnotherMark #294
- 'Haversine distance' operation added @Dachande663 #325
- Started keeping a changelog @n1474335

## [7.0.0] - 2017-12-28
- Added support for loading, processing and downloading files up to 500MB @n1474335 #224

## [6.0.0] - 2017-09-19
- Added threading support, moving all recipe processing into a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) to increase performance and allow long-running operations to be cancelled @n1474335 #173
- Created modules so that operations relying on large libraries can be downloaded separately as required, reducing the initial loading time for the app @n1474335 #173

## [5.0.0] - 2017-03-30
- Configured Webpack build process, Babel transpilation and ES6 imports and exports @n1474335 #95

## [4.0.0] - 2016-11-28
- Initial open source commit @n1474335


[8.0.0]: https://github.com/gchq/CyberChef/releases/tag/v8.0.0
[7.0.0]: https://github.com/gchq/CyberChef/releases/tag/v7.0.0
[6.0.0]: https://github.com/gchq/CyberChef/releases/tag/v6.0.0
[5.0.0]: https://github.com/gchq/CyberChef/releases/tag/v5.0.0
[4.0.0]: https://github.com/gchq/CyberChef/commit/b1d73a725dc7ab9fb7eb789296efd2b7e4b08306
119 changes: 52 additions & 67 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const NodeExternals = require("webpack-node-externals");
const Inliner = require("web-resource-inliner");
const fs = require("fs");
const glob = require("glob");
const path = require("path");

/**
* Grunt configuration for building the app in various formats.
Expand All @@ -21,31 +22,31 @@ module.exports = function (grunt) {
// Tasks
grunt.registerTask("dev",
"A persistent task which creates a development build whenever source files are modified.",
["clean:dev", "concurrent:dev"]);
["clean:dev", "exec:generateConfig", "concurrent:dev"]);

grunt.registerTask("node",
"Compiles CyberChef into a single NodeJS module.",
["clean:node", "webpack:metaConf", "webpack:node", "chmod:build"]);
["clean:node", "clean:config", "exec:generateConfig", "webpack:node", "chmod:build"]);

grunt.registerTask("test",
"A task which runs all the tests in test/tests.",
["clean:test", "webpack:metaConf", "webpack:tests", "execute:test"]);
["exec:generateConfig", "exec:tests"]);

grunt.registerTask("docs",
"Compiles documentation in the /docs directory.",
["clean:docs", "jsdoc", "chmod:docs"]);

grunt.registerTask("prod",
"Creates a production-ready build. Use the --msg flag to add a compile message.",
["eslint", "clean:prod", "webpack:metaConf", "webpack:web", "inline", "chmod"]);
["eslint", "clean:prod", "exec:generateConfig", "webpack:web", "inline", "chmod"]);

grunt.registerTask("default",
"Lints the code base",
["eslint", "exec:repoSize"]);

grunt.registerTask("inline",
"Compiles a production build of CyberChef into a single, portable web page.",
["webpack:webInline", "runInliner", "clean:inlineScripts"]);
["exec:generateConfig", "webpack:webInline", "runInliner", "clean:inlineScripts"]);


grunt.registerTask("runInliner", runInliner);
Expand All @@ -60,9 +61,9 @@ module.exports = function (grunt) {
grunt.loadNpmTasks("grunt-jsdoc");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-chmod");
grunt.loadNpmTasks("grunt-exec");
grunt.loadNpmTasks("grunt-execute");
grunt.loadNpmTasks("grunt-accessibility");
grunt.loadNpmTasks("grunt-concurrent");

Expand Down Expand Up @@ -118,12 +119,12 @@ module.exports = function (grunt) {
* Generates an entry list for all the modules.
*/
function listEntryModules() {
const path = "./src/core/config/modules/";
let entryModules = {};
const entryModules = {};

fs.readdirSync(path).forEach(file => {
if (file !== "Default.js" && file !== "OpModules.js")
entryModules[file.split(".js")[0]] = path + file;
glob.sync("./src/core/config/modules/*.mjs").forEach(file => {
const basename = path.basename(file);
if (basename !== "Default.mjs" && basename !== "OpModules.mjs")
entryModules[basename.split(".mjs")[0]] = path.resolve(file);
});

return entryModules;
Expand All @@ -132,9 +133,9 @@ module.exports = function (grunt) {
grunt.initConfig({
clean: {
dev: ["build/dev/*"],
prod: ["build/prod/*", "src/core/config/MetaConfig.js"],
test: ["build/test/*", "src/core/config/MetaConfig.js"],
node: ["build/node/*", "src/core/config/MetaConfig.js"],
prod: ["build/prod/*"],
node: ["build/node/*"],
config: ["src/core/config/OperationConfig.json", "src/core/config/modules/*", "src/code/operations/index.mjs"],
docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico", "!docs/*.png"],
inlineScripts: ["build/prod/scripts.js"],
},
Expand All @@ -143,10 +144,10 @@ module.exports = function (grunt) {
configFile: "./.eslintrc.json"
},
configs: ["Gruntfile.js"],
core: ["src/core/**/*.js", "!src/core/lib/**/*", "!src/core/config/MetaConfig.js"],
web: ["src/web/**/*.js"],
node: ["src/node/**/*.js"],
tests: ["test/**/*.js"],
core: ["src/core/**/*.{js,mjs}", "!src/core/vendor/**/*", "!src/core/operations/legacy/**/*"],
web: ["src/web/**/*.{js,mjs}"],
node: ["src/node/**/*.{js,mjs}"],
tests: ["test/**/*.{js,mjs}"],
},
jsdoc: {
options: {
Expand All @@ -159,17 +160,11 @@ module.exports = function (grunt) {
all: {
src: [
"src/**/*.js",
"!src/core/lib/**/*",
"!src/core/config/MetaConfig.js"
"src/**/*.mjs",
"!src/core/vendor/**/*"
],
}
},
concurrent: {
options: {
logConcurrentOutput: true
},
dev: ["webpack:metaConfDev", "webpack-dev-server:start"]
},
accessibility: {
options: {
accessibilityLevel: "WCAG2A",
Expand All @@ -184,39 +179,6 @@ module.exports = function (grunt) {
},
webpack: {
options: webpackConfig,
metaConf: {
mode: "production",
target: "node",
entry: [
"babel-polyfill",
"./src/core/config/OperationConfig.js"
],
output: {
filename: "MetaConfig.js",
path: __dirname + "/src/core/config/",
library: "MetaConfig",
libraryTarget: "commonjs2",
libraryExport: "default"
},
externals: [NodeExternals()],
},
metaConfDev: {
mode: "development",
target: "node",
entry: [
"babel-polyfill",
"./src/core/config/OperationConfig.js"
],
output: {
filename: "MetaConfig.js",
path: __dirname + "/src/core/config/",
library: "MetaConfig",
libraryTarget: "commonjs2",
libraryExport: "default"
},
externals: [NodeExternals()],
watch: true
},
web: {
mode: "production",
target: "web",
Expand All @@ -229,7 +191,7 @@ module.exports = function (grunt) {
},
resolve: {
alias: {
"./config/modules/OpModules.js": "./config/modules/Default.js"
"./config/modules/OpModules": "./config/modules/Default"
}
},
plugins: [
Expand Down Expand Up @@ -279,7 +241,7 @@ module.exports = function (grunt) {
tests: {
mode: "development",
target: "node",
entry: "./test/index.js",
entry: "./test/index.mjs",
externals: [NodeExternals()],
output: {
filename: "index.js",
Expand All @@ -292,7 +254,7 @@ module.exports = function (grunt) {
node: {
mode: "production",
target: "node",
entry: "./src/node/index.js",
entry: "./src/node/index.mjs",
externals: [NodeExternals()],
output: {
filename: "CyberChef.js",
Expand Down Expand Up @@ -330,7 +292,7 @@ module.exports = function (grunt) {
}, moduleEntryPoints),
resolve: {
alias: {
"./config/modules/OpModules.js": "./config/modules/Default.js"
"./config/modules/OpModules": "./config/modules/Default"
}
},
plugins: [
Expand Down Expand Up @@ -388,6 +350,18 @@ module.exports = function (grunt) {
src: ["docs/**/*", "docs/"]
}
},
watch: {
config: {
files: ["src/core/operations/**/*", "!src/core/operations/index.mjs"],
tasks: ["exec:generateConfig"]
}
},
concurrent: {
dev: ["watch:config", "webpack-dev-server:start"],
options: {
logConcurrentOutput: true
}
},
exec: {
repoSize: {
command: [
Expand All @@ -401,10 +375,21 @@ module.exports = function (grunt) {
},
sitemap: {
command: "node build/prod/sitemap.js > build/prod/sitemap.xml"
},
generateConfig: {
command: [
"echo '\n--- Regenerating config files. ---'",
"mkdir -p src/core/config/modules",
"echo 'export default {};\n' > src/core/config/modules/OpModules.mjs",
"echo '[]\n' > src/core/config/OperationConfig.json",
"node --experimental-modules src/core/config/scripts/generateOpsIndex.mjs",
"node --experimental-modules src/core/config/scripts/generateConfig.mjs",
"echo '--- Config scripts finished. ---\n'"
].join(";")
},
tests: {
command: "node --experimental-modules test/index.mjs"
}
},
execute: {
test: "build/test/index.js"
},
});
};
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

CyberChef is a simple, intuitive web app for carrying out all manner of "cyber" operations within a web browser. These operations include simple encoding like XOR or Base64, more complex encryption like AES, DES and Blowfish, creating binary and hexdumps, compression and decompression of data, calculating hashes and checksums, IPv6 and X.509 parsing, changing character encodings, and much more.

The tool is designed to enable both technical and non-technical analysts to manipulate data in complex ways without having to deal with complex tools or algorithms. It was conceived, designed, built and incrementally improved by an analyst in their 10% innovation time over several years. Every effort has been made to structure the code in a readable and extendable format, however it should be noted that the analyst is not a professional developer.
The tool is designed to enable both technical and non-technical analysts to manipulate data in complex ways without having to deal with complex tools or algorithms. It was conceived, designed, built and incrementally improved by an analyst in their 10% innovation time over several years.

## Live demo

Expand Down Expand Up @@ -43,16 +43,19 @@ You can use as many operations as you like in simple or complex ways. Some examp
- [Carry out different operations on data of different types][8]
- [Use parts of the input as arguments to operations][9]
- [Perform AES decryption, extracting the IV from the beginning of the cipher stream][10]
- [Automagically detect several layers of nested encoding][12]


## Features

- Drag and drop
- Operations can be dragged in and out of the recipe list, or reorganised.
- Files can be dragged over the input box to load them directly into the browser.
- Files up to 500MB can be dragged over the input box to load them directly into the browser.
- Auto Bake
- Whenever you modify the input or the recipe, CyberChef will automatically "bake" for you and produce the output immediately.
- This can be turned off and operated manually if it is affecting performance (if the input is very large, for instance).
- Automated encoding detection
- CyberChef uses [a number of techniques](https://github.com/gchq/CyberChef/wiki/Automatic-detection-of-encoded-data-using-CyberChef-Magic) to attempt to automatically detect which encodings your data is under. If it finds a suitable operation which can make sense of your data, it displays the 'magic' icon in the Output field which you can click to decode your data.
- Breakpoints
- You can set breakpoints on any operation in your recipe to pause execution before running it.
- You can also step through the recipe one operation at a time to see what the data looks like at each stage.
Expand Down Expand Up @@ -81,6 +84,8 @@ CyberChef is built to support

## Contributing

Contributing a new operation to CyberChef is super easy! There is a quickstart script which will walk you through the process. If you can write basic JavaScript, you can write a CyberChef operation.

An installation walkthrough, how-to guides for adding new operations and themes, descriptions of the repository structure, available data types and coding conventions can all be found in the project [wiki pages](https://github.com/gchq/CyberChef/wiki).

- Sign the [GCHQ Contributor Licence Agreement](https://github.com/gchq/Gaffer/wiki/GCHQ-OSS-Contributor-License-Agreement-V1.0)
Expand All @@ -104,3 +109,4 @@ CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/lice
[9]: https://gchq.github.io/CyberChef/#recipe=Register('key%3D(%5B%5C%5Cda-f%5D*)',true,false)Find_/_Replace(%7B'option':'Regex','string':'.*data%3D(.*)'%7D,'$1',true,false,true)RC4(%7B'option':'Hex','string':'$R0'%7D,'Hex','Latin1')&input=aHR0cDovL21hbHdhcmV6LmJpei9iZWFjb24ucGhwP2tleT0wZTkzMmE1YyZkYXRhPThkYjdkNWViZTM4NjYzYTU0ZWNiYjMzNGUzZGIxMQ
[10]: https://gchq.github.io/CyberChef/#recipe=Register('(.%7B32%7D)',true,false)Drop_bytes(0,32,false)AES_Decrypt(%7B'option':'Hex','string':'1748e7179bd56570d51fa4ba287cc3e5'%7D,%7B'option':'Hex','string':'$R0'%7D,'CTR','Hex','Raw',%7B'option':'Hex','string':''%7D)&input=NTFlMjAxZDQ2MzY5OGVmNWY3MTdmNzFmNWI0NzEyYWYyMGJlNjc0YjNiZmY1M2QzODU0NjM5NmVlNjFkYWFjNDkwOGUzMTljYTNmY2Y3MDg5YmZiNmIzOGVhOTllNzgxZDI2ZTU3N2JhOWRkNmYzMTFhMzk0MjBiODk3OGU5MzAxNGIwNDJkNDQ3MjZjYWVkZjU0MzZlYWY2NTI0MjljMGRmOTRiNTIxNjc2YzdjMmNlODEyMDk3YzI3NzI3M2M3YzcyY2Q4OWFlYzhkOWZiNGEyNzU4NmNjZjZhYTBhZWUyMjRjMzRiYTNiZmRmN2FlYjFkZGQ0Nzc2MjJiOTFlNzJjOWU3MDlhYjYwZjhkYWY3MzFlYzBjYzg1Y2UwZjc0NmZmMTU1NGE1YTNlYzI5MWNhNDBmOWU2MjlhODcyNTkyZDk4OGZkZDgzNDUzNGFiYTc5YzFhZDE2NzY3NjlhN2MwMTBiZjA0NzM5ZWNkYjY1ZDk1MzAyMzcxZDYyOWQ5ZTM3ZTdiNGEzNjFkYTQ2OGYxZWQ1MzU4OTIyZDJlYTc1MmRkMTFjMzY2ZjMwMTdiMTRhYTAxMWQyYWYwM2M0NGY5NTU3OTA5OGExNWUzY2Y5YjQ0ODZmOGZmZTljMjM5ZjM0ZGU3MTUxZjZjYTY1MDBmZTRiODUwYzNmMWMwMmU4MDFjYWYzYTI0NDY0NjE0ZTQyODAxNjE1YjhmZmFhMDdhYzgyNTE0OTNmZmRhN2RlNWRkZjMzNjg4ODBjMmI5NWIwMzBmNDFmOGYxNTA2NmFkZDA3MWE2NmNmNjBlNWY0NmYzYTIzMGQzOTdiNjUyOTYzYTIxYTUzZg
[11]: https://gchq.github.io/CyberChef/#recipe=XOR(%7B'option':'Hex','string':'3a'%7D,'Standard',false)To_Hexdump(16,false,false)&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4
[12]: https://gchq.github.io/CyberChef/#recipe=Magic(3,false,false)&input=V1VhZ3dzaWFlNm1QOGdOdENDTFVGcENwQ0IyNlJtQkRvREQ4UGFjZEFtekF6QlZqa0syUXN0RlhhS2hwQzZpVVM3UkhxWHJKdEZpc29SU2dvSjR3aGptMWFybTg2NHFhTnE0UmNmVW1MSHJjc0FhWmM1VFhDWWlmTmRnUzgzZ0RlZWpHWDQ2Z2FpTXl1QlY2RXNrSHQxc2NnSjg4eDJ0TlNvdFFEd2JHWTFtbUNvYjJBUkdGdkNLWU5xaU45aXBNcTFaVTFtZ2tkYk51R2NiNzZhUnRZV2hDR1VjOGc5M1VKdWRoYjhodHNoZVpud1RwZ3FoeDgzU1ZKU1pYTVhVakpUMnptcEM3dVhXdHVtcW9rYmRTaTg4WXRrV0RBYzFUb291aDJvSDRENGRkbU5LSldVRHBNd21uZ1VtSzE0eHdtb21jY1BRRTloTTE3MkFQblNxd3hkS1ExNzJSa2NBc3lzbm1qNWdHdFJtVk5OaDJzMzU5d3I2bVMyUVJQ
Loading