Compare commits

..
2691 Commits
Author SHA1 Message Date
benjamyn fc51f433ab Merge pull request 'Update .github/workflows/releases.yml' (#2) from benjamyn-patch-1 into master
CodeQL Analysis / Analyze (javascript) (push) Failing after 18s
Master Build, Test & Deploy / main (push) Failing after 2m46s
Reviewed-on: #2
2023-09-05 21:01:35 -04:00
benjamyn 1902aaa722 Update .github/workflows/releases.yml
CodeQL Analysis / Analyze (javascript) (pull_request) Has been cancelled
Pull Requests / main (pull_request) Has been cancelled
2023-09-05 20:57:56 -04:00
benjamyn 87d57213c0 Update .github/workflows/releases.yml
CodeQL Analysis / Analyze (javascript) (push) Failing after 15s
Master Build, Test & Deploy / main (push) Failing after 2m53s
2023-09-05 20:57:31 -04:00
benjamyn 4073ebcef7 Merge pull request 'Update README.md' (#1) from benjamyn-patch-1 into master
Master Build, Test & Deploy / main (push) Failing after 2m53s
CodeQL Analysis / Analyze (javascript) (push) Failing after 18s
Reviewed-on: #1
2023-09-05 20:48:09 -04:00
benjamyn 5012c30ea2 Update README.md
CodeQL Analysis / Analyze (javascript) (pull_request) Failing after 58s
Pull Requests / main (pull_request) Failing after 2m57s
2023-09-05 20:42:53 -04:00
n1474335 6ed9d4554a 10.5.2 2023-07-14 19:01:41 +01:00
n1474335 2dcd345349 Updated chromedriver 2023-07-14 19:01:35 +01:00
n1474335 81924b4a7e 10.5.1 2023-07-14 18:54:03 +01:00
n1474335 5a0c3a3b47 Fixed webpack config 2023-07-14 18:53:56 +01:00
n1474335 7b599fe7f7 10.5.0 2023-07-14 18:41:44 +01:00
n1474335 4faaa07188 Updated CHANGELOG 2023-07-14 18:41:32 +01:00
n1474335 fa228b2571 Added a range of GOST operations 2023-07-14 18:37:02 +01:00
n1474335 1bc88728f0 10.4.0 2023-03-24 22:41:40 +00:00
n1474335 7bb0649b27 Updated CHANGELOG 2023-03-24 22:41:24 +00:00
n1474335 e46a7448d9 Fixed De Bruijn test import 2023-03-24 22:40:07 +00:00
n1474335 d102e1b15c Tidied 'Generate De Bruijn Sequence' operation 2023-03-24 22:39:08 +00:00
n1474335 0a0217cb66 Merge branch 'debruijn' of https://github.com/GCHQ77703/CyberChef 2023-03-24 22:33:43 +00:00
n1474335 3faa9d3a1e 10.3.0 2023-03-24 22:17:19 +00:00
n1474335 d902c7e30c Updated CHANGELOG 2023-03-24 22:17:11 +00:00
n1474335 25fe7bba67 Tidied up Argon2 operations 2023-03-24 22:15:21 +00:00
n1474335 ca340cdd7b Merge branch 'feature/add-argon2-operation' of https://github.com/Xenonym/CyberChef 2023-03-24 20:48:42 +00:00
Matt Coomber 266fbab8fd Fix loading messages
Missing comma in array
2023-03-24 09:57:06 +00:00
n1474335 e57fd2a408 10.2.0 2023-03-23 18:22:37 +00:00
n1474335 3328ae8afd Updated CHANGELOG 2023-03-23 18:22:27 +00:00
n1474335 1caecf70a2 Fixed HKDF op name 2023-03-23 18:21:43 +00:00
n1474335 6e347742d9 Merge branch 'hkdf' of https://github.com/mikecat/CyberChef 2023-03-23 18:18:25 +00:00
n1474335 2e2dcfa416 10.1.0 2023-03-23 18:00:13 +00:00
n1474335 4bb10a34e1 Updated CHANGELOG 2023-03-23 17:59:56 +00:00
n1474335 1632e23c78 Merge branch 'markdown-beautify' of https://github.com/JatinSanghvi/CyberChef 2023-03-23 17:53:31 +00:00
n1474335 11fca557af Merge branch 'fix_dark_theme_highlight' of https://github.com/SamueleFacenda/CyberChef 2023-03-23 17:52:41 +00:00
n1474335 1cf14c6f01 Merge branch 'master' of https://github.com/mattnotmax/CyberChef 2023-03-23 17:48:05 +00:00
n1474335 1bba10e7c2 Merge branch 'swap-case' of https://github.com/mikecat/CyberChef 2023-03-23 17:46:47 +00:00
n1474335 8f3096af0a Merge branch 'levenshtein-distance' of https://github.com/mikecat/CyberChef 2023-03-23 17:42:16 +00:00
n1474335 6fdf37e2f2 10.0.1 2023-03-23 12:42:28 +00:00
n1474335 a4d6e1f92c TextNode characters are re-escaped in htmlWidgets now. Fixes #1533 2023-03-23 12:42:22 +00:00
mattnotmax 4a356476b1 Merge branch 'gchq:master' into master 2023-03-23 21:28:39 +11:00
n1474335 c2171a08f2 Added preventDefault to contextual help key press listener 2023-03-22 16:54:39 +00:00
n1474335 84aad167d5 Tweaked compile message 2023-03-22 11:59:35 +00:00
n1474335 493b1eee1e Removed excess whitespace from banner links 2023-03-22 11:36:03 +00:00
n1474335 6c5b260ece 10.0.0 2023-03-22 11:31:55 +00:00
n1474335 7394bb45d4 Updated CHANGELOG 2023-03-22 11:31:47 +00:00
n1474335 5d3302f6d7 Added a few more UI tests 2023-03-22 11:19:01 +00:00
n1474335 92dada8a80 Final tweaks to download wording 2023-03-22 11:16:49 +00:00
n1474335 c6569b7c47 Added compile message to master build chain 2023-03-22 10:30:42 +00:00
n1474335 ea56efae47 Added Download pane 2023-03-21 15:39:31 +00:00
n1474335 7419009745 Added more help topics and added filetype detection to the 'save output' button 2023-03-20 17:23:14 +00:00
mattnotmax e58744c63a Update index.html
Added new loading message
2023-03-18 21:35:03 +11:00
n1474335 4c7fe147bc Merge branch 'fix-translatedatetimeformat-xss' of https://github.com/mikecat/CyberChef into v10 2023-03-17 18:12:50 +00:00
n1474335 7605d48f0b Fixed IO folder tests with unpredictable file ordering 2023-03-17 18:06:28 +00:00
n1474335 d6f8e0a520 Added a contextual help feature and started writing help descriptions 2023-03-17 17:46:13 +00:00
MikeCAT ab283fc801 use Utils.escapeHtml instead of manual escaping 2023-03-18 00:54:43 +09:00
MikeCAT d9d6b7aa37 fix XSS in operation TranslateDateTimeFormat 2023-03-18 00:32:06 +09:00
MikeCAT b0c9a1850d add operaton HKDF 2023-03-17 23:50:24 +09:00
Samuele Facenda 764bd4b9ae Update dark theme highligh 2023-03-15 08:38:56 +01:00
n1474335 a24fdf4250 Regex improvements 2023-03-13 18:28:05 +00:00
n1474335 13e3dba784 Removed LGTM badge from README 2023-03-13 18:21:31 +00:00
n1474335 ccea5cdf88 Fixed bad HTML filtering 2023-03-13 18:13:54 +00:00
n1474335 51e2b97595 Updated CodeQL action 2023-03-13 18:03:33 +00:00
n1474335 61501a7cbc Updated dependencies and fixed some code scanning findings 2023-03-13 17:51:25 +00:00
Tan Zhen Yong bca4c34b3a Add Argon2 hash compare operation 2023-03-12 00:33:28 +08:00
Tan Zhen Yong 2fab1028c5 Add Argon2 hash operation 2023-03-12 00:32:46 +08:00
n1474335 5d3c66f615 Removed call to cptable from NTHash operation 2023-03-09 18:06:32 +00:00
n1474335 cab83cae35 Switched arg layout to use flexbox instead of css grid 2023-03-09 17:31:46 +00:00
n1474335 bd16378e23 Fixed postinstall scipts to work on msys shells 2023-03-09 14:12:17 +00:00
n1474335 65e431bd9e Merge branch 'fix/postinstall-msys' of https://github.com/ParkerM/CyberChef into v10 2023-03-09 14:09:20 +00:00
n1474335 b9f2bddffc Added UI tests back into Github Actions scripts 2023-03-09 14:01:21 +00:00
n1474335 80e8b2339d Improved HTML output sizing 2023-03-08 18:08:17 +00:00
n1474335 7eda2fd4a6 Added UI tests for all HTML operations 2023-03-08 17:44:51 +00:00
n1474335 36aafb9246 Added test for alert bar 2023-03-06 14:53:20 +00:00
n1474335 acc1df2031 Merge branch 'fix-xss-datetime' of https://github.com/ntomoya/CyberChef into v10 2023-03-05 15:39:41 +00:00
n1474335 c5766c89f6 Further operation tests 2023-03-05 15:32:53 +00:00
n1474335 73f5069971 Added more IO tests and created browser test utils 2023-03-05 14:58:11 +00:00
n1474335 819e4a574c Added more tests, fixed length count bug and IO clearance bug 2023-03-03 17:33:42 +00:00
n1474335 8c0e23e196 Further IO tests added 2023-03-02 19:50:08 +00:00
n1474335 05160227a3 Added initial input and output UI tests 2023-03-02 18:10:52 +00:00
Tomoya Nakanishi 5cfc1abf41 Fixed XSS in TranslateDateTimeFormat 2023-03-01 03:39:57 +09:00
n1474335 046a0917e7 Nightwatch test improvements 2023-02-27 18:30:01 +00:00
n1474335 9cbf217d42 Fixed UI tests to work with new input and output areas 2023-02-27 18:21:06 +00:00
n1474335 bf949c0320 Fixed operational tests and updated some dependencies 2023-02-27 17:55:52 +00:00
n1474335 9e679f411c Fixed progress bug 2023-02-27 15:52:05 +00:00
n1474335 dd6eae52ef Folders can now be dropped into the CyberChef input 2023-02-27 15:32:52 +00:00
n1474335 cdde7166cf Changing tabs no longer triggers a bake 2023-02-24 17:34:35 +00:00
n1474335 251bd86ce5 Large inputs with long line lengths are now handled better. Issues with toggleLoader fixed. 2023-02-24 17:09:40 +00:00
Jatin Sanghvi dee2dc3777 Align Markdown table column separators 2023-02-17 11:32:05 +05:30
n1474335 533047a3a2 Improved file type detection and timing output 2023-02-03 17:39:12 +00:00
n1474335 659325c85a Improved performance of str/array buffer conversions 2023-02-03 17:10:33 +00:00
n1474335 7a2517fd61 Fixed 'Clear All IO' button 2023-02-03 15:54:45 +00:00
n1474335 0b2cb7e68c Added fine-grain timing for aspects of the bake. Improved efficiency of autobakes and moved output decoding into a worker. 2023-02-03 14:55:15 +00:00
Parker Mauney 4e747b3697 Use process.platform to detect OS during postinstall 2023-01-22 18:57:57 -05:00
n1474335 84f0750525 Reviewed HTML and options 2023-01-19 17:47:07 +00:00
n1474335 fa21768931 Reviewed Highlighter and Options waiters 2023-01-19 17:14:24 +00:00
n1474335 934efcc5a0 Reviewed InputWorker 2023-01-19 16:56:07 +00:00
n1474335 91f1be8c70 Reviewed Input and Output Waiters and improved logging in workers 2023-01-18 18:07:06 +00:00
n1474335 56d1a016da Tidied InputWaiter and made inputChange debounce delay variable based on input length 2023-01-13 18:00:36 +00:00
n1474335 d6159cc154 Event bug fixes 2023-01-13 16:46:41 +00:00
n1474335 e9d7a8363c Removed treatAsUTF8 option 2023-01-13 14:38:50 +00:00
n1474335 4e512a9a7b Updated dependencies 2023-01-13 14:25:40 +00:00
n1474335 c1394e299a Fixed replace input with output button 2023-01-13 14:14:57 +00:00
n1474335 17c349973d Fixed file loading bug where the wrong input is set 2023-01-13 13:51:16 +00:00
n1474335 f2bd838596 Fixed CSS for theme highlighting and status bar dropup height 2023-01-13 13:12:01 +00:00
MikeCAT d5b72548fc add new operation: Swap case 2023-01-11 05:48:05 +09:00
MikeCAT 2c822314df add new operation: Levenshtein Distance 2023-01-11 05:16:37 +09:00
n1474335 1b3d55f051 Status bar widgets are disabled for HTML output 2022-12-09 21:23:25 +00:00
n1474335 ff45f61b68 Fixed the snackbar 2022-12-09 20:46:01 +00:00
n1474335 771a013c9f Removed output-file markup and handlers 2022-12-09 20:12:15 +00:00
n1474335 b354f61502 Updated dependencies 2022-12-09 19:44:31 +00:00
n1474335 2e201c747a Merge remote-tracking branch 'origin/master' into v10 2022-12-09 19:28:41 +00:00
n1474335 c1d2970f1e File details can now be hidden 2022-12-09 19:24:43 +00:00
n1474335 2efd075803 9.55.0 2022-12-09 11:40:35 +00:00
n1474335 4b4d3c6845 Updated CHANGELOG 2022-12-09 11:40:25 +00:00
n1474335 760eff49b5 Added 'AMF Encode' and 'AMF Decode' operations 2022-12-09 11:39:22 +00:00
n1474335 ba12ad8e7c 9.54.0 2022-11-25 16:49:41 +00:00
n1474335 249af2ded1 Updated CHANGELOG 2022-11-25 16:49:37 +00:00
n1474335 7403666a11 Tidied up Rabbit operations 2022-11-25 16:48:54 +00:00
n1474335 1cc8b150f3 Merge branch 'rabbit-stream-cipher' of https://github.com/mikecat/CyberChef 2022-11-25 16:36:42 +00:00
n1474335 faa25ee662 9.53.0 2022-11-25 16:29:31 +00:00
n1474335 aa981ccd4a Updated CHANGELOG 2022-11-25 16:29:25 +00:00
n1474335 04378c1f91 Moved AES Key wrapping operations in Categories.json 2022-11-25 16:28:15 +00:00
n1474335 53179a158e Merge branch 'aes-key-wrap' of https://github.com/mikecat/CyberChef 2022-11-25 16:25:36 +00:00
n1474335 7ecde9fd2a 9.52.1 2022-11-25 16:11:28 +00:00
n1474335 320f79fe0d Added maxLength property for string arguments 2022-11-25 16:11:14 +00:00
n1474335 157346b055 Merge branch 'master' of https://github.com/TheSavageTeddy/CyberChef 2022-11-25 15:38:10 +00:00
n1474335 904c08c436 9.52.0 2022-11-25 15:31:31 +00:00
n1474335 fa238545a0 Updated CHANGELOG 2022-11-25 15:31:27 +00:00
n1474335 3f85c32c7c Lint 2022-11-25 15:30:32 +00:00
n1474335 55809b2e87 Merge branch 'feature/chacha' of https://github.com/joostrijneveld/CyberChef 2022-11-25 15:15:03 +00:00
n1474335 5c32c1bdaa Fixed tests for CMAC 2022-11-25 15:13:54 +00:00
TheSavageTeddy f84c11f63d im dumb, please pass the test now 2022-11-25 22:40:40 +08:00
TheSavageTeddy 2bcfb693b7 fix 2022-11-25 22:32:23 +08:00
TheSavageTeddy 897d2bef6e fix output 2022-11-25 22:23:15 +08:00
TheSavageTeddy 0a3d219ad5 fixed linting 2022-11-25 22:13:53 +08:00
TheSavageTeddy ba0dfe91c3 added all-zero edge cases for standard alphabet 2022-11-25 22:08:51 +08:00
TheSavageTeddy bf4e62b4b7 added choice for base85 all-zero character 2022-11-25 21:36:17 +08:00
n1474335 657f8940fa 9.51.0 2022-11-25 12:47:20 +00:00
n1474335 74d629c491 Updated CHANGELOG 2022-11-25 12:47:12 +00:00
n1474335 130e9d8192 Lint 2022-11-25 12:46:15 +00:00
n1474335 0fb3743b6d Merge branch 'aes-cmac' of https://github.com/mikecat/CyberChef 2022-11-25 12:41:41 +00:00
n1474335 a19aea1516 9.50.12 2022-11-25 12:38:03 +00:00
n1474335 137f8d9471 Merge branch 'fix-fletcher-checksum' of https://github.com/mikecat/CyberChef 2022-11-25 12:37:24 +00:00
n1474335 1f57f1f000 9.50.11 2022-11-25 12:28:33 +00:00
n1474335 468071ee98 Tidied JSDoc comment 2022-11-25 12:28:26 +00:00
n1474335 23403f55a5 Merge branch 'master' of https://github.com/DidierStevens/CyberChef 2022-11-25 12:26:53 +00:00
n1474335 c25cf44d92 9.50.10 2022-11-25 12:25:15 +00:00
n1474335 e5644b5712 Merge branch 'master' of https://github.com/samgbell/CyberChef 2022-11-25 12:23:14 +00:00
n1474335 9321b79d81 9.50.9 2022-11-25 12:21:51 +00:00
n1474335 e97d535ff8 Merge branch 'fix-option-in-parse-asn1-hex-string' of https://github.com/mikecat/CyberChef 2022-11-25 12:21:42 +00:00
n1474335 7589361e58 9.50.8 2022-11-25 12:19:31 +00:00
n1474335 f15ef81693 Merge branch 'put-required-margin' of https://github.com/mikecat/CyberChef 2022-11-25 12:19:22 +00:00
n1474335 d5f4968664 9.50.7 2022-11-25 12:18:33 +00:00
n1474335 74e9edbccf Merge branch 'user-friendly-parse-x509-certificate' of https://github.com/mikecat/CyberChef 2022-11-25 12:15:29 +00:00
n1474335 51229d85cb 9.50.6 2022-11-25 12:11:17 +00:00
n1474335 b979b051cb Merge branch 'triple-des-with-16byte-key' of https://github.com/mikecat/CyberChef 2022-11-25 12:08:58 +00:00
n1474335 17cf154bc2 9.50.5 2022-11-25 12:07:07 +00:00
n1474335 c7f6954b97 Merge branch 'view-bit-plane-use-bytelength-not-length' of https://github.com/mikecat/CyberChef 2022-11-25 12:07:01 +00:00
n1474335 9ccc1613cf 9.50.4 2022-11-25 12:05:32 +00:00
n1474335 9730ce1f6a Merge branch 'fix-windows-filetime' of https://github.com/mikecat/CyberChef 2022-11-25 12:05:22 +00:00
n1474335 55a7981547 9.50.3 2022-11-25 12:03:57 +00:00
n1474335 2d99c365dd Merge branch 'fix-reverse-character' of https://github.com/mikecat/CyberChef 2022-11-25 12:02:46 +00:00
n1474335 59d8be511a 9.50.2 2022-11-25 12:00:32 +00:00
n1474335 8349ffc001 Merge branch 'from-hex-use-delimiter-as-delimiter' of https://github.com/mikecat/CyberChef 2022-11-25 11:59:25 +00:00
n1474335 c1368c4ecb 9.50.1 2022-11-25 11:55:53 +00:00
n1474335 c6935e040d Updated newMinorVersion script 2022-11-25 11:55:48 +00:00
n1474335 f79c3ae91a Merge branch 'use-lowercase-for-asn1' of https://github.com/mikecat/CyberChef 2022-11-25 11:55:19 +00:00
n1474335 bc27cd2772 9.50.0 2022-11-25 11:51:34 +00:00
n1474335 2b02c44ca4 Updated CHANGELOG 2022-11-25 11:51:22 +00:00
n1474335 59fe8d1c4b Simplified 'Shuffle' operation to work in the same way as 'Sort' and 'Unique' 2022-11-25 11:50:27 +00:00
n1474335 9a5d62c4c3 Merge branch 'shuffle-operation' of https://github.com/mikecat/CyberChef 2022-11-25 11:24:47 +00:00
n1474335 9fa82150ee 9.49.2 2022-11-25 11:23:38 +00:00
n1474335 d7561ec208 Tidied Substitute 2022-11-25 11:23:32 +00:00
n1474335 743b834f6d Merge branch 'SamueleFacendaSubstitution' of https://github.com/SamueleFacenda/CyberChef 2022-11-25 11:21:04 +00:00
n1474335 0658836f87 9.49.1 2022-11-25 11:15:16 +00:00
n1474335 a4e20c7059 Merge branch 'large-prng' of https://github.com/mikecat/CyberChef 2022-11-25 11:13:05 +00:00
TheSavageTeddy d77f8ba747 fix linting again 2022-11-25 11:08:01 +08:00
TheSavageTeddy 78d35ecec3 better boolean statement 2022-11-25 10:59:04 +08:00
TheSavageTeddy c79bf5caaf fixed linting 2022-11-25 10:49:56 +08:00
TheSavageTeddy 66cbc6908a Better delimeter parsing for From Base85 2022-11-25 10:36:08 +08:00
MikeCAT c04f409d23 PseudoRandomNumberGenerator: support larger output than 65536 bytes 2022-11-17 20:24:54 +09:00
Samuele Facenda 1a9833132d Added ignoreCase feature in Substitute operation. 2022-11-13 14:41:01 +01:00
Samuele Facenda 9c3ddca269 Added ignoreCase feature in Substitute operation. 2022-11-13 14:37:19 +01:00
n1474335 72889d1c20 9.49.0 2022-11-11 16:29:13 +00:00
n1474335 6c5433b226 Updated CHANGELOG 2022-11-11 16:29:03 +00:00
n1474335 31a7f83b82 Added 'LZ4 Compress' and 'LZ4 Decompress' operations. Closes #1116 2022-11-11 16:27:14 +00:00
MikeCAT 39143fa6a1 add Shuffle operation 2022-11-11 22:26:41 +09:00
n1474335 a116a2a423 Input tab headers now show the filename for file inputs 2022-11-04 18:45:52 +00:00
n1474335 61d4c0ea63 File loading progress is now updated 2022-11-04 18:29:53 +00:00
n1474335 44c7a1e92d Output loading messages are displayed properly again 2022-11-04 14:58:37 +00:00
n1474335 09fd333997 Fixed bug where input would not be loaded from deep links if a chrenc was not set 2022-11-04 14:38:30 +00:00
Joost Rijneveld ebe2a29543 Add ChaCha stream cipher operation 2022-11-03 15:17:33 +01:00
MikeCAT 1e83e0e935 convert hex string to lower before parsing as ASN.1 2022-11-03 21:43:24 +09:00
MikeCAT fe9eb08648 allow 16-byte keys for Triple DES in CMAC operation 2022-11-03 01:20:37 +09:00
MikeCAT 2255c5b360 allow 16-byte keys for Triple DES 2022-11-03 01:12:01 +09:00
MikeCAT c046cf5695 have "From Hex" treat the delimiter as delimiter, not what to erase 2022-11-03 00:21:20 +09:00
MikeCAT 3086c25079 improve treatment of Hex(little endian) for Windows Filetime converter 2022-11-02 23:14:48 +09:00
MikeCAT 3700780d14 improve "Reverse" operation
* Make "Character" option actually reverse characters
* Add new option "Byte" that behaves as previous "Character" option
2022-11-02 22:37:09 +09:00
MikeCAT 5b134d7e9e fix Fletcher-32/64 Checksum
* Operate on words, not bytes
* Add tests
2022-11-02 21:54:45 +09:00
MikeCAT 58b1fb8de5 ViewBitPlane.mjs: use byteLength instead of length to check validity of ArrayBuffer 2022-11-02 08:29:26 +09:00
MikeCAT c0bd6645ce add new operation: CMAC 2022-11-02 02:07:16 +09:00
MikeCAT c6b79cd1c6 add new operations: AES Key Wrap/Unwrap 2022-11-01 00:35:27 +09:00
Didier Stevens cb023089bb Operation Sort: added value Length to option Order 2022-10-30 15:33:11 +01:00
MikeCAT 5a507aa1ba have "Parse X.509 certificate" emit user-friendly message on certificate load error 2022-10-30 08:25:31 +09:00
MikeCAT d23b88e2b8 use typed arrays for status of Rabbit instead of normal arrays 2022-10-29 03:33:30 +09:00
MikeCAT 3ac2ed20d2 add operation "Rabbit Stream Cipher" 2022-10-29 03:09:41 +09:00
MikeCAT d5ffbbb14c ParseASN1HexString.mjs: fix the name of option to use 2022-10-28 21:33:56 +09:00
n1474335 b92501ee35 Introduced use of conditional chaining operator 2022-10-28 13:24:03 +01:00
n1474335 570206af77 Line ending sequences for the current tab are included in the deep link URL 2022-10-28 12:44:06 +01:00
n1474335 f6ae89587c EOL sequences are now preserved between tabs 2022-10-28 12:24:16 +01:00
MikeCAT fa30f597ad GenerateQRCode.mjs: set default margin to 4 modules 2022-10-27 20:02:49 +09:00
n1474335 bdb8c02d5a Input and Output encodings are now saved per tab 2022-10-21 18:29:52 +01:00
n1474335 5efd125d9b Simplified TabWaiter structure 2022-10-21 13:57:46 +01:00
n1474335 01508a2459 Merge branch 'master' into v10 2022-10-21 11:56:25 +01:00
n1474335 ed8bd34915 9.48.0 2022-10-15 00:15:49 +01:00
n1474335 5c72791279 Updated CHANGELOG 2022-10-15 00:15:39 +01:00
n1474335 142f91425c Added 'LM Hash' opertaion 2022-10-15 00:13:39 +01:00
n1474335 d6344760ec Merge branch 'master' of https://github.com/brun0ne/CyberChef 2022-10-14 18:45:47 +01:00
n1474335 64c009f266 9.47.5 2022-10-14 16:28:10 +01:00
n1474335 a73decc792 Merge branch 'master' of https://github.com/gariev/CyberChef 2022-10-14 16:26:08 +01:00
n1474335 f332ca4617 9.47.4 2022-10-14 16:24:33 +01:00
n1474335 937791d33d Merge branch 'jwt-magic' of https://github.com/whs/CyberChef 2022-10-14 16:24:19 +01:00
n1474335 a63a130723 Merge branch 'ci/actions' of https://github.com/Fdawgs/CyberChef 2022-10-14 16:21:53 +01:00
n1474335 0f1175bf15 9.47.3 2022-10-14 16:20:38 +01:00
n1474335 e4db23f857 Removed extra comment from Raw Inflate 2022-10-14 16:20:34 +01:00
n1474335 32e7dd030e Merge branch 'master' of https://github.com/XlogicX/CyberChef 2022-10-14 16:19:32 +01:00
n1474335 e33950961e 9.47.2 2022-10-14 16:10:19 +01:00
n1474335 5d65cb419f Tidied up 'Generate all hashes' operation 2022-10-14 16:10:01 +01:00
n1474335 536053d5f9 Merge branch 'hash' of https://github.com/jl2168/CyberChef 2022-10-14 14:53:00 +01:00
n1474335 04ef095b88 9.47.1 2022-10-14 14:47:30 +01:00
n1474335 66277cd71f Added more DNS request types 2022-10-14 14:47:19 +01:00
n1474335 58f01d0464 Merge branch 'PTR-option' of https://github.com/CyberGoat/CyberChef 2022-10-14 14:14:17 +01:00
n1474335 9ba9c56361 9.47.0 2022-10-14 14:07:47 +01:00
n1474335 11902e3220 Updated CHANGELOG 2022-10-14 14:07:42 +01:00
n1474335 c3f79c4b2c Merge branch 'feature/lzma' of https://github.com/mattnotmitt/CyberChef 2022-10-14 14:03:57 +01:00
n1474335 576905e8b8 9.46.7 2022-10-14 14:01:05 +01:00
n1474335 77a3b91afe Merge branch 'ssh-ed25519' of https://github.com/cplussharp/CyberChef 2022-10-14 14:00:03 +01:00
n1474335 40b58aa144 9.46.6 2022-10-14 13:57:35 +01:00
n1474335 d5bcdc8eed Dependency fixes 2022-10-14 13:57:00 +01:00
samgbell 8e57354307 Fixing some eslint and JSDoc issues 2022-10-13 12:03:22 +02:00
samgbell 126debf44e Adding Markdown format for To Table operation 2022-10-13 11:52:19 +02:00
Manatsawin Hanmongkolchai 674649ca7f Added checks to JWTDecode operation 2022-10-09 14:57:02 +07:00
XlogicX 1a9a070c3b Removal of unnecessary error condition
This situation occurs because the dependancy (zlibjs/bin/rawinflate.min.js) doesn't do a sanity check on distances going back farther than the current buffer.

For example:
DEFLATE data of '123' and then a length of 9 going back a distance of 6
ASCIIHEX: 333432869300

! infgen 3.0 output
!
last			! 1
fixed			! 01
literal '1		! 10000110
literal '2		! 01000110
literal '3		! 11000110
match 9 6		! 1 00100 1110000
infgen warning: distance too far back (6/3)
end			! 0000000
			! 0

We only have 3 characters, we shouldn't be able to seek 6 characters back. But rawinflate.min.js doesn't check for this like the infgen debug tool (and others) would. So CyberChef would happily provide this as the result:
123...123...
Where the dots are just nulls of likley empty memory preceding the actual buffer

So with the example in this source
// e.g. Input data of [8b, 1d, dc, 44]

last			! 1
fixed			! 01
literal ']		! 10110001
match 158 5		! 0 00100 11011 10000011
infgen warning: distance too far back (5/1)

This means we have a literal ']' and then we are asking for 158 more characters and to find them a distance of 5 back. This explains why the ']', why it repeats every 5, and why it is a length > 158.

This code should just be removed; it isn't justified. Being that this issue is a lack of sanity checking in a dependancy, and that this routine only catches the symptom of one of the nearly unlimited edge cases like this, AND it could filter out correct inputs, such as a recipe of this as input to RAWDEFLATE
]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX
Then getting an error with the INFLATE even though the input is actually valid.
2022-10-06 14:02:27 -04:00
XlogicX 32bee35f85 Removal of unnecessary error checking routine
This situation occurs because the dependancy (zlibjs/bin/rawinflate.min.js) doesn't do a sanity check on distances going back farther than the current buffer.

For example:
DEFLATE data of '123' and then a length of 9 going back a distance of 6
ASCIIHEX: 333432869300

! infgen 3.0 output
!
last			! 1
fixed			! 01
literal '1		! 10000110
literal '2		! 01000110
literal '3		! 11000110
match 9 6		! 1 00100 1110000
infgen warning: distance too far back (6/3)
end			! 0000000
			! 0

We only have 3 characters, we shouldn't be able to seek 6 characters back. But rawinflate.min.js doesn't check for this like the infgen debug tool (and others) would. So CyberChef would happily provide this as the result:
123...123...
Where the dots are just nulls of likley empty memory preceding the actual buffer

So with the example in this source
// e.g. Input data of [8b, 1d, dc, 44]

last			! 1
fixed			! 01
literal ']		! 10110001
match 158 5		! 0 00100 11011 10000011
infgen warning: distance too far back (5/1)

This means we have a literal ']' and then we are asking for 158 more characters and to find them a distance of 5 back. This explains why the ']', why it repeats every 5, and why it is a length > 158.

This code should just be removed; it isn't justified. Being that this issue is a lack of sanity checking in a dependancy, and that this routine only catches the symptom of one of the nearly unlimited edge cases like this, AND it could filter out correct inputs, such as a recipe of this as input to RAWDEFLATE
]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX[]OMG[]HAX
Then getting an error with the INFLATE even though the input is actually valid.
2022-10-06 13:53:32 -04:00
Frazer Smith a68ce5a5af Update GitHub Actions 2022-10-06 13:58:01 +01:00
Igor Gariev 026e9ca9c3 Added escape sequence "\a" (audible bell, 0x07) to Utils.parseEscapedChars().
The sequece is part of C and C++ standard, as well as protocol buffer encoding.

- https://en.wikipedia.org/wiki/Escape_sequences_in_C
- https://en.cppreference.com/w/cpp/language/escape
- https://developers.google.com/protocol-buffers/docs/text-format-spec#string
2022-09-28 20:32:21 -07:00
BrunonDEV f1ce67d79b Added NTLM operation
Hashing operation - MD4 on UTF16LE-encoded input
2022-09-27 23:13:22 +02:00
john19696 312be4772c rsdix 2022-09-23 11:38:15 +01:00
john19696 be97a0062e linted 2022-09-22 16:53:29 +01:00
john19696 00f0101723 author fix 2022-09-22 16:39:51 +01:00
john19696 f450240094 Parameterise All hashes 2022-09-22 16:30:36 +01:00
Ethan Block a7b8378736 Adding PTR to possiable values for Resolver 2022-09-21 11:37:06 -04:00
Matt C 98a70c2dd2 Add tests and handle decompress returning string or array 2022-09-19 17:33:55 +01:00
Matt C d502dd9857 Add LZMA Decompress operation 2022-09-19 14:24:09 +01:00
Matt C 1ec7033d46 Add LZMA Compress operation 2022-09-19 14:24:09 +01:00
Matt C 28ec56a27f Update libyara package to fix bug with compile messages and add support for console module 2022-09-18 16:11:04 +01:00
CPlusSharp bf2afcd2ef Support Ed25519 SSH host key parsing 2022-09-18 12:47:55 +02:00
Matt C 8f710461da Update yara to 4.2.3 and fix output reading 0 matches 2022-09-17 23:48:11 +01:00
n1474335 a07b8f693b Input and Output character encodings are now stored in the URL, allowing for accuate deeplinking 2022-09-16 19:24:57 +01:00
n1474335 a141873db8 Highlighting now takes account of character set width 2022-09-16 16:00:39 +01:00
n1474335 08b91fd7ff Removed ioDisplayThreshold option 2022-09-16 16:00:03 +01:00
n1474335 cd7156dc55 Merge branch 'master' into v10 2022-09-16 14:48:52 +01:00
n1474335 c2cf535f88 Added node builder script to package.json 2022-09-16 14:37:31 +01:00
n1474335 ced9ab68fa 9.46.5 2022-09-16 14:16:42 +01:00
n1474335 cdb197a9c3 Reverted to local copies of Tesseract trainddata in order to remain self-contained. 2022-09-16 14:15:54 +01:00
Sean Marpo c8eacb9942 Linting fixes 2022-09-09 14:45:06 -07:00
Sean Marpo 1c8e37cb64 Update tesseract, fix API for tesseract 3.0 2022-09-09 14:33:49 -07:00
n1474335 1b0ced9f9b 9.46.4 2022-09-09 21:23:09 +01:00
n1474335 7b245b084a Updated to Node v18 and removed node-sass dependency 2022-09-09 21:22:55 +01:00
n1474335 b00f64518f Merge branch 'nodejs18' of https://github.com/john19696/CyberChef 2022-09-09 20:55:18 +01:00
n1474335 c3434e894d 9.46.3 2022-09-09 20:53:37 +01:00
n1474335 dd66f728b3 Merge branch 'fix-protobuf-order' of https://github.com/oliverrahner/CyberChef 2022-09-09 20:52:36 +01:00
n1474335 e40142b8c5 9.46.2 2022-09-09 20:39:35 +01:00
n1474335 1dd1b839b8 Switched jsonpath library to jsonpath-plus. Fixes #1318 2022-09-09 20:39:28 +01:00
n1474335 d90d845f27 9.46.1 2022-09-09 16:51:38 +01:00
n1474335 8c9ad81039 Merge branch 'feat-primitive' of https://github.com/jeiea/CyberChef 2022-09-09 16:49:12 +01:00
n1474335 cef7a7b27d Lint 2022-09-09 16:44:41 +01:00
n1474335 3e715ef21a Merge branch 'fix-select' of https://github.com/IsSafrullah/CyberChef 2022-09-09 16:43:15 +01:00
n1474335 86b43b4ffa Updated README 2022-09-09 16:39:10 +01:00
n1474335 3893c22275 Changing the output encoding no longer triggers a full bake 2022-09-09 16:35:21 +01:00
IsSafrullah 65d883496b fix select when change theme 2022-09-06 03:52:42 +07:00
n1474335 406da9fa2c Efficiency improvements to reduce unnecessary casting 2022-09-02 20:15:07 +01:00
n1474335 16b79e32f6 File details are now displayed in a side panel and the input is still editable 2022-09-02 14:34:23 +01:00
n1474335 e93aa42697 Input and output character encodings can now be set 2022-09-02 12:56:04 +01:00
jeiea 69e59916e2 feat: support boolean and null in JSON to CSV 2022-08-17 02:12:39 +09:00
Philippe Arteau 475282984b Minor typos 2022-07-29 14:32:46 -04:00
Oliver Rahner 2f89130f41 fix protobuf field order 2022-07-21 16:36:15 +02:00
n1474335 7c8a185a3d HTML outputs can now be selected and handle control characters correctly 2022-07-18 18:39:41 +01:00
john19696 e9dd7eceb8 upgrade to nodejs v18 2022-07-14 14:27:59 +01:00
n1474335 0dc2322269 Fixed dropping text in the input 2022-07-11 13:57:28 +01:00
n1474335 5c8aac5572 Improved input change update responsiveness 2022-07-11 13:43:19 +01:00
n1474335 157dacb3a5 Improved highlighting colours and selection ranges 2022-07-11 11:43:48 +01:00
n1474335 890f645eeb Overhauled Highlighting to work with new editor and support multiple selections 2022-07-10 22:01:22 +01:00
n1474335 2785459257 Merge branch 'master' into io-overhaul 2022-07-10 19:06:48 +01:00
n1474335 037590f831 Updated CHANGELOG 2022-07-08 17:18:20 +01:00
n1474335 85496684d8 9.46.0 2022-07-08 17:17:23 +01:00
n1474335 4200ed4eb9 Tidied Cetacean ciphers 2022-07-08 17:16:35 +01:00
n1474335 6b16f11d3b Merge branch 'master' of https://github.com/valdelaseras/CyberChef 2022-07-08 17:02:06 +01:00
n1474335 683bd3e5db Updated CHANGELOG 2022-07-08 16:34:21 +01:00
n1474335 6a10e94bfd 9.45.0 2022-07-08 16:33:33 +01:00
n1474335 25086386c6 Tidied ROT8000 2022-07-08 16:33:16 +01:00
n1474335 d99ee32cc4 Merge branch 'ROT8000' of https://github.com/thomasleplus/CyberChef 2022-07-08 16:28:42 +01:00
n1474335 f1d318f229 Updated CHANGELOG 2022-07-08 16:25:59 +01:00
n1474335 a7fc455e05 9.44.0 2022-07-08 16:24:47 +01:00
n1474335 c02c4a72e4 Merge branch 'add-lz-string' of https://github.com/crespyl/CyberChef 2022-07-08 16:23:15 +01:00
n1474335 f97ce18ff9 Updated CHANGELOG 2022-07-08 16:03:42 +01:00
n1474335 dfd9afc2c4 9.43.0 2022-07-08 16:02:35 +01:00
n1474335 eb5663a1ed Tidied ROT brute forcing ops 2022-07-08 16:02:24 +01:00
n1474335 418a7962a5 Merge branch 'rot_bruteforce' of https://github.com/mikecat/CyberChef 2022-07-08 15:55:27 +01:00
n1474335 2ffce23c67 Updated CHANGELOG 2022-07-08 15:52:00 +01:00
n1474335 b828b50ccc 9.42.0 2022-07-08 15:47:42 +01:00
n1474335 a6aa40db97 Tidied LS47 operations 2022-07-08 15:47:35 +01:00
n1474335 45ede4beaf Merge branch 'LS47Cipher' of https://github.com/n1073645/CyberChef 2022-07-08 15:41:16 +01:00
n1474335 98a95c8bbf Updated CHANGELOG 2022-07-08 15:38:12 +01:00
n1474335 74bb8d92dc 9.41.0 2022-07-08 15:36:36 +01:00
n1474335 6cccc2c786 Tidied Caesar Box Cipher 2022-07-08 15:36:30 +01:00
n1474335 99a0a05947 Merge branch 'caesarBoxCipher' of https://github.com/n1073645/CyberChef 2022-07-08 15:32:56 +01:00
n1474335 94700dab89 Updated CHANGELOG 2022-07-08 15:28:39 +01:00
n1474335 c9d29c89bb 9.40.0 2022-07-08 15:27:01 +01:00
n1474335 7d4e554571 Tweaks to P-List Viewer operation 2022-07-08 15:26:33 +01:00
n1474335 2858a74cbf Merge branch 'plistViewer' of https://github.com/n1073645/CyberChef 2022-07-08 15:18:50 +01:00
n1474335 28e599a835 Merge branch 'improve-subsection-description' of https://github.com/n1073645/CyberChef 2022-07-08 15:17:31 +01:00
n1474335 1fb1d9cbb7 9.39.6 2022-07-08 15:16:00 +01:00
n1474335 2f097e5dfc Tidied up Base85 issues 2022-07-08 15:15:53 +01:00
n1474335 b71e3241be Merge branch 'master' of https://github.com/benediktwerner/CyberChef 2022-07-08 15:04:09 +01:00
n1474335 4b018bf421 9.39.5 2022-07-08 14:55:32 +01:00
n1474335 f751de896f Merge branch 'base' of https://github.com/john19696/CyberChef 2022-07-08 14:55:20 +01:00
n1474335 65aeae9c1e 9.39.4 2022-07-08 14:53:07 +01:00
n1474335 80943b0c26 Merge branch 'fix-merge' of https://github.com/n1073645/CyberChef 2022-07-08 14:52:56 +01:00
n1474335 a9657ac5c7 9.39.3 2022-07-08 14:51:08 +01:00
n1474335 6fa2e49f3a Merge branch 'webp-extractor' of https://github.com/n1073645/CyberChef 2022-07-08 14:50:57 +01:00
n1474335 50f0f70805 9.39.2 2022-07-08 14:49:50 +01:00
n1474335 fc95d82c49 Tweaked Extract Files minimum size 2022-07-08 14:49:40 +01:00
n1474335 bb6c1c54ff Merge branch 'extract-files-min-size' of https://github.com/n1073645/CyberChef 2022-07-08 13:57:06 +01:00
n1474335 c4414bd910 Fixed dropdown toggle height 2022-07-08 13:53:19 +01:00
n1474335 68733c74cc Output now uses CodeMirror editor 2022-07-02 19:23:03 +01:00
n1474335 bc949b47d9 Improved Controls CSS 2022-07-01 12:01:48 +01:00
n1474335 85ffe48743 Input now uses CodeMirror editor 2022-06-29 18:02:49 +01:00
n1073645 42c911838d Add min size to Extract Files 2022-06-17 11:18:49 +01:00
n1073645 8917eabfd1 Implemented webp extractor 2022-06-17 09:56:36 +01:00
n1073645 fc91469807 Added nesting to Merge/Fork/Subsection 2022-06-17 09:26:00 +01:00
John L 1735d9c091 remove logging 2022-06-15 15:07:39 +01:00
John L 00d754d466 lint fixes 2022-06-14 15:57:04 +01:00
John L 906727f133 Base85 improvements 2022-06-14 10:23:13 +01:00
n1073645 191d7f11f7 Improve the subsection description 2022-06-10 15:25:12 +01:00
n1474335 54fdc05e3a 9.39.1 2022-06-09 16:32:32 +01:00
n1474335 2267569c8d Fixed lint 2022-06-09 16:32:23 +01:00
n1474335 2f53ee3974 Merge branch 'fix_loop_counter' of https://github.com/sec65/CyberChef 2022-06-09 16:23:01 +01:00
n1474335 a3b846638f 9.39.0 2022-06-09 15:17:14 +01:00
n1474335 cc3033266c Updated CHANGELOG 2022-06-09 15:17:08 +01:00
n1474335 23b168515c Merge branch 'elf-info' of https://github.com/n1073645/CyberChef 2022-06-09 15:04:46 +01:00
n1073645 049690fea2 Linting modifications 2022-06-09 10:15:47 +01:00
n1073645 d3de91de85 Modify stream library to support reading until a null byte 2022-06-09 10:12:19 +01:00
n1073645 64eae37788 Added tests for ELF-Info 2022-06-09 10:02:38 +01:00
n1474335 8c71b0b8df 9.38.9 2022-06-08 18:59:36 +01:00
n1474335 2bf1ac6b9c 'Parse X.509 Certificate' Issuer and Subject name parsing improved. Closes #1365 2022-06-08 18:59:27 +01:00
n1474335 7197a434c2 9.38.8 2022-06-08 18:07:32 +01:00
n1474335 5349115b94 'JSON Beautify' operation now supports formatting, collapsing and syntax highlighting. Closes #203. 2022-06-08 18:07:11 +01:00
n1474335 4274e8f3a2 Fixed PEM wiki link 2022-06-06 15:20:31 +01:00
n1474335 7610e159a3 9.38.7 2022-06-06 14:54:27 +01:00
n1474335 9ec94434bb Fixed 'From Base64' bug adding null bytes. Closes #1362 2022-06-06 14:54:06 +01:00
n1073645 1ab444bda2 Fix tabs in tests file. 2022-06-05 18:40:46 +01:00
n1073645 3990ba774f Implemented readelf-like functionality. 2022-06-05 18:35:02 +01:00
sec65 1fea9a25a5 reset loop counter after last run 2022-06-05 17:22:42 +02:00
n1474335 3f57711c39 9.38.6 2022-06-03 22:58:23 +01:00
n1474335 dc46018757 Tidied up 'PEM to Hex' operation 2022-06-03 22:57:49 +01:00
n1474335 1464e5d5e4 Merge branch 'pem' of https://github.com/cplussharp/CyberChef 2022-06-03 22:21:37 +01:00
n1474335 95f7ed0de4 9.38.5 2022-06-03 22:13:50 +01:00
n1474335 6e7240026a Updated dependencies 2022-06-03 22:13:44 +01:00
n1474335 8bae7bf809 9.38.4 2022-06-03 21:41:44 +01:00
n1474335 b78bb2d3d6 Added 'Strict mode' to 'From Base64' operation 2022-06-03 21:41:37 +01:00
n1474335 f9a6402825 Merge branch 'strict_base64' of https://github.com/mikecat/CyberChef 2022-06-03 13:18:41 +01:00
n1474335 8ec5f3cb18 9.38.3 2022-06-03 13:15:25 +01:00
n1474335 c330394ff2 Fixed toBinary delim adjustment 2022-06-03 13:15:18 +01:00
n1474335 36e66ad5b4 Merge branch 'master' of https://github.com/michaellrowley/CyberChef 2022-06-03 13:10:59 +01:00
n1474335 a5a89efc06 9.38.2 2022-06-03 12:58:50 +01:00
n1474335 1078c37043 Merge branch 'master' of https://github.com/LukeSerne/CyberChef 2022-06-03 12:55:56 +01:00
n1474335 535c7188a8 9.38.1 2022-06-03 12:53:22 +01:00
n1474335 d6f9e216a6 Merge branch 'fix-to-base45' of https://github.com/mikecat/CyberChef 2022-06-03 12:50:45 +01:00
n1474335 7d6a879a67 Added script for updating the CHANGELOG 2022-05-31 00:20:19 +01:00
n1474335 668eac1f9e Fixed Split.js issues when resizing to around 1000px wide 2022-05-30 22:53:17 +01:00
n1474335 ff99436ce6 Fixed 'To Hex' highlighting 2022-05-30 19:43:59 +01:00
n1474335 ec577fc075 Fixed CSS for maximising output pane 2022-05-30 19:25:41 +01:00
n1474335 cc9d51b7be 9.38.0 2022-05-30 18:14:46 +01:00
n1474335 cf2b54e8c0 Update CHANGELOG 2022-05-30 18:14:41 +01:00
n1474335 a895d1d82a Added 'Parse TCP' operation 2022-05-30 18:06:15 +01:00
MikeCAT 11da4188ee fix "To Base45" ( #1351 ) 2022-05-20 11:59:04 +00:00
Luke Serné 5b68bad185 Support UTF8 encoded characters in Substitution operation
This adds support for UTF8-encoded characters in the input and the parameters.
2022-05-13 17:35:50 +02:00
n1474335 477e4a7421 9.37.3 2022-04-14 18:08:23 +01:00
n1474335 9a982f05ac Extract operations now offer built-in Sort and Unique options. Unique operation offers option to count occurances. Closes #1334. 2022-04-14 18:08:16 +01:00
n1474335 6959e2cf01 9.37.2 2022-04-14 16:57:51 +01:00
n1474335 f5fe79326a CodeQL fixes 2022-04-14 16:57:46 +01:00
n1474335 f77633cee9 9.37.1 2022-04-14 13:17:43 +01:00
n1474335 c858970573 Merge branch 'john19696-testui' 2022-04-14 13:17:32 +01:00
n1474335 fb3eceaee0 Tidied up UI tests 2022-04-14 13:16:36 +01:00
n1474335 8e37fec8f8 Merge branch 'testui' of https://github.com/john19696/CyberChef into john19696-testui 2022-04-14 11:55:56 +01:00
n1474335 ccaabfaee8 Fixed incorrect wording for RC4 Drop argument. 2022-04-14 11:55:34 +01:00
Thomas Leplus e712af33b7 Adding ROT8000 2022-04-11 18:44:14 -07:00
John L c431fb30c5 added logging & jsdoc 2022-04-06 10:54:20 +01:00
John L 1c04848480 added log_path 2022-04-06 10:51:52 +01:00
John L ca1a0797fb Merge branch 'master' into testui 2022-04-04 17:54:02 +01:00
John L 7b497181fd refactor samples, and more tests 2022-04-04 17:40:58 +01:00
John L 92767b1078 Try import 2022-03-31 19:32:41 +01:00
n1474335 7c66dacc40 9.37.0 2022-03-29 18:05:55 +01:00
n1474335 632277f9bd Updated CHANGELOG 2022-03-29 18:05:47 +01:00
n1474335 3c23ae03f5 Merge branch 'swesven-master' 2022-03-29 18:02:09 +01:00
n1474335 8117926ca3 Tidied up SM4 ops and NoPadding options for AES, DES and TripleDES 2022-03-29 18:01:57 +01:00
n1474335 31e9d27f1a Merge branch 'master' of https://github.com/swesven/CyberChef into swesven-master 2022-03-29 17:30:22 +01:00
n1474335 0c067d60d8 9.36.1 2022-03-29 17:26:17 +01:00
n1474335 1171d6b165 Merge branch 'pH-T-master' 2022-03-29 17:22:50 +01:00
n1474335 18022a2a48 Merge branch 'master' of https://github.com/pH-T/CyberChef into pH-T-master 2022-03-29 17:22:34 +01:00
n1474335 1400b5cca4 9.36.0 2022-03-29 12:48:47 +01:00
n1474335 98b5f9cc29 Updated CHANGELOG 2022-03-29 12:48:43 +01:00
n1474335 e766cb009e Merge branch 'hettysymes-SIGABA' 2022-03-29 12:45:56 +01:00
n1474335 993e276858 Tidied up Bletchley ops 2022-03-29 12:45:42 +01:00
n1474335 a762fb4df4 Merge branch 'SIGABA' of https://github.com/hettysymes/CyberChef into hettysymes-SIGABA 2022-03-29 12:26:39 +01:00
n1474335 00781fa459 Fixed lint 2022-03-29 11:55:41 +01:00
n1474335 c6e7367a4e 9.35.1 2022-03-28 17:15:51 +01:00
n1474335 3749bb1222 Merge branch 'AlexAndHisScripts-master' 2022-03-28 17:15:39 +01:00
n1474335 f3c83b2009 Merge branch 'master' of https://github.com/AlexAndHisScripts/CyberChef into AlexAndHisScripts-master 2022-03-28 17:14:57 +01:00
n1474335 d3583c31bc 9.35.0 2022-03-28 16:19:55 +01:00
n1474335 2f638d8c0c Updated CHANGELOG 2022-03-28 16:19:51 +01:00
n1474335 74e43ff65a Merge branch 't-8ch-base45' 2022-03-28 16:18:02 +01:00
n1474335 4f0b160ed3 Tidied up Base45 ops 2022-03-28 16:15:37 +01:00
n1474335 709b8696fc Merge branch 'base45' of https://github.com/t-8ch/CyberChef into t-8ch-base45 2022-03-28 16:04:34 +01:00
n1474335 e080c5d72e 9.34.2 2022-03-28 15:57:00 +01:00
n1474335 9cc177a9ad Code quality improvements 2022-03-28 15:56:15 +01:00
Paul Hager 9ad4e2525e fix: GetAllCasings.mjs test 2022-03-28 16:52:59 +02:00
n1474335 60b5fe0e76 9.34.1 2022-03-28 15:42:16 +01:00
n1474335 9273f97d88 Updated dependencies 2022-03-28 15:42:11 +01:00
Paul Hager e2b7ac68ef fix: GetAllCasings.mjs - newline bug 2022-03-28 14:46:41 +02:00
n1474335 98a6baf55a 9.34.0 2022-03-28 11:40:04 +01:00
n1474335 b5677387f5 Updated CHANGELOG 2022-03-28 11:39:57 +01:00
n1474335 cd3eaa4762 Merge branch 'n1073645-variationsOfString' 2022-03-28 11:37:42 +01:00
n1474335 9733bf65de Merge branch 'nodejs16' of https://github.com/john19696/CyberChef into john19696-nodejs16 2022-03-28 11:37:23 +01:00
n1474335 bc433f0234 9.33.1 2022-03-28 11:23:19 +01:00
n1474335 ad7283ee6f Merge branch 'Gitoffthelawn-patch-1' 2022-03-28 11:21:49 +01:00
n1474335 5b941358a9 Merge branch 'patch-1' of https://github.com/Gitoffthelawn/CyberChef into Gitoffthelawn-patch-1 2022-03-28 11:21:22 +01:00
n1474335 f19e898c57 Merge branch 'Wingless-Archangel-patch-1' 2022-03-28 11:20:29 +01:00
n1474335 590ffa184d Merge branch 'patch-1' of https://github.com/Wingless-Archangel/CyberChef into Wingless-Archangel-patch-1 2022-03-28 11:20:10 +01:00
n1474335 46de51512f Merge branch 'adamkdean-patch-1' 2022-03-28 11:15:48 +01:00
n1474335 a13f2f26e4 Merge branch 'patch-1' of https://github.com/adamkdean/CyberChef into adamkdean-patch-1 2022-03-28 11:15:28 +01:00
n1474335 c9c26f6f9f Merge branch 'eljeffeg-patch-1' 2022-03-28 11:13:44 +01:00
n1474335 787c29e42b Merge branch 'patch-1' of https://github.com/eljeffeg/CyberChef into eljeffeg-patch-1 2022-03-28 11:13:26 +01:00
n1474335 1c0b83d833 9.33.0 2022-03-28 10:58:30 +01:00
n1474335 5c767d09b0 Updated CHANGELOG 2022-03-28 10:58:25 +01:00
n1474335 75dba51f56 Improve CJS and ESM module support #1037 2022-03-28 10:52:28 +01:00
n1474335 78a1827af8 Merge branch 'john19696-nodejs16' 2022-03-25 18:33:22 +00:00
n1474335 9e3733b33b Fixed Node imports 2022-03-25 18:28:01 +00:00
n1474335 4ef65589e8 Actions can now be triggered manually 2022-03-25 15:24:21 +00:00
n1474335 cf9e670309 Updated eslint 2022-03-25 15:17:00 +00:00
n1474335 b09f98fbb4 Updated to Node 17 2022-03-25 14:59:54 +00:00
n1474335 e43e010163 Merge branch 'nodejs16' of https://github.com/john19696/CyberChef into john19696-nodejs16 2022-03-25 13:26:31 +00:00
n1073645 2a5cee0bd3 9.32.4 2022-03-23 09:31:17 +00:00
n1073645 c962bb79f5 Updated Dependencies 2022-03-23 09:28:32 +00:00
John L add745551b WIP 2022-02-11 16:56:58 +00:00
john19696 7b8213e1f6 Merge pull request #3 from john19696/nodejs16
Nodejs16 upgrade
2022-02-11 13:04:49 +00:00
John L 2e23a33dfc Merge branch 'nodejs16' of https://github.com/john19696/CyberChef into nodejs16 2022-02-04 11:03:05 +00:00
John L bca296ee37 GitHub actions update 2022-02-04 11:02:52 +00:00
John L 2dbd647868 nodeFlags needs quote change 2022-01-31 11:39:17 +00:00
john19696 2991e7d1fe Update Gruntfile.js
add nodeFlags
2022-01-31 10:31:19 +00:00
John L f6f12fc193 chromedriver update 2022-01-27 17:18:31 +00:00
john19696 1fac8c1cea Merge pull request #1 from t-8ch/nodejs16
Node 16 compatibility
2022-01-21 15:05:16 +00:00
Adam K Dean 590462e2e4 Fixed Crown Copyright link
Closes #1310
2022-01-18 22:07:59 +00:00
Robin Scholtes 578a61d331 add cetacean cipher encoder and decoder operations, tests. Update .gitignore to exclude idea generated files 2022-01-17 23:37:24 +13:00
Michael Rowley ed542582f9 Added more error-handling to ToUpperCase() 2021-12-29 19:59:48 +00:00
Michael Rowley 2574a63975 Minor adjustments 2021-12-29 19:32:39 +00:00
ElJeffe 291c55befd Spelling
Someone noticed this in another project that includes CyberChef
2021-12-14 08:47:55 -05:00
CPlusSharp b7a978505f PEMToHex: add magic check so it gets found 2021-11-17 20:19:42 +01:00
Thomas Weißschuh 7db1f39473 base45: Implement highlighting 2021-11-09 21:12:49 +01:00
Thomas Weißschuh 6017578964 Add Base45 operations
Closes #1219

Co-developed-by: Cyril Delétré <cyril.deletre@gmail.com>
2021-11-09 21:12:44 +01:00
CPlusSharp 1dbcd2ac84 PEMtoHex: Support arbitrary PEMs
previous implementation only supported some PEMs (e.g. Certificate)

the new implementation is more general,
it just extracts the base64 between
header and footer and decodes that to hex
2021-11-07 11:21:17 +01:00
Peter Jacobs 671ae6558f Added 'LZString Decompress' and 'LZString Compress' operations 2021-10-29 15:26:31 -05:00
Alex Chambers_Jones d2174725a9 Fixed reflected XSS described in issue 1265 2021-10-29 17:59:02 +01:00
Wingless-Archangel f630c499d5 Update .gitignore
add .node-version file for supporting [nodeenv](https://github.com/ekalinin/nodeenv)
2021-10-29 14:41:35 +02:00
MikeCAT e8f91316ff Added ROT13/47 Brute Force 2021-10-20 21:28:48 +09:00
MikeCAT a7cdb095d2 Added input validation to fromBase64() 2021-10-04 22:39:16 +09:00
Thomas Weißschuh cfc29ef821 Always use mjs imports
This is needed for Node/NPM 16 compat
2021-09-17 08:48:04 +02:00
Thomas Weißschuh 83c6775038 Support json modules
This is need for builds on Node/NPM 16
2021-09-17 08:45:56 +02:00
n1474335 ae1b12c120 9.32.3 2021-09-03 14:58:53 +01:00
n1474335 c423de545f Switch XOR input and output differential logic. Fixes #1155 2021-09-03 14:58:48 +01:00
n1474335 84011371b7 9.32.2 2021-08-26 16:51:50 +01:00
n1474335 f831ec6b7e Fixed issues in Protobuf parsing 2021-08-26 16:51:42 +01:00
n1474335 05bfa9158d 9.32.1 2021-08-19 12:06:30 +01:00
n1474335 649016bc85 Updated dependencies 2021-08-19 12:06:26 +01:00
n1474335 7492b874cf 9.32.0 2021-08-18 17:23:43 +01:00
n1474335 9ea21af61f Updated CHANGELOG 2021-08-18 17:23:38 +01:00
n1474335 dd18e52993 Protobuf operations improved to enable full and partial schema support 2021-08-18 17:22:09 +01:00
Gitoffthelawn 7712ee7f35 Improved consistency
Changed "or" to "and" because all the other sentence sections use "and".
2021-08-11 01:55:47 -07:00
n1474335 a4a13666e6 9.31.0 2021-08-10 16:51:28 +01:00
n1474335 07ef4da892 Updated CHANGELOG 2021-08-10 16:50:59 +01:00
n1474335 e9ca4dc9ca Added HASSH operations 2021-08-10 16:48:35 +01:00
n1474335 57bb8fbc45 9.30.0 2021-08-10 15:00:10 +01:00
n1474335 9175624210 Updated CHANGELOG 2021-08-10 15:00:04 +01:00
n1474335 289a417dfb Added 'JA3S Fingerprint' operation 2021-08-10 14:57:34 +01:00
n1474335 8379a9b275 Skipping UI tests in GitHub Actions 2021-08-10 14:26:33 +01:00
n1474335 5b1fad118f Fixed chromedriver path 2021-07-28 15:56:01 +01:00
n1474335 5e8985810e 9.29.2 2021-07-28 15:35:29 +01:00
n1474335 d2568e2a29 Updated dependencies 2021-07-28 15:35:24 +01:00
n1474335 6dfc21ef06 9.29.1 2021-07-28 14:58:17 +01:00
n1474335 1f19f2f58c Updated chromedriver 2021-07-28 14:58:09 +01:00
n1474335 1728cc7a85 9.29.0 2021-07-28 14:37:05 +01:00
n1474335 fa2fc2ba33 Updated CHANGELOG 2021-07-28 14:36:14 +01:00
n1474335 9a33498fed Added 'TLS JA3 Fingerprint' operation 2021-07-28 14:32:39 +01:00
n1474335 a3b873fd96 9.28.0 2021-03-26 14:09:51 +00:00
n1474335 97bd03799e Updated CHANGELOG 2021-03-26 14:09:37 +00:00
n1474335 ffaaaae2b4 Merge branch 'Danh4-issue-991' 2021-03-26 14:07:18 +00:00
n1474335 ff88d30d2f Tidied up CBOR operations 2021-03-26 14:07:02 +00:00
n1474335 88e3c2ccb2 Merge branch 'issue-991' of https://github.com/Danh4/CyberChef into Danh4-issue-991 2021-03-26 13:59:16 +00:00
swesven 6155634d3b Add the SM4 block cipher, also a no-padding option for block ciphers.
This adds an implementation of the SM4 block cipher, and operations
to encrypt and decrypt using it with CBC,ECB,CFB,OFB,CTR modes.

Also, a "no padding" option is added for AES,DES,3DES and SM4
decryption in ECB/CBC modes. This variant does not attempt to
validate the last block as being PKCS#7 padded.

This is useful, both since other padding schemes exist, and also
for decrypting data where the final block is missing.
2021-03-24 00:58:54 +01:00
n1474335 5029356514 Added link to FAQ description about output handling 2021-03-05 10:50:38 +00:00
n1474335 e57d5a7e75 9.27.6 2021-02-23 15:11:22 +00:00
n1474335 2bbe54cdcd Added further deconstruction of IPv6 Multicast Addresses in the 'Parse IPv6 Address' operation 2021-02-23 15:11:16 +00:00
n1474335 0e2423c390 9.27.5 2021-02-22 19:33:56 +00:00
n1474335 8fadad5891 AES Additional data can now be entered in a range of formats. #1011 2021-02-22 19:33:52 +00:00
n1474335 32455cd20f 9.27.4 2021-02-22 19:13:47 +00:00
n1474335 1e0e7f16a7 Added numeric validation for arguments in Binary and Hex operattions. Fixes #1178 2021-02-22 19:13:38 +00:00
n1474335 95884d77cf Extractable file formats are now listed properly in the 'Extract Files' description 2021-02-17 15:01:42 +00:00
n1474335 b69373f5e7 Fixed 'JSON to CSV' data flattening. 2021-02-16 14:48:56 +00:00
n1474335 61e85474d3 9.27.3 2021-02-16 14:36:36 +00:00
n1474335 3a9bdc58af Fixed 'JSON to CSV' handling of complex structures. Closes #637 2021-02-16 14:36:31 +00:00
n1474335 59c1c45d78 Updated dependencies 2021-02-16 14:17:09 +00:00
n1474335 b5f6cedd30 9.27.2 2021-02-16 14:12:18 +00:00
n1474335 c879af6860 Fixed 'Save recipe' URL generation issue. Closes #1176 2021-02-16 14:12:14 +00:00
n1474335 22fe5a6ae7 9.27.1 2021-02-12 17:55:36 +00:00
n1474335 57714c86a6 Escape HTML input in Fuzzy Match operation 2021-02-12 17:55:28 +00:00
n1474335 70cd375049 9.27.0 2021-02-12 13:54:52 +00:00
n1474335 e27e1dd42f Updated CHANGELOG 2021-02-12 13:53:59 +00:00
n1474335 8ad18bc7db Added 'Fuzzy Match' operation 2021-02-12 13:51:51 +00:00
n1474335 5893ac1a37 9.26.3 2021-02-12 12:12:08 +00:00
n1474335 83c3ab97f9 Merge branch 'n1073645-base64Alphabets' 2021-02-12 12:11:53 +00:00
n1474335 9b6be140fa Merge branch 'base64Alphabets' of https://github.com/n1073645/CyberChef into n1073645-base64Alphabets 2021-02-12 12:08:56 +00:00
n1474335 a6a60392c2 9.26.2 2021-02-12 12:05:03 +00:00
n1474335 ccfa0b991e Updated dependencies 2021-02-12 12:04:59 +00:00
n1474335 73b0e68993 Added code quality badge to README 2021-02-12 11:54:54 +00:00
n1474335 31a4eef001 9.26.1 2021-02-11 19:06:58 +00:00
n1474335 d6e2c9a6b9 Merge branch 'n1073645-HexdumpAsciiFix' 2021-02-11 19:06:47 +00:00
n1474335 e069f5db13 Tidied up hexdump UNIX format 2021-02-11 19:06:35 +00:00
n1474335 96b59cf0df Merge branch 'HexdumpAsciiFix' of https://github.com/n1073645/CyberChef into n1073645-HexdumpAsciiFix 2021-02-11 18:59:51 +00:00
n1474335 c1e1d4b7e3 9.26.0 2021-02-11 18:50:09 +00:00
n1474335 32d869231e Updated CHANGELOG 2021-02-11 18:50:03 +00:00
n1474335 6f95f01dda Merge branch 'n1073645-EPOCH' 2021-02-11 18:47:59 +00:00
n1474335 61a1c44f26 Renamed 'Generate Current Epoch' to 'Get Time'. It now uses the W3C High Resolution Time API and supports microsecond granularity 2021-02-11 18:47:44 +00:00
n1474335 e6c7899569 Merge branch 'EPOCH' of https://github.com/n1073645/CyberChef into n1073645-EPOCH 2021-02-11 18:08:55 +00:00
n1474335 a74a14145e 9.25.0 2021-02-11 18:03:45 +00:00
n1474335 04022b22be Updated CHANGELOG 2021-02-11 18:03:40 +00:00
n1474335 4f3010691c Merge branch 'n1073645-ID3Tags' 2021-02-11 18:01:24 +00:00
n1474335 672b477751 Extract ID3 operation now returns a JSON blob and presents an HTML table 2021-02-11 18:01:08 +00:00
n1474335 19360391a6 Merge branch 'ID3Tags' of https://github.com/n1073645/CyberChef into n1073645-ID3Tags 2021-02-11 16:16:33 +00:00
n1474335 447be8af34 9.24.8 2021-02-11 16:14:48 +00:00
n1474335 0989550e5c Merge branch 'n1073645-keychainExtractor' 2021-02-11 16:14:34 +00:00
n1474335 4d9b48b4d8 Tidied whitespace 2021-02-11 16:14:23 +00:00
n1474335 979652387d Merge branch 'keychainExtractor' of https://github.com/n1073645/CyberChef into n1073645-keychainExtractor 2021-02-11 16:12:57 +00:00
n1474335 de84fbdd1c Renamed workflows 2021-02-10 18:37:46 +00:00
n1474335 170e564319 Fixed incomplete multi-character sanitization and incomplete URL substring sanitization issues. 2021-02-10 17:41:39 +00:00
n1474335 530836876f 9.24.7 2021-02-10 13:13:25 +00:00
n1474335 1abc46058c Added a CodeQL workflow to check for bugs through code analysis. Fixed numerous bugs and implemented safeguards as already reported. 2021-02-10 13:13:19 +00:00
n1474335 892a3716ed Added Crypt lib for common resources 2021-02-09 15:00:35 +00:00
n1474335 5d982a9c8d 9.24.6 2021-02-09 14:50:17 +00:00
n1474335 6206224f1e Merge branch 'alblue-master' 2021-02-09 14:46:19 +00:00
n1474335 766310e2c7 Frequency Distribution operation now displays an HTML table 2021-02-09 14:46:04 +00:00
n1474335 02a397d2ae Merge branch 'master' of https://github.com/alblue/CyberChef into alblue-master 2021-02-09 14:30:03 +00:00
n1474335 4563c86acd 9.24.5 2021-02-09 14:24:08 +00:00
n1474335 0a59f8068e Merge branch 'aussieklutz-master' 2021-02-09 14:23:18 +00:00
n1474335 24548e3a48 Tidied up JWT tests 2021-02-09 14:23:02 +00:00
n1474335 f4784d49e7 Merge branch 'master' of https://github.com/aussieklutz/CyberChef into aussieklutz-master 2021-02-09 14:16:36 +00:00
n1474335 14d5069c6e Merge branch 'mt3571-1073-jwt-verify' 2021-02-09 14:15:12 +00:00
n1474335 9fdd55c5c6 Tidied up JWT ops 2021-02-09 14:14:59 +00:00
n1474335 5bc523aeff Merge branch '1073-jwt-verify' of https://github.com/mt3571/CyberChef into mt3571-1073-jwt-verify 2021-02-09 14:02:21 +00:00
n1474335 3ae2e2e2c8 Fixed highlighting of op names where only the description has hit 2021-02-09 11:50:20 +00:00
n1474335 83e49da7f6 Fixed description hiighlighting issue 2021-02-09 11:37:25 +00:00
n1474335 fe6df8778f Fixed year in CHANGELOG records. Closes #1168 2021-02-09 11:26:00 +00:00
Alex Blewitt 69073c9d99 Add ASCII output for frequency table
When showing results in the frequency distribution table, it's quite
helpful to see the distribution of the ASCII letters, if any. Provide an
option to show this to show the characters alongside the code.

Fixes #1169.

Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2021-02-07 16:22:13 +00:00
aussieklutz d5a0adea0c Update JWTVerify.mjs 2021-02-06 18:35:46 +10:00
aussieklutz 1bcb8e433d Update JWTVerify.mjs 2021-02-06 18:10:54 +10:00
aussieklutz fa05cf1d78 Update JWTVerify.mjs
Enabled ESRSA verification.
2021-02-06 17:58:49 +10:00
aussieklutz 63dff0d34d Update JWTVerify.mjs
Enabled validation of ECSHA256 JWT tokens in the tests
2021-02-06 17:55:44 +10:00
aussieklutz e228b197f9 Update JWTVerify.mjs 2021-02-06 17:45:42 +10:00
aussieklutz 4bbeb6caa3 Update JWTVerify.mjs
Add expectation for working RSASHA256 test, and comment out unused privatekey.
2021-02-06 17:42:42 +10:00
aussieklutz 139d25dff9 Update JWTVerify.mjs
Update RSASHA256 test with the public key derived from the pre-existing private key, and expect a working testcase.
2021-02-06 17:40:04 +10:00
aussieklutz 6984258404 Update JWTVerify.mjs
Enable verification of RSASHA256 and 512 tokens
2021-02-06 17:27:54 +10:00
n1474335 ba66fd6546 Fixed recursive matching arguments 2021-02-05 19:04:27 +00:00
n1474335 47bbefd81f Fixed recursive scoring results in fuzzy match lib 2021-02-05 18:24:15 +00:00
n1474335 50f796049c Fixed search test 2021-02-05 18:07:20 +00:00
n1474335 618da545b1 9.24.4 2021-02-05 17:55:10 +00:00
n1474335 21236f1938 Added fuzzy search for operations 2021-02-05 17:54:57 +00:00
n1474335 4169a15066 9.24.3 2021-02-03 19:07:46 +00:00
n1474335 6b10f61e11 Moved postinstall script to a Grunt task to fix relative calls. npm scripts now use local grunt install. 2021-02-03 19:07:39 +00:00
n1474335 83f119f7e4 9.24.2 2021-02-03 17:54:57 +00:00
n1474335 041c899a35 Comments are now treated as disabled so that they do not interfere with the Dish type. Closes #1126 and #1132. Thanks to @mt3571 for the suggestion. 2021-02-03 17:54:49 +00:00
n1474335 5412fc01b3 Merge branch 'Prinzhorn-base_64_order' 2021-02-02 17:36:23 +00:00
n1474335 76926d9252 Merge branch 'base_64_order' of https://github.com/Prinzhorn/CyberChef into Prinzhorn-base_64_order 2021-02-02 17:36:10 +00:00
n1474335 3270961574 Merge branch 'n1073645-microsoftDecoderMagic' 2021-02-02 17:29:41 +00:00
n1474335 9a1ef71aec Merge branch 'microsoftDecoderMagic' of https://github.com/n1073645/CyberChef into n1073645-microsoftDecoderMagic 2021-02-02 17:29:25 +00:00
n1474335 ba878925ad Merge branch 'Prinzhorn-boolean_args' 2021-02-02 17:23:23 +00:00
n1474335 8d6b71bfaa Merge branch 'boolean_args' of https://github.com/Prinzhorn/CyberChef into Prinzhorn-boolean_args 2021-02-02 17:23:05 +00:00
n1474335 b6845aa03c 9.24.1 2021-02-02 17:18:49 +00:00
n1474335 4a673bd92a AES Decrypt now supports Additional Authenticated Data in GCM mode. Added tests for ADD at each AES size. 2021-02-02 17:18:35 +00:00
n1474335 fdffabfdd4 Merge branch 'n1073645-AESGCMAAD' 2021-02-02 16:11:03 +00:00
n1474335 ba8591293b Merge branch 'AESGCMAAD' of https://github.com/n1073645/CyberChef into n1073645-AESGCMAAD 2021-02-02 16:10:47 +00:00
n1474335 9b3aae10cf 9.24.0 2021-02-02 16:07:57 +00:00
n1474335 5c85c4df63 Updated CHANGELOG 2021-02-02 16:07:52 +00:00
n1474335 8ece2603fb Merge branch 'n1073645-SM3' 2021-02-02 16:06:49 +00:00
n1474335 1b54584820 Tweaks to various hashing functions to improve config options 2021-02-02 16:06:37 +00:00
n1474335 3ce3866000 Merge branch 'SM3' of https://github.com/n1073645/CyberChef into n1073645-SM3 2021-02-02 11:58:36 +00:00
n1474335 becc258b6c Updated CHANGELOG 2021-02-02 11:12:52 +00:00
n1474335 16c9e7119d Updated CHANGELOG 2021-02-02 11:02:23 +00:00
n1474335 f5888fea9c 9.23.1 2021-02-01 19:29:47 +00:00
n1474335 b5162c7549 Merge branch 'maqifrnswa-master' 2021-02-01 19:27:42 +00:00
n1474335 1baea1da3d Merge branch 'master' of https://github.com/maqifrnswa/CyberChef into maqifrnswa-master 2021-02-01 19:27:24 +00:00
n1474335 40899a6fe4 9.23.0 2021-02-01 19:16:03 +00:00
n1474335 66c533431d Merge branch 'mattnotmitt-rsa' 2021-02-01 19:15:46 +00:00
n1474335 74ae77f17a Tidied up and added tests for RSA operations 2021-02-01 19:15:32 +00:00
n1474335 99eb1cced5 Merge branch 'rsa' of https://github.com/mattnotmitt/CyberChef into mattnotmitt-rsa 2021-02-01 17:30:02 +00:00
n1474335 c880ecf3c4 Merge branch 'stephengroat-nvmrc' 2021-02-01 17:01:44 +00:00
n1474335 c54c34d88e Merge branch 'nvmrc' of https://github.com/stephengroat/CyberChef into stephengroat-nvmrc 2021-02-01 17:01:31 +00:00
n1474335 60b3c597a7 9.22.4 2021-02-01 16:57:48 +00:00
n1474335 372ab32539 Updated dependencies 2021-02-01 16:57:42 +00:00
n1474335 e14745a973 9.22.3 2021-02-01 16:43:19 +00:00
n1474335 afffe584cf Added flat lib for JSON to CSV op 2021-02-01 16:41:54 +00:00
n1474335 cf532f1e30 Merge branch 'n1073645-JSONTOCSV' 2021-02-01 16:35:09 +00:00
n1474335 46425ba552 Merge branch 'JSONTOCSV' of https://github.com/n1073645/CyberChef into n1073645-JSONTOCSV 2021-02-01 16:34:57 +00:00
n1474335 9f65fac4e6 Added actions for linting and testing Pull Requests 2021-02-01 16:34:12 +00:00
n1474335 af98feff51 Improved PGP keygen test 2021-02-01 16:24:47 +00:00
n1474335 339c741a2c 9.22.2 2021-02-01 16:14:38 +00:00
n1474335 d1bde23f00 Merge branch 'n1073645-datetime' 2021-02-01 16:13:57 +00:00
n1474335 be544faf0f Merge branch 'datetime' of https://github.com/n1073645/CyberChef into n1073645-datetime 2021-02-01 16:13:43 +00:00
n1474335 eff77fd3bb 9.22.1 2021-02-01 16:11:46 +00:00
n1474335 3df57ba3dd Added big and little endian options for Windows timestamp conversion ops 2021-02-01 16:11:39 +00:00
n1474335 4bae662357 Merge branch 'n1073645-FiletimeEndianness' 2021-02-01 15:56:03 +00:00
n1474335 357c90546e Merge branch 'FiletimeEndianness' of https://github.com/n1073645/CyberChef into n1073645-FiletimeEndianness 2021-02-01 15:55:42 +00:00
n1474335 54769a90ac 9.22.0 2021-02-01 15:52:34 +00:00
n1474335 0550aedd54 Merge branch 'mattnotmitt-features/unicode-format' 2021-02-01 15:51:29 +00:00
n1474335 5947ed21fc Tidied up localisation in Wikipedia URL 2021-02-01 15:51:14 +00:00
n1474335 0a0949246f Merge branch 'features/unicode-format' of https://github.com/mattnotmitt/CyberChef into mattnotmitt-features/unicode-format 2021-02-01 15:45:21 +00:00
n1474335 09c6e181fb 9.21.6 2021-02-01 14:42:32 +00:00
n1474335 02cf394bcd ROT13 tweaks 2021-02-01 14:42:00 +00:00
n1474335 46afbf9888 Merge branch 'n1073645-numberRot' 2021-02-01 14:37:44 +00:00
n1474335 7cf19d22a8 Merge branch 'numberRot' of https://github.com/n1073645/CyberChef into n1073645-numberRot 2021-02-01 14:37:30 +00:00
n1474335 46d708360f Merge branch 'xavier630-patch-1' 2021-02-01 14:32:05 +00:00
n1474335 7ec91e2366 Merge branch 'patch-1' of https://github.com/xavier630/CyberChef into xavier630-patch-1 2021-02-01 14:31:42 +00:00
n1474335 a74ee47bf0 Updated actions config 2021-02-01 14:18:17 +00:00
n1474335 7b68b92498 Updated actions config 2021-02-01 14:14:40 +00:00
n1474335 274f3acd45 Added GH Releases and NPM actions 2021-02-01 14:10:21 +00:00
n1474335 53dff8b30f 9.21.5 2021-02-01 11:10:16 +00:00
n1474335 9892ee273e Bugfix: ECC mode now works correctly in 'Generate PGP Key Pair' 2021-02-01 11:10:04 +00:00
n1474335 7dccecb336 Moved GH Pages prep to its own step 2021-01-22 17:15:58 +00:00
n1474335 aa09da0403 GitHub Actions now pushes to GitHub Pages 2021-01-22 17:13:17 +00:00
n1474335 98d7f1481c Improved UI tests 2021-01-22 16:52:37 +00:00
n1474335 7d8bdbcf7e Improved UI tests 2021-01-22 16:39:04 +00:00
n1474335 db009d3689 Improved UI tests 2021-01-22 16:25:19 +00:00
n1474335 d7bc529a95 Improved UI tests 2021-01-22 16:16:11 +00:00
n1474335 3f035294a6 Improved UI tests 2021-01-22 16:06:44 +00:00
n1474335 36282e362f Improved UI tests 2021-01-22 15:53:56 +00:00
n1474335 223353cf4d Increased UI test operation timeout 2021-01-22 15:43:18 +00:00
n1474335 ded32da632 Back to a single job 2021-01-22 15:33:15 +00:00
n1474335 d6fc21cc34 Fixed yaml 2021-01-22 15:28:46 +00:00
n1474335 b86e960456 Actions broken out into separate jobs 2021-01-22 15:27:42 +00:00
n1474335 7747bfe0f2 Fixed prod build and Actions now creates a sitemap 2021-01-22 15:17:17 +00:00
n1474335 fabea8cc61 Fix whitespace 2021-01-22 15:00:15 +00:00
n1474335 de4cd2eebc Add production build to GitHub Actions script 2021-01-22 14:59:26 +00:00
n1474335 e16ce1d9c2 Specify node version 2021-01-22 14:53:53 +00:00
n1474335 345ad741b3 Fixed sed command in postinstall script to be platform dependent 2021-01-22 14:47:33 +00:00
n1474335 e53108c493 Merge branch 'gh-actions' 2021-01-22 14:33:48 +00:00
n1474335 6129378854 Reduced Actions script to just linting and testing 2021-01-22 14:33:35 +00:00
n1474335 11a1416dcc Merge branch 'gh-actions' of https://github.com/mattnotmitt/CyberChef into mattnotmitt-gh-actions 2021-01-22 14:17:29 +00:00
n1474335 9025538544 9.21.4 2021-01-22 13:48:30 +00:00
n1474335 46929e1844 Merge branch 'mattnotmax-haversine' 2021-01-22 13:48:19 +00:00
n1474335 bf023cad48 Merge branch 'haversine' of https://github.com/mattnotmax/CyberChef into mattnotmax-haversine 2021-01-22 13:48:04 +00:00
n1474335 f649236bad 9.21.3 2021-01-22 13:45:24 +00:00
n1474335 54b1454c0a Merge branch 'n1073645-binaryLength' 2021-01-22 13:45:09 +00:00
n1474335 a41b1c2f5e Merge branch 'binaryLength' of https://github.com/n1073645/CyberChef into n1073645-binaryLength 2021-01-22 13:44:49 +00:00
n1474335 0327d7cb7a 9.21.2 2021-01-22 13:40:36 +00:00
n1474335 621d7c3683 Merge branch 'manicgiraffe-update_forensicswiki_url' 2021-01-22 13:40:24 +00:00
n1474335 ae7c3fca31 Merge branch 'update_forensicswiki_url' of https://github.com/manicgiraffe/CyberChef into manicgiraffe-update_forensicswiki_url 2021-01-22 13:39:55 +00:00
n1474335 1b3295ff59 9.21.1 2021-01-22 12:59:05 +00:00
n1474335 e40e7a0e4e Added UI tests for operations. Unfinished. 2021-01-22 12:57:21 +00:00
n1474335 cf5fd7cbf2 Updated dependencies 2021-01-22 11:04:45 +00:00
n1474335 ec37a676a8 Updated dependencies 2020-12-14 17:51:12 +00:00
n1474335 f33193e122 Updated dependencies 2020-12-14 15:32:12 +00:00
n1474335 7c40204e4f Updated dependencies 2020-12-11 17:58:23 +00:00
n1474335 2b2ffb3346 Updated dependencies 2020-12-11 16:24:39 +00:00
mattnotmax 39b7e4ff9e Correct Haversine test output 2020-12-09 21:12:26 +11:00
mattnotmax a1109c43f6 Fix for haversine distance bug 2020-12-08 21:17:43 +11:00
mt3571 887ea0cf06 Changed an incorrect name 2020-12-01 13:49:34 +00:00
mt3571 3e0525ee9e Added in a new file to store the list of JWT algorithms that can be used, as this error was occurring due to a mismatch between what you could sign and what you could verify 2020-12-01 13:38:01 +00:00
Arthur Taggart e6eafc2843 Updated the links to forensic wiki website 2020-11-29 14:19:42 +00:00
Xavier Downs 3e8dea73d2 Update ScanForEmbeddedFiles.mjs 2020-11-24 12:18:02 +00:00
n1073645 bbf19ee944 argument added for numbers in ROT 2020-08-24 11:24:25 +01:00
n1073645 f6c8c9e76c swap endianness argument added to Windows Filetime To Unix Timestamp 2020-08-24 10:39:18 +01:00
n1073645 9dba1232b7 byte length argument added to ToBinary 2020-08-24 09:41:05 +01:00
Matt bf14c8983f trigger travis 2020-08-19 11:04:09 +01:00
Matt 3ab95384df Add unicode tests 2020-08-19 10:55:29 +01:00
n1073645 953a581a94 byte length arg added 2020-08-17 14:12:29 +01:00
n1073645 3bfddd708c rectify week number 2020-08-17 10:40:00 +01:00
Matt 13a54ec318 Add unicode text format operation 2020-08-13 12:36:02 +01:00
n1073645 2781640a2a JSON to CSV improvements 2020-07-29 15:27:55 +01:00
n1073645 7989f119d3 Linting Modifications 2020-07-16 09:56:30 +01:00
Scott Howard 2e0aa7ae87 Don't pad rail fence decode fixes #1069 2020-07-15 22:05:15 -04:00
n1073645 667dfd820e info url added 2020-07-06 16:46:40 +01:00
n1073645 3e3c526a62 Caesar Box Cipher Added 2020-07-06 16:35:14 +01:00
n1073645 c01ce90e06 Tests Added 2020-07-06 11:20:54 +01:00
n1073645 d68c8cb845 Casing Variations 2020-07-06 10:44:05 +01:00
Matt 0b5ee7c79f Update actions 2020-07-04 15:35:49 +01:00
Matt 23cbe1c426 Merge branch 'master' into gh-actions 2020-07-04 15:29:24 +01:00
Stephen G de727bcddc use nvmrc file
avoids storing node version in travis to allow nvm tool for local dev
2020-06-13 14:51:37 -07:00
d98762625 c9d9730726 Updated CHANGELOG 2020-06-12 13:50:30 +01:00
d98762625 a380aed878 9.21.0 2020-06-12 12:49:39 +01:00
d98762625 4dafa50799 improve some comments, remove unused properties from magic state shim in node API 2020-06-12 12:35:33 +01:00
Benedikt Werner f5a7db03cd Base85: Only require 15 continuous base85 chars 2020-06-10 15:50:26 +02:00
Matt d4ae241758 Merge branch 'master' into rsa 2020-06-08 15:55:37 +01:00
hettysymes 88947b9d42 Added operation description note and modified comment formatting 2020-06-08 12:27:40 +01:00
hettysymes 3c68ad1302 Modified control rotor stepping so the next control rotor steps once the previous rotor reaches "O" and added tests 2020-06-07 17:45:17 +01:00
hettysymes e2b3389da6 Added SIGABA simple test 2020-06-06 19:47:15 +01:00
hettysymes 938385c18b Fixed grunt lint errors 2020-06-06 19:46:42 +01:00
hettysymes 5d01b06877 Added copyright and clarified description 2020-06-06 19:46:42 +01:00
hettysymes f007c093eb Emulation of the WW2 SIGABA machine
I have created an emulation of the SIGABA machine and have tested it against some test data from a Master's thesis by Miao Ai: https://scholarworks.sjsu.edu/cgi/viewcontent.cgi?article=1237&context=etd_projects
2020-06-06 19:46:42 +01:00
d98762625 53e69835ff Formally disallow flowcontrol operations from being used in bake recipes 2020-06-05 14:44:34 +01:00
d98762625 939208903a Allow magic in node api 2020-06-05 12:26:17 +01:00
n1073645 7526f4d7b1 Generate Epoch Time Operation Added 2020-06-01 13:47:51 +01:00
d98762625 616b38c6fb 9.20.7 2020-05-28 09:50:22 +01:00
d98762625 a302df8f91 update bootstrap 2020-05-28 09:34:57 +01:00
dependabot[bot] 093512a55a Bump jquery from 3.4.1 to 3.5.0
Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.4.1...3.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-05-27 15:11:47 +00:00
d98762625 007224c92e 9.20.6 2020-05-27 15:59:42 +01:00
Matthieu 738ee33959 Fix bug in Normalise Unicode operation: replace nfc by nfkc 2020-05-27 15:47:40 +01:00
d98762625 d720a6b250 9.20.5 2020-05-27 15:34:45 +01:00
Matt 5ce3cc17bb Fixed tesseract issue 2020-05-27 15:00:34 +01:00
d98762625 5c35205315 9.20.4 2020-05-27 13:35:20 +01:00
d98762625 10751934e4 add uname dependency and bump chromedriver 2020-05-27 12:28:59 +01:00
d98762625 d658f91106 Merge branch 'master' of github.com:gchq/CyberChef into javascript-minify 2020-05-27 11:54:07 +01:00
Benedikt Werner ee408f7add Base85: Update magic regexes to require 20 non-whitespace base85 chars 2020-05-22 03:30:57 +02:00
Benedikt Werner 1294d764e2 Base85: Only remove start and end markers with standard/ascii85 encoding 2020-05-22 03:30:15 +02:00
Benedikt Werner eab1be0e2c Magic base85: Remove 'i' flag 2020-05-20 00:23:50 +02:00
Benedikt Werner 15dd9d4c93 Add magic checks for base85 2020-05-16 00:42:50 +02:00
Benedikt Werner 103ecff6a7 Base85: Ignore whitespace 2020-05-16 00:42:31 +02:00
Benedikt Werner 0182cdda69 Base85: Fix alphabetName 2020-05-16 00:42:02 +02:00
n1073645 fae96af17d Info for sm3 added 2020-04-24 14:13:55 +01:00
n1073645 57c1a03c4f Option structures added for hashing algorithms 2020-04-24 14:04:13 +01:00
Alexander Prinzhorn cb8fe42c66 Put Base64 after Base62 2020-04-16 10:20:38 +02:00
Alexander Prinzhorn 7f4b2574b0 Use proper booleans instead of relying on truthy/falsy values 2020-04-16 09:59:43 +02:00
Matt fad163e0eb Added tests (that can't be run) 2020-04-07 21:16:29 +01:00
Matt 7ad3992bd1 Add RSA Decrypt Operation 2020-04-07 13:31:33 +01:00
Matt e7b5c0e37c Add RSA Encrypt Operation 2020-04-07 13:31:17 +01:00
n1073645 cc35127459 AAD for AES Added 2020-04-07 13:03:24 +01:00
Matt 1c0ecd29c2 Fix RSA operations 2020-04-07 11:45:54 +01:00
n1073645 1f0fddd0e9 Added magic signature to Microsoft Script Decoder 2020-04-07 10:33:15 +01:00
Matt 18c6b9bc09 Add RSA Verify operation 2020-04-06 15:24:22 +01:00
Matt 2233b9a094 Comment and add error handling to generate and sign 2020-04-06 15:24:06 +01:00
Matt e0f000b913 Fixed RSA generation and added digest option to verify 2020-04-06 13:35:14 +01:00
Matt 73864e0809 Merge branch 'master' into features/rsa 2020-04-05 12:08:24 +01:00
n1073645 cd8a85975c Info and description 2020-04-02 15:59:58 +01:00
n1073645 2f94ec20b0 Added to categories 2020-04-02 15:58:03 +01:00
n1073645 09d9deae43 ID3 Extractor Added. 2020-04-02 15:43:55 +01:00
71819 209fc07eac Issue 991: Add CBOR Decode operation 2020-03-30 11:31:25 +01:00
71819 ae70cb89ed Issue 991: Add CBOR Encode operation 2020-03-30 11:31:25 +01:00
n1474335 4c3324aea1 9.20.3 2020-03-30 11:17:46 +01:00
n1474335 ac2fcee90f Merge branch 'Danh4-issue-998' 2020-03-30 11:17:38 +01:00
71819 94e00115fe Issue 998: DishJSON should only replace undefined with new ArrayBuffer not null or false 2020-03-28 20:27:59 +00:00
d98762625 29255d2338 Merge pull request #983 from n1073645/gruntSpelling
Grunt npm tests comment changed to npm test
2020-03-27 14:23:54 +00:00
n1073645 bda36e508a Regexes for magic for the new alphabets 2020-03-27 13:27:56 +00:00
n1073645 d2ea1273da Merge remote-tracking branch 'upstream/master' into base64Alphabets 2020-03-27 13:09:03 +00:00
n1474335 39278cfce7 9.20.2 2020-03-27 12:10:01 +00:00
n1474335 46cc48cfb9 Renamed Parse ObjectID Timestamp operation files 2020-03-27 12:09:57 +00:00
n1474335 eb4009949d 9.20.1 2020-03-27 12:05:41 +00:00
n1474335 57c48a4bd2 Merge branch 'n1073645-TargaExtractor' 2020-03-27 12:05:34 +00:00
n1474335 45011de494 Tidied up TARGE extractor 2020-03-27 12:05:23 +00:00
n1474335 5e51ed0a5f Merge branch 'TargaExtractor' of https://github.com/n1073645/CyberChef into n1073645-TargaExtractor 2020-03-27 12:01:46 +00:00
n1474335 875802ef2a 9.20.0 2020-03-27 12:00:39 +00:00
n1474335 bbc255ef83 Updated CHANGELOG 2020-03-27 12:00:33 +00:00
n1474335 fc155ec3fc Merge branch 'dmfj-parse-objectid-timestamp' 2020-03-27 11:56:58 +00:00
n1474335 3a0c8a199a Tidied up 'Parse ObjectID Timestamp' operation 2020-03-27 11:56:42 +00:00
n1474335 9c729c4490 Merge branch 'parse-objectid-timestamp' of https://github.com/dmfj/CyberChef into dmfj-parse-objectid-timestamp 2020-03-27 11:48:55 +00:00
n1474335 19bdbd66e5 Merge branch 'cbeuw-stacking-fix' 2020-03-27 10:19:14 +00:00
n1474335 ea090f79ee Merge branch 'stacking-fix' of https://github.com/cbeuw/CyberChef into cbeuw-stacking-fix 2020-03-27 10:17:54 +00:00
Andy Wang 1be6c54be2 Fix dropup menu being covered 2020-03-26 22:45:03 +00:00
n1474335 a4eeb226b1 9.19.1 2020-03-26 12:02:09 +00:00
n1474335 d136717636 Merge branch 'n1073645-MP3Extractor' 2020-03-26 12:02:02 +00:00
n1474335 ad0a2e6f58 Merge branch 'MP3Extractor' of https://github.com/n1073645/CyberChef into n1073645-MP3Extractor 2020-03-26 12:01:30 +00:00
n1474335 0212bfb46e 9.19.0 2020-03-24 11:37:30 +00:00
n1474335 5e0d661542 Updated CHANGELOG 2020-03-24 11:37:26 +00:00
n1474335 4c5f529ef4 Merge branch 'n1073645-newMagic' 2020-03-24 11:07:20 +00:00
n1474335 b765534b8b Tidied up the Magic operation 2020-03-24 11:06:37 +00:00
n1073645 7c672c5ee9 MP3 Extractor added 2020-03-23 10:11:24 +00:00
n1073645 090bf3f8ec MP3 Extractor added 2020-03-23 10:10:47 +00:00
Dominic Fitch-Jones 9f4ef9cdad Add ObjectId timestamp parser operation 2020-03-21 17:42:17 -04:00
n1474335 26fa66ef64 Merge branch 'newMagic' of https://github.com/n1073645/CyberChef into n1073645-newMagic 2020-03-20 14:51:40 +00:00
n1073645 b69e4567c0 MP3extractor 2020-03-19 16:10:22 +00:00
n1474335 26b19350f2 9.18.2 2020-03-18 16:47:53 +00:00
n1474335 2018b7e247 Fixed sitemap 2020-03-18 16:47:48 +00:00
n1474335 cbff4161a1 9.18.1 2020-03-18 16:12:38 +00:00
n1474335 130bdfb7f2 Updated dependencies 2020-03-18 16:12:30 +00:00
n1474335 d0c43f5aa9 Added a challenge 2020-03-18 15:45:40 +00:00
n1474335 f864a5f31e Suppressed highlighting errors 2020-03-18 13:40:16 +00:00
n1073645 ff585584f6 MP3 Extractor 2020-03-18 12:51:47 +00:00
n1073645 2e0af64ac3 PGP secring signatures and Mac OS X keyring extractor added 2020-03-17 14:53:05 +00:00
n1073645 8a029e5147 Grunt npm tests changed to npm test 2020-03-17 08:40:15 +00:00
n1073645 4251089687 Targa Image Extractor 2020-03-17 08:24:35 +00:00
n1073645 dbcd670ca8 Targa file extractor 2020-03-16 16:56:01 +00:00
n1474335 cecae671d8 9.18.0 2020-03-13 17:13:19 +00:00
n1474335 b4e23ac454 Updated CHANGELOG 2020-03-13 17:13:12 +00:00
n1474335 e7209ca085 Merge branch 'MarvinJWendt-operation/convert-to-nato-alphabet' 2020-03-13 17:10:50 +00:00
n1474335 022ef71d2c Tidied up 'Convert to NATO alphabet' operation 2020-03-13 17:10:29 +00:00
n1474335 0fad891a3a Merge branch 'operation/convert-to-nato-alphabet' of https://github.com/MarvinJWendt/CyberChef into MarvinJWendt-operation/convert-to-nato-alphabet 2020-03-13 16:45:37 +00:00
n1474335 47f608b502 9.17.0 2020-03-13 16:38:03 +00:00
n1474335 4ab745f730 Updated CHANGELOG 2020-03-13 16:37:41 +00:00
n1474335 1f89ac11d2 Merge branch 'pointhi-generate_image' 2020-03-13 16:35:33 +00:00
n1474335 1a5dae76c2 Tidied up 'Generate Image' operation 2020-03-13 16:35:19 +00:00
n1474335 032c7f529a Merge branch 'generate_image' of https://github.com/pointhi/CyberChef into pointhi-generate_image 2020-03-13 16:20:45 +00:00
n1474335 707818abcc Merge branch 'n1073645-importFix' 2020-03-13 16:18:31 +00:00
n1474335 58e8b4c618 Merge branch 'importFix' of https://github.com/n1073645/CyberChef into n1073645-importFix 2020-03-13 16:18:10 +00:00
n1474335 9c0c2867dd Increased test timeout to 120s from 60 2020-03-13 15:06:40 +00:00
n1474335 4308c717c3 Tests now display a progress bar and report long running tests 2020-03-13 14:59:48 +00:00
n1073645 30bc8dfbe9 UNIX Format Added for ToHexdump 2020-03-13 10:38:37 +00:00
n1073645 342b67581b Very small correction for import in Colossus 2020-03-13 10:14:08 +00:00
n1474335 75da5b650c Replaced 'new Date().getTime()' calls with 'Date.now()' for clarity and performance 2020-03-12 15:23:22 +00:00
n1073645 5b6a53be3e Docstrings added for Magic functions 2020-03-12 14:55:19 +00:00
n1073645 5b5105c864 Caching added for Magic regexes 2020-03-12 14:45:40 +00:00
n1474335 9d09146f68 9.16.4 2020-03-12 14:42:10 +00:00
n1474335 1b19d20d0c Merge branch 'n1073645-Luhn' 2020-03-12 14:42:03 +00:00
n1474335 0eacab5ddc Tidied up Luhn checksum op 2020-03-12 14:41:46 +00:00
n1474335 0d7874bac1 Merge branch 'Luhn' of https://github.com/n1073645/CyberChef into n1073645-Luhn 2020-03-12 14:35:40 +00:00
n1474335 5cddfafbd0 9.16.3 2020-03-12 14:31:49 +00:00
n1474335 5ce133c47e Merge branch 'VirtualColossus-master' 2020-03-12 14:31:38 +00:00
n1073645 53a579028c Added only ASCII flag to ToHexdump 2020-03-12 09:30:48 +00:00
n1073645 570a84b67a More Magic tests 2020-03-11 16:27:37 +00:00
VirtualColossus a68bfd7223 Fix gchq#973 custom setting correction 2020-03-11 13:01:49 +00:00
n1073645 fd7176a445 Extra Magic Tests 2020-03-11 12:51:46 +00:00
n1073645 0a06472639 Test added for From Hex 2020-03-10 11:23:14 +00:00
n1073645 3f3a7cd4f6 From Hex Regexes 2020-03-10 11:12:43 +00:00
n1073645 99415359d0 Extra Magic Tests 2020-03-10 09:39:13 +00:00
n1073645 54cb2d268b Luhn checksum tests 2020-03-09 09:37:34 +00:00
n1073645 0e40daecb6 Generates both the checksum and checkdigit. 2020-03-09 09:13:02 +00:00
n1474335 21a822b082 9.16.2 2020-03-06 16:00:06 +00:00
n1474335 a770d09687 Merge branch 'n1073645-debExtractor' 2020-03-06 15:59:59 +00:00
n1474335 27b81c4e11 Tidied up JAR and DEB extractors 2020-03-06 15:59:42 +00:00
n1474335 8826c80e07 Merge branch 'debExtractor' of https://github.com/n1073645/CyberChef into n1073645-debExtractor 2020-03-06 15:57:16 +00:00
n1073645 02e3ce7fc1 Linting 2020-03-06 14:50:25 +00:00
n1073645 673e6aede5 Moved alternative JAR signature 2020-03-06 14:26:05 +00:00
n1474335 5809dea0fc 9.16.1 2020-03-06 13:36:17 +00:00
n1474335 165ca9ebc1 Merge branch 'n1073645-moreExtractors' 2020-03-06 13:36:07 +00:00
n1474335 154b9386f7 Merge commit 'refs/pull/932/head' of github.com:gchq/CyberChef into n1073645-moreExtractors 2020-03-06 13:34:35 +00:00
n1073645 62dd7c3dbc Removed debugging try/catch 2020-03-06 13:29:11 +00:00
n1474335 82d098fc1a Merge branch 'moreExtractors' of https://github.com/n1073645/CyberChef into n1073645-moreExtractors 2020-03-06 13:21:13 +00:00
n1474335 c69ac7f0f2 9.16.0 2020-03-06 13:10:57 +00:00
n1474335 5578f4577d Updated CHANGELOG 2020-03-06 13:08:15 +00:00
n1474335 28bd8a32e3 Merge branch 'VirtualColossus-master' 2020-03-06 13:05:30 +00:00
n1474335 24fd35e6af Tidied up Colossus operation 2020-03-06 13:05:08 +00:00
n1474335 c4493d15b6 Merge branch 'master' of https://github.com/VirtualColossus/CyberChef into VirtualColossus-master 2020-03-06 10:43:52 +00:00
n1474335 f9ef9739b0 9.15.1 2020-03-05 17:11:44 +00:00
n1474335 d50b9103c2 Merge branch 'n1073645-extractWavFix' 2020-03-05 17:11:38 +00:00
n1474335 196a611c9b Merge branch 'extractWavFix' of https://github.com/n1073645/CyberChef into n1073645-extractWavFix 2020-03-05 17:09:54 +00:00
n1474335 7c057ad254 Added logo files to repository 2020-03-05 17:02:02 +00:00
n1474335 cced384e0a 9.15.0 2020-03-05 16:43:15 +00:00
n1474335 cce7abecd5 Updated CHANGELOG 2020-03-05 16:43:10 +00:00
n1474335 8013b3b5e9 Merge branch 'n1073645-NewCiphers' 2020-03-05 16:40:07 +00:00
n1474335 64b979e25e CipherSaber2 ops now accept a variety of key types 2020-03-05 16:39:52 +00:00
n1474335 5e7b004925 Merge branch 'NewCiphers' of https://github.com/n1073645/CyberChef into n1073645-NewCiphers 2020-03-05 15:25:10 +00:00
n1474335 1e791d7f1b 9.14.0 2020-03-05 15:22:23 +00:00
n1474335 a255d1912c Updated CHANGELOG 2020-03-05 15:22:16 +00:00
n1474335 3d1266f815 Merge branch 'n1073645-Luhn' 2020-03-05 15:19:37 +00:00
n1474335 ede78c540f Tidied up 'Luhn Checksum' operation 2020-03-05 15:19:23 +00:00
n1474335 c0f003b450 Merge branch 'Luhn' of https://github.com/n1073645/CyberChef into n1073645-Luhn 2020-03-05 15:16:50 +00:00
n1073645 14190fc533 DEB extractor 2020-03-05 15:01:07 +00:00
n1474335 9f34009244 9.13.2 2020-03-05 14:46:41 +00:00
n1474335 bc2fefd1b2 Merge branch 'n1073645-emailRegexFix' 2020-03-05 14:46:30 +00:00
n1073645 940b56ba5f Luhn Checksum Operation Added 2020-02-26 10:55:15 +00:00
n1073645 8f2a1f5b2c Improved email regex 2020-02-25 14:48:22 +00:00
n1073645 20d0ae5304 Linting corrections 2020-02-25 11:35:39 +00:00
n1073645 2ba37af109 extra signatures 2020-02-25 11:33:35 +00:00
n1073645 728f8e65d6 Magic rebuild 2020-02-25 11:27:03 +00:00
n1474335 d78730edc0 9.13.1 2020-02-19 12:06:11 +00:00
n1474335 b0d2593968 Merge branch 'n1073645-MoreSignatures' 2020-02-19 12:05:30 +00:00
n1474335 38a033f1a9 Updated npm install 2020-02-19 12:05:06 +00:00
n1474335 846ad1796a Merge branch 'MoreSignatures' of https://github.com/n1073645/CyberChef into n1073645-MoreSignatures 2020-02-19 12:04:30 +00:00
n1073645 355a6d6b76 Modifications made to CipherSaber2 2020-02-14 14:21:32 +00:00
n1073645 e91e993fb5 Update LS47.mjs 2020-02-14 13:43:30 +00:00
n1073645 e71794d362 Tests added for LS47 2020-02-14 12:28:12 +00:00
n1073645 6090842372 Modifications made to ciphersaber 2020-02-14 09:15:50 +00:00
n1073645 0a3bd6456c Modifications made to signatures 2020-02-14 08:27:48 +00:00
n1474335 ab6576d739 Travis config now uses dpl v2 2020-02-13 16:31:44 +00:00
n1474335 d5615b90bb Updated .travis.yml 2020-02-13 16:14:02 +00:00
n1474335 cf1349ccb2 9.13.0 2020-02-13 15:09:19 +00:00
n1474335 36190f1967 Merge branch 'Flavsditz-master' 2020-02-13 15:09:08 +00:00
n1474335 3ecbe22d99 Updated CHANGELOG 2020-02-13 15:08:54 +00:00
n1474335 b045dc37f5 Tidied up infoURL in Rail Fence Cipher ops 2020-02-13 15:06:09 +00:00
n1474335 015d0f065f Merge branch 'master' of https://github.com/Flavsditz/CyberChef into Flavsditz-master 2020-02-13 15:04:00 +00:00
n1474335 d7cc6c7363 9.12.1 2020-02-13 14:18:12 +00:00
n1474335 a5bc1c6f9e Merge branch 'cbeuw-toHex' 2020-02-13 14:17:58 +00:00
n1474335 c2212f9ab3 Tidied up To Hex mods 2020-02-13 14:17:43 +00:00
n1474335 3fb5bf14a6 Merge branch 'toHex' of https://github.com/cbeuw/CyberChef into cbeuw-toHex 2020-02-13 12:58:39 +00:00
n1474335 f32b7d5de5 Merge branch 'retnikt-allow-custom-ports' 2020-02-13 12:54:21 +00:00
n1474335 7a58567659 Updated chromedriver version 2020-02-13 12:54:05 +00:00
n1474335 4be0a436f2 Merge branch 'allow-custom-ports' of https://github.com/retnikt/CyberChef into retnikt-allow-custom-ports 2020-02-13 12:34:02 +00:00
n1474335 1e71fc91a1 Merge branch 'hjung4-spell' 2020-02-13 12:29:49 +00:00
Flavio Diez 0ab96dd4ca Throw OperationError instead of returning a String 2020-01-29 14:16:04 +01:00
Flavio Diez 1509b2b96c Implemented the Rail Fence Cipher with both encoding and decoding 2020-01-29 12:46:38 +01:00
n1073645 6fd929160d Comments and linting. 2020-01-28 10:35:01 +00:00
n1073645 5cdd062ed9 Linting done 2020-01-28 09:40:03 +00:00
comet 4430ea55c4 update 2020-01-27 17:02:13 -06:00
retnikt 4b6cebc068 allow custom ports for Grunt tasks 2020-01-27 18:55:50 +00:00
n1073645 0259ed8314 LS47 implemented, needs linting 2020-01-27 16:07:54 +00:00
n1073645 a06303c2fd CipherSaber2 added 2020-01-27 14:33:05 +00:00
n1073645 115b064081 Extra Signatures added 2020-01-23 12:56:51 +00:00
n1073645 3a2580fbc2 Extra Base64 Alphabets 2020-01-22 10:35:11 +00:00
Andy Wang 1197859865 Preserve null data when type is number in prepare 2020-01-18 14:56:17 +00:00
Andy Wang 293a95e938 Remove tickbox and make 0x comma an option 2020-01-18 13:55:32 +00:00
Andy Wang 9a3464a5ec Fix ingredient type conversion for null number 2020-01-18 13:19:28 +00:00
Andy Wang 55dddd3ef9 Add tests 2020-01-18 00:21:15 +00:00
Andy Wang 23956480b7 Variable name 2020-01-17 18:47:46 +00:00
Andy Wang 6dbaf6a36c reverse highlight 2020-01-17 12:48:21 +00:00
Andy Wang 1d8c7dcb97 Allow output highlighting 2020-01-15 23:29:18 +00:00
Andy Wang 41c8a5aff0 fromHex can now extract 0x format 2020-01-15 22:20:47 +00:00
Andy Wang 597fba2fd0 Add line size formatting and comma separation 2020-01-15 00:14:43 +00:00
n1073645 0f0674daf6 More extractors added. 2020-01-09 09:57:12 +00:00
n1073645 d9b7fe2bb9 ExtractWAV fixed 2020-01-06 12:32:14 +00:00
n1073645 ace8121d0e Update dependencies. 2020-01-06 08:53:51 +00:00
n1474335 f7be8d720b 9.12.0 2019-12-20 16:08:03 +00:00
n1474335 0a5038e533 Updated CHANGELOG 2019-12-20 16:07:52 +00:00
n1474335 5feba30956 Merge branch 'matthieuxyz-normalise-unicode' 2019-12-20 16:05:43 +00:00
n1474335 23a228bbd9 Tidied up Normalise Unicode operation 2019-12-20 16:05:24 +00:00
n1474335 598813ff88 Merge branch 'normalise-unicode' of https://github.com/matthieuxyz/CyberChef into matthieuxyz-normalise-unicode 2019-12-20 15:56:59 +00:00
n1474335 118f0130d8 9.11.20 2019-12-20 15:55:26 +00:00
n1474335 e77d3a4b7d Merge branch 'n1073645-dev' 2019-12-20 15:55:01 +00:00
n1474335 bf0bd620f1 Tidied up Case Insensitive Regex ops 2019-12-20 15:54:39 +00:00
n1474335 62edd76d7e Merge branch 'dev' of https://github.com/n1073645/CyberChef into n1073645-dev 2019-12-20 15:49:40 +00:00
n1474335 cef6585cab 9.11.19 2019-12-20 15:47:29 +00:00
n1474335 481241b88d Merge branch 'bartblaze-master' 2019-12-20 15:46:23 +00:00
n1474335 93c0c7cc10 Merge branch 'master' of https://github.com/bartblaze/CyberChef into bartblaze-master 2019-12-20 15:45:31 +00:00
n1474335 01d9536bbd Merge branch 'n1073645-dish-fix' 2019-12-20 15:42:15 +00:00
n1474335 24a7c75926 Merge branch 'dish-fix' of https://github.com/n1073645/CyberChef into n1073645-dish-fix 2019-12-20 15:41:59 +00:00
n1474335 c2eea7a9f7 9.11.18 2019-12-20 15:39:32 +00:00
n1474335 e2812cadb5 Merge branch 'n1073645-dish-fix' 2019-12-20 15:39:23 +00:00
n1073645 cde958af16 Linting 2019-12-20 15:27:46 +00:00
n1073645 bf70589b3c Tidy up 2019-12-20 15:23:30 +00:00
n1073645 78d1114869 Merge remote-tracking branch 'upstream/master' into dish-fix 2019-12-20 15:22:31 +00:00
n1474335 ab83caa77b 9.11.17 2019-12-20 15:21:13 +00:00
n1474335 42dd03bb84 Merge branch 'n1073645-gzip-bugfix' 2019-12-20 15:21:05 +00:00
n1474335 cb09949fb9 Merge branch 'gzip-bugfix' of https://github.com/n1073645/CyberChef into n1073645-gzip-bugfix 2019-12-20 15:17:36 +00:00
n1474335 0c6eac3b21 9.11.16 2019-12-20 15:04:49 +00:00
n1474335 5e771c521c Merge branch 'n1073645-ICOextractor' 2019-12-20 15:04:39 +00:00
n1474335 b8afbf7458 Tidied up ICO extractor 2019-12-20 15:04:27 +00:00
n1474335 be59efbd6b Merge branch 'ICOextractor' of https://github.com/n1073645/CyberChef into n1073645-ICOextractor 2019-12-20 15:03:05 +00:00
n1474335 99ccd06f23 9.11.15 2019-12-20 15:02:01 +00:00
n1474335 f4d75f88a9 Merge branch 'n1073645-OLE2' 2019-12-20 15:00:28 +00:00
n1474335 9112bd4936 Tidied up OLE2 extractor 2019-12-20 15:00:10 +00:00
n1474335 3e513efd59 Merge branch 'OLE2' of https://github.com/n1073645/CyberChef into n1073645-OLE2 2019-12-20 14:47:50 +00:00
n1073645 4100a22c7f Linting on tests 2019-12-17 12:30:32 +00:00
n1073645 71078d9332 Added tests for gunzip. 2019-12-17 12:28:09 +00:00
n1073645 72ba579e1e Remove unnecessary comments. 2019-12-17 12:17:13 +00:00
n1073645 5fd2512a9b Gzip tests added 2019-12-17 12:15:11 +00:00
n1073645 3a1a6a94d2 Sets the gzip comment bitfield 2019-12-16 17:05:06 +00:00
n1474335 928178716a Operation elements now have decreasing z-index properties, meaning dropdowns do not get hidden. Fixes #925 2019-12-16 14:46:06 +00:00
n1073645 08419a20c0 Fixed the magic bug where it wouldnt recommended operations that resulted in lists of files 2019-12-13 16:27:31 +00:00
n1073645 60506ee2d1 Fixed the magic bug where it wouldnt recommended operations that resulted in lists of files 2019-12-13 16:23:54 +00:00
n1073645 6e411c9dd9 Merge remote-tracking branch 'upstream/master' into dish-fix 2019-12-13 16:11:48 +00:00
n1073645 86db43e6dd Fixed the magic bug where it wouldnt recommended operations that resulted in lists of files 2019-12-13 16:09:02 +00:00
n1474335 252ac0bdaa 9.11.14 2019-12-13 14:57:09 +00:00
n1474335 4d8b1721bc Always display HTML outputs even if they are above the size threshold. Could lead to crashing, but this risk is accepted. 2019-12-13 14:57:03 +00:00
n1474335 fd390bc61b Improved CR preservation logic - now based on entropy 2019-12-13 14:45:13 +00:00
n1474335 813a151524 Added 'Show all' button to output file overlay 2019-12-13 12:59:59 +00:00
Bart c06502cd76 Improve RTF detection
Certain RTF files may attempt to thwart detection by having a malformed RTF header, such as **{\rt000**. Removing 0x66 will result in detecting these malformed yet valid RTFs as well.

Additional reading:
https://www.decalage.info/rtf_tricks#Trick_1:_Incomplete_RTF_Header
2019-12-11 22:58:33 +01:00
n1474335 974ce1fd12 9.11.13 2019-12-10 16:21:59 +00:00
n1474335 d2dc50fe8e Fixed file overlay icon 2019-12-10 16:21:53 +00:00
n1474335 ec50105e34 9.11.12 2019-12-09 13:51:52 +00:00
n1474335 86ebed132d Updated dependencies 2019-12-09 13:51:48 +00:00
n1073645 47ccafcbb2 Linting and tidy up 2019-12-05 09:47:32 +00:00
VirtualColossus 9f901188af Added Colossus test 2019-12-04 23:02:20 +00:00
VirtualColossus ccdd2af8be Added tests, removed debug 2019-12-04 22:43:22 +00:00
VirtualColossus a387db6109 Merge branch 'master' of https://github.com/VirtualColossus/CyberChef 2019-12-04 14:29:41 +00:00
VirtualColossus b88a35cd14 Added P5 limitation 2019-12-04 14:28:53 +00:00
VirtualColossus bcafaebf77 Merge remote-tracking branch 'upstream/master' 2019-12-04 14:28:05 +00:00
n1474335 798f013219 9.11.11 2019-12-02 15:17:22 +00:00
n1474335 61e6423d95 Added word separator code to Morse Code ops. 2019-12-02 15:17:17 +00:00
VirtualColossus c32fec6b53 Various fixes for conditional calcs 2019-11-30 10:25:24 +00:00
VirtualColossus 4c0d944992 Merge remote-tracking branch 'upstream/master' 2019-11-29 20:36:06 +00:00
VirtualColossus 57ee3f305d Fixed issue in counter 2019-11-28 13:56:02 +00:00
VirtualColossus 61ab9a904f Added argument validation 2019-11-28 13:22:51 +00:00
VirtualColossus 820bd2f867 Added Total Motor, fixed bug in printout 2019-11-27 13:38:28 +00:00
n1474335 44c2b71e6c 9.11.10 2019-11-27 12:56:30 +00:00
n1474335 b806be3f49 Merge branch 'n1073645-master' 2019-11-27 12:56:21 +00:00
n1474335 2750284eea Improved comment in Tar extractor 2019-11-27 12:56:10 +00:00
n1474335 5366f1a2eb Merge branch 'master' of https://github.com/n1073645/CyberChef into n1073645-master 2019-11-27 12:52:25 +00:00
VirtualColossus 32625dc0b0 Added label type ingredient 2019-11-27 12:49:35 +00:00
VirtualColossus dfc8f517f2 Added Colossus operation 2019-11-27 12:48:09 +00:00
n1474335 b459c15d74 9.11.9 2019-11-27 12:47:16 +00:00
n1474335 8a02b35d7d Merge branch 'Mirclus-master' 2019-11-27 12:47:10 +00:00
n1474335 d4441823aa Merge branch 'master' of https://github.com/Mirclus/CyberChef into Mirclus-master 2019-11-27 12:46:25 +00:00
n1474335 13e9a4f0da 9.11.8 2019-11-27 12:36:18 +00:00
n1474335 33471a33d6 Merge branch 'fjh1997-master' 2019-11-27 12:36:13 +00:00
Matthieu a6fa0628f2 Add operation to normalise unicode 2019-11-25 22:59:14 +01:00
Mirclus 8e5aa2c393 DNS over HTTP: Fix "validate" argument
The argument sets the "cd" parameter on the request.
For both included providers, this flag disables validation ([1], [2]),
so doing the exact opposite of the described action.

This changes the label to the correct name and also flips the default
value to keep the old behavior.

[1] Google
<https://developers.google.com/speed/public-dns/docs/doh/json#supported_parameters>
[2] Cloudflare
<https://developers.cloudflare.com/1.1.1.1/dns-over-https/json-format/>
2019-11-25 20:08:30 +01:00
n1073645 1118ff598d From Base85 and From Braille signatures added for magic 2019-11-25 13:43:31 +00:00
n1073645 09e93b4639 Added ICO extractor 2019-11-25 11:26:31 +00:00
n1073645 d8405e5f81 Linting on PLIST viewer operation. 2019-11-25 10:37:30 +00:00
n1073645 0295d0c9b4 Tided up presentation of the PLIST 2019-11-25 10:35:45 +00:00
fjh1997 d16bbe1e7e Fixed typo in IPV6 alphabet
According to python3 base64.b85decode module https://github.com/python/cpython/blob/3.8/Lib/base64.py
2019-11-24 22:03:37 +08:00
n1073645 8e1e1d56ca Plist viewer operation added. 2019-11-22 15:39:43 +00:00
n1073645 4814922e67 Linting for regex operation 2019-11-22 10:58:24 +00:00
n1073645 81d1007bb7 Added tests for regex operation and a slight bug fix 2019-11-22 10:45:02 +00:00
n1073645 63bb19d48d Began implementing the PLIST viewer operation 2019-11-22 08:32:46 +00:00
n1474335 610d46a1a4 9.11.7 2019-11-21 14:21:20 +00:00
n1474335 f7acef4642 Fixed module detection issue. Closes #881 2019-11-21 14:13:36 +00:00
n1474335 fd5b6c5243 9.11.6 2019-11-21 13:05:39 +00:00
n1073645 e92ed13864 PLIST viewer. 2019-11-21 12:53:44 +00:00
n1474335 a8917e4713 Updated dependencies 2019-11-21 12:15:07 +00:00
n1073645 04036e001e Comments and linting for regex operation. 2019-11-21 12:13:34 +00:00
n1073645 725b0d42f8 Comments to OLE2 extractor 2019-11-21 11:34:11 +00:00
n1073645 071c1bdea6 Comments for OLE2 extractor. 2019-11-21 11:29:45 +00:00
n1073645 7386c145ef Comments for OLE2 extractor. 2019-11-21 11:23:28 +00:00
n1073645 25ca8d85a6 Added extractor for OLE2 and modified the PLIST one. 2019-11-21 11:14:56 +00:00
n1073645 c60ed2c403 Linting on regex operation 2019-11-21 09:56:52 +00:00
n1073645 7d41d4d030 Replaced the .replaces in regex operation 2019-11-21 09:11:12 +00:00
n1073645 6d77fe6eb3 Combined two rules into one case insensitive rule 2019-11-20 09:28:34 +00:00
n1073645 40d3c8b071 ToCaseInsensitiveRegex improvements 2019-11-18 13:31:19 +00:00
n1073645 02ec4a3bfd ToCaseInsensitiveRegex improvements 2019-11-18 13:21:05 +00:00
n1073645 7a4ebbf47e Tidied up ExtractTAR 2019-11-18 08:42:46 +00:00
n1073645 2e7ce477d7 Tidied up ExtractTAR 2019-11-18 08:40:57 +00:00
n1073645 c1a22ef639 Made TAR extractor and MACHO signature more robust 2019-11-15 16:01:33 +00:00
n1073645 0a7b78b7ee Made TAR extractor and MACHO signature more robust 2019-11-15 15:46:13 +00:00
n1073645 e1cb62848c Made TAR extractor and MACHO signature more robust 2019-11-15 15:35:37 +00:00
n1073645 acf5c733c2 Tidied up local and global variables for Mach-o 2019-11-15 09:26:49 +00:00
n1073645 7c25e29515 Rectified magic bytes for MACHO extractor 2019-11-15 09:21:46 +00:00
n1073645 7c72871c02 Added Tar and Mach-O extractors 2019-11-14 17:17:25 +00:00
n1474335 ddb77c6ab3 Merge branch 'n1073645-master' 2019-11-14 16:09:38 +00:00
n1073645 8502fd246d Linting changes 2019-11-14 14:52:40 +00:00
n1073645 30c6917914 Merge remote-tracking branch 'upstream/master' 2019-11-14 09:03:06 +00:00
n1073645 33464b3388 Linting changes 2019-11-14 08:55:27 +00:00
n1474335 2205637ad6 9.11.5 2019-11-13 18:06:39 +00:00
n1474335 149198ef1c Merge branch 'janisozaur-node12filenames' 2019-11-13 18:06:20 +00:00
n1474335 2c40353180 Merge branch 'node12filenames' of https://github.com/janisozaur/CyberChef into janisozaur-node12filenames 2019-11-13 18:05:55 +00:00
n1474335 a62a6c2aa4 9.11.4 2019-11-13 18:05:31 +00:00
n1474335 4be06f6779 Merge branch 'n1073645-master' 2019-11-13 18:04:51 +00:00
n1474335 03f4740968 Tidied up consumeWhile and consumeUntil 2019-11-13 18:04:36 +00:00
n1474335 ea6d80edfb Merge branch 'master' of https://github.com/n1073645/CyberChef into n1073645-master 2019-11-13 17:59:51 +00:00
n1474335 68e8a221ff 9.11.3 2019-11-13 17:59:22 +00:00
n1474335 cce84c3782 Fixed bug in Base62 operations when using different alphabets 2019-11-13 17:59:16 +00:00
n1073645 c1878ca28b Linting adjustments 2019-11-13 17:15:54 +00:00
n1073645 e9b7a43b9a Adjustment to consumeWhile 2019-11-13 17:11:04 +00:00
n1073645 3921b4f445 Small correction to continueWhile 2019-11-13 09:59:55 +00:00
n1073645 dfd4cca43f Corrections 2019-11-13 09:02:36 +00:00
Michał Janiszewski 69c6c3e790 Add missing filenames for Node 12 imports 2019-11-12 23:43:16 +01:00
n1073645 4541d75f49 Improved continueUntil, added consumeWhile and made the EVTX extractor more complete 2019-11-12 13:17:04 +00:00
n1073645 9eda670026 up-to-date 2019-11-12 11:06:10 +00:00
n1073645 d3c13b118d Improved continueUntil, added consumeWhile and made the EVTX extractor more complete 2019-11-12 11:00:43 +00:00
n1073645 8e2345cf9e Improved continueUntil, added consumeWhile and made the EVTX extractor more complete 2019-11-11 16:08:03 +00:00
n1073645 d240d65c5f Improved continueUntil, added consumeWhile and made the EVTX extractor more complete 2019-11-11 15:47:16 +00:00
n1474335 d3473a7462 9.11.2 2019-11-08 17:35:38 +00:00
n1474335 6bfe4ee238 Merge branch 'n1073645-master' 2019-11-08 17:34:39 +00:00
n1474335 e61b7d598e Tidied up FileSignatures.mjs 2019-11-08 17:34:25 +00:00
n1073645 eb81b9217e SQLITE, EVT, EVTX and Signatures added 2019-11-08 17:08:14 +00:00
n1073645 4d9bfcad20 Comment the WAV extractor. 2019-11-08 15:00:20 +00:00
n1073645 2387452a56 Comment the WAV extractor. 2019-11-08 14:59:06 +00:00
n1073645 a4772941a7 Added WAV extractor. 2019-11-08 14:56:54 +00:00
n1474335 6318f78e29 9.11.1 2019-11-08 13:50:00 +00:00
n1474335 5e6f3cc5b4 Merge branch 'n1073645-master' 2019-11-08 13:49:51 +00:00
n1474335 04f1fa06ad Tidied up GIF and BZIP2 extractors 2019-11-08 13:49:39 +00:00
n1474335 8d660e53b2 Merge branch 'master' of https://github.com/n1073645/CyberChef into n1073645-master 2019-11-08 13:43:54 +00:00
n1073645 f3864b00fe Made GIF extractor more robust 2019-11-08 13:40:09 +00:00
n1073645 51cc94bf2a Made GIF extractor more robust 2019-11-08 13:38:17 +00:00
n1073645 f63d1354ba Merge pull request #878 from n1073645/master
Added extractors for BZIP2, XZ, GIF89
2019-11-08 11:56:26 +00:00
n1073645 80362cfa84 Bzip2 extractor completed 2019-11-08 11:39:50 +00:00
n1073645 447a6d7524 Comments for GIF. 2019-11-07 16:50:10 +00:00
n1073645 f022440b4a Tidied GIFextractor 2019-11-07 16:20:09 +00:00
n1073645 4f5e0c007d GIF extractor for GIF89a 2019-11-07 15:06:30 +00:00
n1073645 b83f6591bb XZ compression 2019-11-07 10:13:40 +00:00
n1073645 77a9481cf9 xz compression 2019-11-07 09:20:24 +00:00
n1474335 a8f029309d 9.11.0 2019-11-06 13:38:32 +00:00
n1474335 b0df8b7dca Updated CHANGELOG 2019-11-06 13:37:31 +00:00
n1474335 2cc05717e6 Merge branch 'cbeuw-blowfish-fix' 2019-11-06 13:34:31 +00:00
n1474335 b96394131f Tidied up Blowfish tests 2019-11-06 13:34:17 +00:00
n1474335 875c1019b2 Merge branch 'blowfish-fix' of https://github.com/cbeuw/CyberChef into cbeuw-blowfish-fix 2019-11-06 13:22:50 +00:00
n1474335 d1a0a39efa Merge branch 'dkarpo-master' 2019-11-06 13:21:42 +00:00
n1474335 fdfbf7ddf8 Merge branch 'master' of https://github.com/dkarpo/CyberChef into dkarpo-master 2019-11-06 13:20:41 +00:00
n1474335 414f8b5ba9 Added link to Lorenz wiki article in operation description 2019-11-06 13:17:44 +00:00
Derrick Karpo 03a1c566fc Add file extensions which are mandatory for the latest Node 12.x.
Note: This doesn't solve the upstream import's which still don't
comply but it preps CyberChef for it.
2019-11-06 06:01:52 -07:00
n1474335 0fc1c37e65 9.10.0 2019-11-06 12:17:41 +00:00
n1474335 6b4efb420e Updated CHANGELOG 2019-11-06 12:16:35 +00:00
n1474335 9ed2b26933 Tidied up Lorenz operation and created new Bletchley module for WW2-era ciphers 2019-11-06 12:14:22 +00:00
n1474335 70665534b8 Merge branch 'master' of https://github.com/VirtualColossus/CyberChef 2019-11-06 12:00:37 +00:00
n1474335 7244d4d343 9.9.0 2019-11-01 14:57:46 +00:00
n1474335 980c1e8681 Updated CHANGELOG 2019-11-01 14:57:41 +00:00
n1474335 e1378860d6 Added support for 109 more character encodings 2019-11-01 14:56:18 +00:00
Jarrod Connolly 462f619f43 Update JavaScript Minify operation to support ES6. 2019-10-31 23:18:54 -07:00
VirtualColossus b9571db9f1 Merge branch 'master' into master 2019-10-31 15:33:54 +00:00
n1474335 734962ac22 9.8.0 2019-10-31 14:21:03 +00:00
n1474335 35103bf155 Updated CHANGELOG 2019-10-31 14:20:55 +00:00
n1474335 4c4d7b5d26 Merge branch 'jarrodconnolly-avro-to-json' 2019-10-31 14:17:55 +00:00
n1474335 daad633195 Tidied up Avro to JSON operation 2019-10-31 14:17:07 +00:00
VirtualColossus d5cfe9f262 removed duplicate test 2019-10-31 13:54:52 +00:00
n1474335 a2c46b3f66 Merge branch 'avro-to-json' of https://github.com/jarrodconnolly/CyberChef into jarrodconnolly-avro-to-json 2019-10-31 13:54:00 +00:00
n1474335 6a1d11b9b5 Argument hints are not tooltips instead of bmd-help elements 2019-10-31 13:39:06 +00:00
n1474335 0630c094e0 9.7.20 2019-10-31 13:00:22 +00:00
n1474335 ace71f20b3 Merge branch 'gsilvapt-master' 2019-10-31 13:00:15 +00:00
VirtualColossus c0e02451a1 Fixed bug using KT option, added tests 2019-10-31 07:28:33 +00:00
Jarrod Connolly 2d12a16771 Add Avro to JSON data format conversion 2019-10-30 22:09:42 -07:00
Gustavo Silva 9108b3923b diff.mjs: Fixes tests and adds default flag
* Sets default flag to `false` for `showSubtraction` flag.
    * Removes extra span for else case that was causing some tests to
    fail. Moreover, the previous behavior was defined as that.
    * Adds custom test for the showSubtraction option, both using the
    `showAdded` and `showRemoved` flags.
2019-10-29 23:39:14 +00:00
Gustavo Silva 726e117656 diff.mjs: Allows showing subtraction
Adds "Show Subtraction" button to allow seeing only the difference
    between two texts.
    When selected and combined, user can see only the characters or
    words that were added. If not combined, with either removed or added
    but selected, then nothing is displayed.
2019-10-29 23:12:24 +00:00
VirtualColossus ab524fff15 Mixed tabs & spaces 2019-10-29 21:52:18 +00:00
VirtualColossus 55eae9910f Tidied run function, added some tests 2019-10-29 21:39:29 +00:00
VirtualColossus d3138a7fdf Merge remote-tracking branch 'upstream/master' 2019-10-28 22:23:28 +00:00
n1474335 05e65a74ce Improved Magic scoring slightly 2019-10-28 17:26:13 +00:00
n1474335 6d138f345f 9.7.19 2019-10-27 15:27:36 +00:00
n1474335 3c165dd7e8 Merge branch 'mattnotmitt-chores/yara-update' 2019-10-27 15:27:12 +00:00
n1474335 04561d29b5 Dependency update 2019-10-27 15:26:48 +00:00
n1474335 e5e6c1a2dd Merge branch 'chores/yara-update' of https://github.com/mattnotmitt/CyberChef into mattnotmitt-chores/yara-update 2019-10-27 15:23:47 +00:00
n1474335 882efea314 Updated README 2019-10-27 15:21:41 +00:00
n1474335 89d979d92e Merge branch 'rianadon-theme-by-url' 2019-10-27 15:17:33 +00:00
n1474335 383aab5f85 Improved theme selection. Added changeTheme method. 2019-10-27 15:17:06 +00:00
n1474335 6659174f88 Merge branch 'theme-by-url' of https://github.com/rianadon/CyberChef into rianadon-theme-by-url 2019-10-27 14:43:59 +00:00
n1474335 3ca29b8744 Merge branch 'brian-digital-labs-autofocus-search' 2019-10-27 14:39:05 +00:00
n1474335 726bf3345e Added tabindex to ingredients 2019-10-27 14:38:55 +00:00
n1474335 b2d61482d5 Merge branch 'autofocus-search' of https://github.com/brian-digital-labs/CyberChef into brian-digital-labs-autofocus-search 2019-10-27 14:17:06 +00:00
n1474335 88d8e9a7f9 9.7.18 2019-10-27 14:13:37 +00:00
n1474335 0b0ddd3140 Merge branch 'mattnotmitt-chores/nightwatch-update' 2019-10-27 14:12:22 +00:00
Matt 3d4f74945c Update nightwatch and chromedriver
Rebase onto master
2019-10-26 16:59:41 +01:00
Matt 4387038351 Update libyara-wasm 2019-10-26 16:14:25 +01:00
Brian Hoang 49f444dfe9 auto focus on search bar and made searchbar and text area tab-able 2019-10-26 15:30:27 +01:00
Ryan Adolf 061533bb57 Document theme option in README 2019-10-24 16:37:10 -07:00
Ryan Adolf 6e2fb67d76 Theme configuration through url 2019-10-24 16:32:14 -07:00
n1474335 60f5093c6c Update .travis.yml 2019-10-21 13:56:52 +01:00
n1474335 665f91ec37 Update README.md 2019-10-21 13:49:42 +01:00
n1474335 0805a011b9 9.7.17 2019-10-18 13:57:26 +01:00
n1474335 3e3322e1f0 Fork no longer appends its merge delimiter to the end of the output. Closes #692 2019-10-18 13:57:21 +01:00
Matt 252b1b65c4 Add YARA rules node test 2019-10-18 12:58:17 +01:00
Matt e8b4536ec2 Updated yara to v3.11.0 and openssl to v1.1.1d
finally managed to fudge the compiler
2019-10-18 12:57:13 +01:00
n1474335 61d40b5a0b 9.7.16 2019-10-18 11:11:17 +01:00
n1474335 d175aa958c DES no longer requires an IV in ECB mode 2019-10-18 11:09:12 +01:00
n1474335 ac3c220789 9.7.15 2019-10-16 17:36:25 +01:00
n1474335 add65e121a Merge branch 'Storms-Engineering-master' 2019-10-16 17:36:02 +01:00
n1474335 de2e757691 Merge branch 'master' of https://github.com/Storms-Engineering/CyberChef into Storms-Engineering-master 2019-10-16 17:34:58 +01:00
n1474335 eb34ab4f6a 9.7.14 2019-10-16 17:23:59 +01:00
n1474335 08e4232166 Merge branch 'wh0-backslash' 2019-10-16 17:23:47 +01:00
n1474335 adf9772928 Added tests for Utils.parseEscapedChars 2019-10-16 17:22:48 +01:00
n1474335 562171ec86 Merge branch 'backslash' of https://github.com/wh0/CyberChef into wh0-backslash 2019-10-16 16:47:01 +01:00
n1474335 e9e162319f Merge branch 'BjoernAkAManf-master' 2019-10-16 16:32:20 +01:00
n1474335 17c9ffe107 Tidied up chainCommands function in Gruntfile 2019-10-16 16:32:06 +01:00
n1474335 1831c84a29 Merge branch 'master' of https://github.com/BjoernAkAManf/CyberChef into BjoernAkAManf-master 2019-10-16 16:23:09 +01:00
n1474335 7e27449204 Fixed search box appaerance in Firefox 2019-10-16 16:12:22 +01:00
n1474335 282476d530 Merge branch 'Xenonym-chore/remove-duplicate-issue-template' 2019-10-16 16:04:49 +01:00
n1474335 fce0728d5d Updated bug report template 2019-10-16 16:04:36 +01:00
n1474335 0e9ac90607 Merge branch 'chore/remove-duplicate-issue-template' of https://github.com/Xenonym/CyberChef into Xenonym-chore/remove-duplicate-issue-template 2019-10-16 15:59:59 +01:00
n1474335 5383f56b26 9.7.13 2019-10-16 15:51:06 +01:00
n1474335 a02484c6cd Merge branch 'Storms-Engineering-IV-length-Error' 2019-10-16 15:50:51 +01:00
n1474335 be365f66ef Added length check to Triple DES IVs 2019-10-16 15:50:37 +01:00
n1474335 011dc09d5e Merge branch 'IV-length-Error' of https://github.com/Storms-Engineering/CyberChef into Storms-Engineering-IV-length-Error 2019-10-16 15:43:47 +01:00
n1474335 fc4d6d2d2e 9.7.12 2019-10-16 15:39:56 +01:00
n1474335 9d73127cae Fixed some typos 2019-10-16 15:38:20 +01:00
n1474335 223743e3b5 Removed Clippy 2019-10-16 15:37:18 +01:00
n1474335 44ed372f21 9.7.11 2019-10-16 15:10:16 +01:00
n1474335 4d1f970105 Added test to ensure all operations are in a category. Added various operations to categories. 2019-10-16 15:10:03 +01:00
n1474335 b28a891a40 9.7.10 2019-10-15 16:26:01 +01:00
n1474335 834ff95702 Base64 operations now throw a meaningful error if the alphabet is the wrong length 2019-10-15 16:25:52 +01:00
Storms-Engineering 3e93580aa4 DES Encrypt/Decrypt - checks length of IV string
Checks the length of IV string when encrypting.  DES encrypt/decrypt test swas updated to use utf8 instead of HEX.
2019-10-12 09:42:13 -08:00
Thomas Pointhuber ef61735f64 Fix typo 2019-10-12 17:52:16 +02:00
Thomas Pointhuber a2780ca056 Add bitwse mode to Generate Image operation 2019-10-12 17:35:46 +02:00
Thomas Pointhuber d025c8bd9a Add new operation to generate image from raw data 2019-10-12 17:13:14 +02:00
Storms-Engineering 7a3ca027bb PHP Deserialize NULL values converted to correctly
PHP Deserialize now correctly returns N as a null instead of an empty object
2019-10-12 05:56:10 -08:00
Tan Zhen Yong 3c021919dd Rename feature request issue template
- to remain consistent with other issue templates using a `-` instead of `_`
2019-10-12 16:17:40 +08:00
Tan Zhen Yong 2106e8ddb0 Remove duplicate bug report issue template
The bug report issue template is duplicated (`bug-report.md` and
`bug_report.md`, note the `-`/`_` difference).

Thus, GitHub was unable to use the bug report issue template, and it
does not show up when a new issue is being created.

Let's remove the duplicate template `bug_report.md`.
2019-10-12 16:13:40 +08:00
Marvin Wendt acf38e47ba Add ConvertToNATOAlphabet tests 2019-10-11 15:32:14 +02:00
Marvin Wendt 4122d4207d Add ConvertToNATOAlphabet 2019-10-11 15:32:06 +02:00
Marvin Wendt d550ae7d93 Add operation to categories 2019-10-11 15:31:46 +02:00
Marvin Wendt 815a542cc1 package-lock automaitcally updated on install 2019-10-11 15:31:25 +02:00
n1474335 3472484601 Merge branch 'd98762625-fix-node-tests' 2019-10-09 16:19:39 +01:00
n1474335 826a8c8a74 Merge branch 'fix-node-tests' of https://github.com/d98762625/CyberChef into d98762625-fix-node-tests 2019-10-09 16:18:54 +01:00
n1474335 c66703f0ca 9.7.9 2019-10-09 16:14:47 +01:00
n1474335 874e7d8d54 Merge branch 'expose-operationerror' 2019-10-09 16:14:38 +01:00
n1474335 4e2b85b8c8 Merge branch 'master' into expose-operationerror 2019-10-09 16:14:03 +01:00
n1474335 5314a456cb 9.7.8 2019-10-09 16:12:46 +01:00
n1474335 ba2a5b195c Improved PE extractor to also carve the overlay if possible 2019-10-09 16:12:41 +01:00
d98762625 f8115671ee fix linting tests 2019-10-07 18:05:28 +01:00
d98762625 494279edd8 update gitignore 2019-10-07 18:01:35 +01:00
d98762625 bd6673afed Merge branch 'master' of github.com:gchq/CyberChef into expose-operationerror 2019-10-07 17:59:00 +01:00
d98762625 210daf7324 make async node tests actually fail when they fail. Update tests that were failing 2019-10-07 17:41:51 +01:00
wh0 d60d595254 Utils: don't consume three backslashes at a time 2019-10-06 17:07:58 -07:00
n1474335 06708949a1 9.7.7 2019-10-04 17:52:15 +01:00
n1474335 da901e20d9 Added several more file signatures. The background magic button now highlights when a file type has been detected. 2019-10-04 17:52:09 +01:00
Björn Heinrichs c28999ec6f Fixed building on Windows
On Windows OperationConfig was not generated.
See #360 #645 for more Information.
2019-10-03 02:23:18 +02:00
Andy Wang 9872578d51 Add reference Python script 2019-10-01 23:20:27 +01:00
Andy Wang 3014696fcd Adapt API tests to comply with length requirements 2019-10-01 23:10:54 +01:00
Andy Wang 6b70f77dcd Add tests 2019-10-01 23:08:32 +01:00
Andy Wang 7f6d8bffe3 Remove unnecessary IV adaptation 2019-10-01 22:54:21 +01:00
Andy Wang 458307f5ed Add invalid key length error message 2019-10-01 22:53:50 +01:00
Andy Wang 294aa826f1 Remove base64 options 2019-10-01 22:53:10 +01:00
n1474335 6810f38808 9.7.6 2019-10-01 17:11:36 +01:00
n1474335 087cc6b8fd Fixed webm signature 2019-10-01 17:11:31 +01:00
n1474335 10c8101476 9.7.5 2019-10-01 16:54:26 +01:00
n1474335 22028b074a Added support for many more file types to file signature operations 2019-10-01 16:54:19 +01:00
n1474335 3d086beed2 9.7.4 2019-10-01 12:15:07 +01:00
n1474335 777d814e70 Updated package-lock.json 2019-10-01 12:14:57 +01:00
n1474335 15c26a95c5 Merge branch 'master' into edit-node-recipe 2019-10-01 12:12:49 +01:00
n1474335 f87d3bd1cb 9.7.3 2019-10-01 12:10:43 +01:00
n1474335 b9ea1e8c71 Merge branch 'forge-update' of https://github.com/cbeuw/CyberChef into cbeuw-forge-update 2019-10-01 10:56:30 +01:00
Matt 123a0ccd70 Changed pages workflow 2019-09-30 14:41:14 +01:00
Matt 4c737475d4 Forgot to run prod build 2019-09-30 14:08:23 +01:00
Matt 4e0d97f2c1 Added sudo 2019-09-30 14:02:22 +01:00
Matt 85906cafbb Adjustment 2019-09-30 13:56:26 +01:00
Matt a8dc691033 Try using github actions
Gonna monch this commit once i know it works
2019-09-30 13:51:38 +01:00
Matt 4d7988b78e Fixed RSA key generation 2019-09-30 13:12:10 +01:00
Matt 841e760b04 Merge remote-tracking branch 'upstream/master' into features/rsa 2019-09-30 11:03:41 +01:00
n1474335 db232f4ff2 9.7.2 2019-09-27 11:29:01 +01:00
n1474335 70f705afbc Fixed typo in 'Convert Data Units' preventing Kilobits from working. Closes #649 2019-09-27 11:28:57 +01:00
Andy Wang 912d63067c Fix #578 by refactoring and implementing the modes 2019-09-26 23:02:03 +01:00
Andy Wang 880df212d5 Correct wrong DES and 3DES tests 2019-09-26 22:00:13 +01:00
Andy Wang b06acd99ec Adapt AES "no IV" tests 2019-09-26 21:52:34 +01:00
Andy Wang a59de80d18 Update node API tests 2019-09-26 21:41:35 +01:00
Andy Wang 1e8dee9935 update node-forge version 2019-09-26 21:32:08 +01:00
n1474335 928f1c3e4b Remove excess slashes from Tesseract paths 2019-09-25 15:39:04 +01:00
d98762625 014e70a7b1 add node index to source 2019-09-20 18:44:13 +01:00
d98762625 5148b16246 Export cyberchef error types to be used in consuming applications 2019-09-20 18:40:21 +01:00
n1474335 b4ae4c5a00 9.7.1 2019-09-13 17:40:26 +01:00
n1474335 70346bce35 OCR operation now relies on local files 2019-09-13 17:40:20 +01:00
n1474335 3539e065fa 9.7.0 2019-09-13 14:36:00 +01:00
n1474335 8ffc58b340 Updated CHANGELOG 2019-09-13 14:35:54 +01:00
n1474335 503e733c81 Merge branch 'MShwed-feature/ocr' 2019-09-13 14:34:22 +01:00
n1474335 7eabaf0de6 Cleaned up and improved OCR operation 2019-09-13 14:34:08 +01:00
n1474335 a8ad10757c Merge branch 'feature/ocr' of https://github.com/MShwed/CyberChef into MShwed-feature/ocr 2019-09-13 12:41:38 +01:00
d98762625 111546ad1a update function comments 2019-09-06 12:26:24 +01:00
d98762625 a8fbd5164e Update NodeRecipe so args is optional in bake config 2019-09-06 12:21:53 +01:00
mshwed 8dde732514 Fixed linting issues 2019-09-05 09:20:59 -04:00
mshwed f1659af5e4 Added basic OCR text extraction 2019-09-04 14:37:02 -04:00
n1474335 e68fb51f44 Merge branch 'master' of github.com:gchq/CyberChef 2019-09-04 17:17:17 +01:00
n1474335 95453131c8 9.6.0 2019-09-04 17:16:54 +01:00
n1474335 c60d5c8e85 Updated CHANGELOG 2019-09-04 17:16:47 +01:00
n1474335 b31f32a7e7 Tidied up Bacon Cipher operations 2019-09-04 17:13:05 +01:00
n1474335 f0b3bd0ede Merge branch 'bacon' of https://github.com/kassi/CyberChef 2019-09-04 16:30:05 +01:00
n1474335 de5243ec67 Update issue templates 2019-09-04 14:51:57 +01:00
n1474335 c6de3eb2ae 9.5.0 2019-09-04 14:00:29 +01:00
n1474335 d7b6f29c81 Updated CHANGELOG 2019-09-04 14:00:25 +01:00
n1474335 5bebd71a44 Merge branch 'Ge0rg3-steganography' 2019-09-04 13:55:17 +01:00
n1474335 eb769c7fb4 Tidied up Steganography operations. FileType and toBase64 functions now accept ArrayBuffers. 2019-09-04 13:54:59 +01:00
n1474335 5bc5c0df90 Merge branch 'steganography' of https://github.com/Ge0rg3/CyberChef into Ge0rg3-steganography 2019-09-04 11:31:58 +01:00
n1474335 cfc3684a16 Merge branch 'wesinator-patch-1' 2019-09-04 11:17:13 +01:00
n1474335 0590020130 Merge branch 'patch-1' of https://github.com/wesinator/CyberChef into wesinator-patch-1 2019-09-04 11:16:57 +01:00
n1474335 2a91af152d Fixed sitemap generation 2019-09-04 11:14:45 +01:00
Ԝеѕ d8120d4e13 Add Quoted-printable example 2019-09-03 11:21:58 -04:00
n1474335 0ac211ce77 9.4.1 2019-08-30 18:49:11 +01:00
n1474335 32c0d6f253 Updated dependencies 2019-08-30 18:49:05 +01:00
n1474335 de762847e9 9.4.0 2019-08-30 15:48:47 +01:00
n1474335 6248e32148 Updated CHANGELOG 2019-08-30 15:47:50 +01:00
n1474335 52f88ee32d Merge branch 'j433866-render-markdown' 2019-08-30 15:46:37 +01:00
n1474335 f8d1cf2f60 Tidied up 'Render Markdown' operation 2019-08-30 15:46:24 +01:00
n1474335 e129425d8d Merge branch 'render-markdown' of https://github.com/j433866/CyberChef into j433866-render-markdown 2019-08-30 15:33:47 +01:00
n1474335 ae20d82e1d Fix Nightwatch test 2019-08-30 15:30:30 +01:00
n1474335 463b2ce040 9.3.0 2019-08-30 11:58:37 +01:00
n1474335 412b47abba Updated CHANGELOG 2019-08-30 11:58:32 +01:00
n1474335 ed216eee73 Merge branch 'j433866-show-on-map' 2019-08-30 11:57:00 +01:00
n1474335 9dd5234962 Tidied up 'Show on map' operation 2019-08-30 11:56:48 +01:00
n1474335 018532016b Merge branch 'show-on-map' of https://github.com/j433866/CyberChef into j433866-show-on-map 2019-08-30 11:44:12 +01:00
n1474335 7dfecc38f6 Added more UI tests to ensure all modules load, categories can be viewed, and operations can be dragged 2019-08-30 11:43:30 +01:00
Ge0rg3 aa5afadcce Tests for Randomize Colour Palette Op 2019-08-29 16:24:21 +01:00
Ge0rg3 d23a584b9e Randomize Colour Palette Operation 2019-08-29 16:17:07 +01:00
n1474335 572f035877 Background magic is now debounced to prevent it firing too often. 2019-08-29 14:08:56 +01:00
j433866 b94eb6adb0 Add syntax highlighting
Explicitly disable HTML rendering.
Updated description.
2019-08-29 14:08:07 +01:00
j433866 45fccb94e1 Merge remote-tracking branch 'upstream/master' into render-markdown 2019-08-29 13:23:37 +01:00
j433866 2628f17fae Change maps source to use Wikimedia maps.
Add link to Wikimedia maps ToS.
If there's no data, show the map anyway.
2019-08-29 11:43:45 +01:00
j433866 69fb6e77fc Merge remote-tracking branch 'upstream/master' into show-on-map 2019-08-29 10:42:40 +01:00
j433866 6992858e67 9.2.3 2019-08-29 10:23:41 +01:00
j433866 59917cca45 Add overflow CSS rule to fix scrolling. Fixes #626 2019-08-29 10:18:52 +01:00
n1474335 2f0b959aa4 Fixed copy:ghPages docs error 2019-08-28 18:48:31 +01:00
n1474335 4f2749e0dc 9.2.2 2019-08-28 17:14:20 +01:00
n1474335 c9deaae744 Updated supported browser versions. 2019-08-28 17:14:12 +01:00
Ge0rg3 950a12360e Tests + Bug Fixes
* Test cases for LSB extraction, RGBA extraction and bit plane browsing
* Bug fix for alpha planes in bit plane browser
2019-08-28 17:07:43 +01:00
n1474335 686ca284fe Removed JSDoc generation as it is never really used. JSDoc comments are still required but the doc files will no longer be generated. This simplifies the build process and config scripts. 2019-08-28 16:37:31 +01:00
n1474335 b21643f485 Merge branch 'master' of github.com:gchq/CyberChef 2019-08-28 16:14:49 +01:00
n1474335 4c28627459 Added pulse to Background Magic button to draw attention. 2019-08-28 16:14:13 +01:00
n1474335 6a6fe0f56d Update CONTRIBUTING.md 2019-08-28 15:47:33 +01:00
Ge0rg3 48831225ac Extract RGBA Values Operation 2019-08-28 09:58:00 +01:00
Ge0rg3 4e8a79d8f1 Bit Plane Browser and LSB Extraction
Bit Plane Browser and LSB Extraction

Bit Plane Browser and LSB Extraction
2019-08-28 01:06:59 +01:00
n1474335 570a4c7fca Update CHANGELOG.md 2019-08-27 18:30:33 +01:00
n1474335 094d352e5f Added eslint space-before-blocks rule 2019-08-27 18:13:33 +01:00
n1474335 44b90be7d6 Added 'fully qualified' to the description for the 'Extract Domains' operation to reduce ambiguity. #618 2019-08-27 17:59:45 +01:00
n1474335 e7980a8886 9.2.1 2019-08-27 13:02:24 +01:00
n1474335 1c9c0a48be Merge branch 'csmith-ip-format-octal' 2019-08-27 13:02:18 +01:00
n1474335 c541eebe3e Merge branch 'ip-format-octal' of https://github.com/csmith/CyberChef into csmith-ip-format-octal 2019-08-27 13:00:54 +01:00
n1474335 c51e6efe74 Merge branch 'chrishepner-scanembedded-typo' 2019-08-27 12:57:20 +01:00
Chris Smith 6c9ce15b26 Add octal support to Change IP Format.
Also add test cases covering interchanging between all four
formats.
2019-08-24 01:14:44 +01:00
Chris Hepner 8e1bd36b4c Fix typo in ScanForEmbeddedFiles
Change "suffiently" to "sufficiently"
2019-08-23 14:52:16 -07:00
n1474335 d3e3e6e6fc 9.2.0 2019-08-23 11:22:03 +01:00
n1474335 f1794a2dfe Updated CHANGELOG 2019-08-23 11:22:00 +01:00
n1474335 1efccff730 Merge branch 'h345983745-udp-header-parser' 2019-08-23 10:56:25 +01:00
n1474335 0031345383 Tidied up 'Parse UDP' operation 2019-08-23 10:56:13 +01:00
n1474335 46fa7475cf Merge branch 'udp-header-parser' of https://github.com/h345983745/CyberChef into h345983745-udp-header-parser 2019-08-23 10:40:24 +01:00
n1474335 afc7c40975 Create SECURITY.md 2019-08-22 17:38:56 +01:00
n1474335 dc99797f7b 9.1.0 2019-08-22 16:51:50 +01:00
n1474335 4624266a5c Updated CHANGELOG 2019-08-22 16:50:43 +01:00
n1474335 05bfd99318 9.0.10 2019-08-22 16:35:20 +01:00
n1474335 db3faf16b0 Merge branch 'master' of github.com:gchq/CyberChef 2019-08-22 16:34:00 +01:00
n1474335 9fc451ece8 9.0.9 2019-08-22 16:31:59 +01:00
n1474335 9e1079027b Merge branch 'j433866-carriage-returns' 2019-08-22 16:31:41 +01:00
n1474335 9774a4bd26 Tidied up CR preservation code 2019-08-22 16:31:21 +01:00
j433866 ce9e864757 9.0.9 2019-08-22 14:58:20 +01:00
j433866 737ea19c9e Fix AES decryption in GCM mode not using IVs.
Updated tests to match new results.
Included a Python script to generate AES-GCM tests
2019-08-22 14:54:58 +01:00
j433866 82b5e97a2b Merge branch 'master' into render-markdown 2019-08-22 12:31:52 +01:00
j433866 c43f829854 Slightly change wording of alerts 2019-08-22 11:56:14 +01:00
j433866 f43a868607 Add carriage return detection for pasted and switched inputs.
Fix switching the output to input not working properly.
Add nicer confirmation boxes for zipping outputs.
2019-08-22 11:53:41 +01:00
j433866 9f2d1453ed Make the wordWrap change event only fire when the
word wrap checkbox is changed
2019-08-22 11:26:43 +01:00
j433866 082d939f7d Add customisations for confirm box.
Can change the text of the accept and reject buttons.
Now returns undefined if the user clicks off it
2019-08-22 11:26:04 +01:00
j433866 8d628cf0ed Merge remote-tracking branch 'upstream/master' 2019-08-22 11:20:40 +01:00
j433866 19553dcfed Fix parse colour code operation.
The interactive part broke due to changes for multiple inputs.
Now fires the inputChange event with a fake keyup event to autobake
2019-08-22 11:00:04 +01:00
n1474335 a7938526aa 9.0.8 2019-08-21 14:28:04 +01:00
n1474335 863551ee1d AES Decrypt now handles blank IVs correctly. Fixes #613 2019-08-21 14:27:56 +01:00
n1474335 772c6bbba5 Tidied up test runner. Passing tests are no longer printed to the console. 2019-08-20 17:13:05 +01:00
n1474335 148dcbb0c5 9.0.7 2019-08-20 15:21:18 +01:00
n1474335 82abdb50b1 Fixed bug in Protobuf library causing issues with long keys 2019-08-20 15:20:43 +01:00
h345983745 b8dbb11136 Spelling 2019-08-19 21:05:38 +01:00
h345983745 b14cb99587 Removed console.log 2019-08-19 20:55:04 +01:00
h345983745 1d32a5939c Core UDP parsing functionality
Added to categorie

Description

Added Tests

Added tests
2019-08-19 20:48:05 +01:00
j433866 ae1cd8ba3e Add fade animation to modals 2019-08-15 15:03:13 +01:00
j433866 1fb6bffe1c 9.0.6 2019-08-13 16:46:17 +01:00
j433866 59864e3781 Fix Defang IP tests causing the tests to fail 2019-08-13 16:45:53 +01:00
j433866 e2c7d8c678 Increase size limit for inlined fonts / icons 2019-08-13 16:03:52 +01:00
j433866 62f82c5d12 Merge branch 'inline-fonts' 2019-08-13 15:39:33 +01:00
n1474335 ec70d8a3a2 Updated CHANGELOG 2019-08-13 14:25:36 +01:00
n1474335 1b4471a946 Merge branch 'h345983745-defang-ip' 2019-08-13 14:23:54 +01:00
n1474335 43472394c7 Tidied up 'Defang IP Addresses' operation 2019-08-13 14:23:41 +01:00
n1474335 a4e9025b8e Merge branch 'defang-ip' of https://github.com/h345983745/CyberChef into h345983745-defang-ip 2019-08-13 14:19:34 +01:00
n1474335 6b9e93e310 Updated CHANGELOG 2019-08-13 14:13:59 +01:00
n1474335 06b385563c Merge branch 'j433866-ssh-host-key' 2019-08-13 14:12:04 +01:00
n1474335 d90a23bfd5 Added 'Parse SSH Host Key' operation to the Networking category 2019-08-13 14:11:52 +01:00
j433866 91cdd50ba7 Increase size limit for inlined fonts / icons 2019-08-13 14:03:21 +01:00
j433866 4bc4db8232 Fix incorrect import of TestRegister 2019-08-13 13:39:21 +01:00
j433866 863675e636 Update nodeApi test.
'base 64' now returns 11 results as the SSH host key module mentions it
2019-08-13 13:37:21 +01:00
j433866 1cdcaebb4d Merge remote-tracking branch 'upstream/master' into ssh-host-key
Bring up to date with master
2019-08-13 13:26:40 +01:00
n1474335 cdb30d86b0 9.0.5 2019-08-12 15:27:45 +01:00
n1474335 138e3c4239 Merge branch 'use-std-esm' 2019-08-12 15:27:21 +01:00
n1474335 66b82598e3 Merge branch 'use-std-esm' of github.com:gchq/CyberChef 2019-08-12 15:26:15 +01:00
d98762625 780eecf35b update readme with Node.js compatibility 2019-08-02 14:36:40 +01:00
d98762625 8548d39318 add node consumer tests to travis 2019-08-02 11:10:15 +01:00
n1474335 6f26ff0a89 Merge branch 'master' into use-std-esm 2019-07-31 15:05:04 +01:00
n1474335 2ffd2c6b7a 9.0.4 2019-07-29 17:09:52 +01:00
n1474335 0e95ad8ed6 Updated a range of operations to use ArrayBuffers instead of byteArrays to improve performance with large files. 2019-07-29 17:09:46 +01:00
n1474335 3a8b362dfd 9.0.3 2019-07-29 15:15:34 +01:00
n1474335 82b94fad5d Fixed BigNumber type coercion issues when passed between workers 2019-07-29 15:14:29 +01:00
j433866 42cfed5fa8 Fix file inputs being overwritten with strings.
Added force option in case we really need to overwrite
2019-07-25 15:16:07 +01:00
j433866 e4452b906e Fix functions not being awaited 2019-07-25 15:14:12 +01:00
j433866 36abaeb6fb Fix tab bar shadows appearing when they shouldn't 2019-07-24 14:22:56 +01:00
j433866 507c951f28 9.0.2 2019-07-24 09:12:16 +01:00
j433866 8a67103808 Merge branch 'artemisbot-bug/dark-mode' 2019-07-24 09:10:51 +01:00
Matt b3a10d4f9e Made some better colour choices 2019-07-23 19:17:21 +01:00
Matt d4c4e2599d Reduced redundancy 2019-07-22 23:16:17 +01:00
Matt 67ead1c250 Fixed alternative theme tables 2019-07-22 23:12:36 +01:00
d98762625 e4d98eba6b use std/esm to make chef compatible with cjs projects. Remove webpack work for node 2019-07-19 13:14:32 +01:00
j433866 9c6ceaa58a Add tests 2019-07-15 14:12:40 +01:00
j433866 7f168d49a6 Add render markdown operation 2019-07-12 09:33:13 +01:00
j433866 897dc0fb97 9.0.1 2019-07-10 15:01:53 +01:00
j433866 a08419a4ce Remove getOutput function, use Dish object instead
Fix inputNum error in WorkerWaiter.
Replace explicit tab shadows with class lists
2019-07-10 14:58:07 +01:00
n1474335 710223d7de Updated CHANGELOG 2019-07-09 14:38:10 +01:00
n1474335 4c40c6fa74 9.0.0 2019-07-09 14:34:13 +01:00
n1474335 fe6d86622b Updated CHANGELOG 2019-07-09 14:32:28 +01:00
n1474335 d1ad2d0845 Rejigged grunt tasks. 2019-07-09 14:31:18 +01:00
n1474335 29cb273d08 Fixed module replacement issue. 2019-07-09 13:42:42 +01:00
n1474335 566517d20f Imports now specify the file extension to support Node v12 2019-07-09 12:23:59 +01:00
j433866 ac1c93d29b Fix incorrect curve detection for ecdsa-sha2 2019-07-08 16:58:03 +01:00
j433866 944842d4eb Improve description and add to Categories 2019-07-08 16:44:36 +01:00
j433866 d56ff0825a Add extraction of actual key from public key file 2019-07-08 15:58:56 +01:00
n1474335 d7d50337f9 Fixed node tests and config generation for node v12 2019-07-05 14:47:05 +01:00
d98762625 0de89f3145 Merge branch 'v9' of github.com:gchq/CyberChef into node-lib 2019-07-05 13:10:44 +01:00
n1474335 aa362ba18b Removed async from detectDishType 2019-07-05 12:41:47 +01:00
n1474335 b272d3b32f Linted to satisfy new rules 2019-07-05 12:36:15 +01:00
n1474335 e4e32a9c56 Merge branch 'master' into v9 2019-07-05 12:30:28 +01:00
n1474335 4bae718f40 8.38.2 2019-07-05 12:23:02 +01:00
n1474335 5eb3979504 Updated dependencies and linter 2019-07-05 12:22:52 +01:00
d98762625 e03ff22ba8 update more ENVIRONMENT_IS_* calls after merge, update some test paths, comments. Remove vulnerability 2019-07-05 11:35:59 +01:00
d98762625 368f508b17 Merge branch 'v9' of github.com:gchq/CyberChef into node-lib 2019-07-05 11:07:31 +01:00
d98762625 a1cf20bd67 gitignore fix 2019-07-05 10:24:29 +01:00
d98762625 d2ff2ec9c6 improve comments and re-add some excluded operations 2019-07-05 10:22:14 +01:00
d98762625 1c24c05647 swap ENVIRONMENT_IS_* functions for Utils named exports 2019-07-05 10:17:52 +01:00
d98762625 c70f14419a rename dishTranslationTypes 2019-07-05 09:44:01 +01:00
n1474335 80386f1c86 Merge branch 'master' into v9 2019-07-04 18:44:07 +01:00
n1474335 4f70a79638 8.38.1 2019-07-04 18:43:47 +01:00
n1474335 080886a2d1 Added support for psb, hdr, arw, raf, mrw, bct, mdi, au, auf, aif, aifc, arj, ace, hqx, alz, kgb, and torrent file detection. 2019-07-04 18:43:38 +01:00
n1474335 5f9112b565 Merge branch 'j433866-multiple-input-files' into v9 2019-07-04 15:44:16 +01:00
n1474335 2007cfd3a0 Improved efficiency of Dish title generation 2019-07-04 15:43:50 +01:00
n1474335 e49974beaa Merge branch 'multiple-input-files' of https://github.com/j433866/CyberChef into j433866-multiple-input-files 2019-07-04 13:52:26 +01:00
n1474335 e863c8c549 Fixed typo in CHANGELOG 2019-07-03 17:34:17 +01:00
n1474335 e4b4e8afca Added Streebog and GOST to 'Generate all hashes' op 2019-07-03 17:33:27 +01:00
n1474335 4d4ebf7279 8.38.0 2019-07-03 17:28:23 +01:00
n1474335 892632a814 Updated CHANGELOG 2019-07-03 17:28:19 +01:00
n1474335 2ba6a3fd8d Merge branch 'MShwed-feature/streebog-hash' 2019-07-03 17:24:23 +01:00
n1474335 09bea6e231 Added 'GOST Hash' operation 2019-07-03 17:24:11 +01:00
n1474335 99f4091c1a Tidied up Streebog operation, splitting out GOST hash into a separate op. 2019-07-03 17:23:45 +01:00
j433866 6964bbc232 Improve layout of addInput parameters. 2019-07-03 16:15:14 +01:00
j433866 367d30e421 Use reduce for finding previous and next inputNums 2019-07-03 16:09:48 +01:00
j433866 30a66f1441 Use reduce to find smallest and largest inputNums.
Tab shadows are now displayed using css classes
2019-07-03 16:05:20 +01:00
n1474335 666c447e36 Merge branch 'feature/streebog-hash' of https://github.com/MShwed/CyberChef into MShwed-feature/streebog-hash 2019-07-03 15:21:44 +01:00
n1474335 a43dff558a 8.37.0 2019-07-03 15:10:03 +01:00
n1474335 f39006ea1d Updated CHANGELOG 2019-07-03 15:09:59 +01:00
n1474335 2355ef9d31 Merge branch 'MShwed-feature/crc-8-checksum' 2019-07-03 15:07:38 +01:00
n1474335 13b0ab73d0 Tidied up CRC-8 operation and added it to 'Generate all hashes' 2019-07-03 15:07:26 +01:00
n1474335 3766982734 Merge branch 'feature/crc-8-checksum' of https://github.com/MShwed/CyberChef into MShwed-feature/crc-8-checksum 2019-07-03 14:54:41 +01:00
n1474335 54a864e18c 8.36.1 2019-07-03 14:50:23 +01:00
n1474335 9a1f4e40dd Merge branch 'MShwed-bugfix/missing-html-entities' 2019-07-03 14:50:15 +01:00
n1474335 5a83ef4f48 Tidied up HTML Entity operations 2019-07-03 14:49:57 +01:00
j433866 b3fa1eaae2 Fix output heights being incorrect 2019-07-03 14:24:05 +01:00
j433866 6d95cb01c8 Change tab element height using stylesheet.
Debounce bake button function changes.
2019-07-03 13:52:56 +01:00
j433866 a7eefa88fa Merge remote-tracking branch 'upstream/master' into multiple-input-files 2019-07-03 13:20:21 +01:00
n1474335 a7d4e37851 Merge branch 'bugfix/missing-html-entities' of https://github.com/MShwed/CyberChef into MShwed-bugfix/missing-html-entities 2019-07-03 12:43:58 +01:00
n1474335 57e71f0e1a 8.36.0 2019-07-03 12:41:59 +01:00
n1474335 30be3cab53 Updated CHANGELOG 2019-07-03 12:41:52 +01:00
n1474335 0e6626bf39 Merge branch 'pgp-verify' of https://github.com/artemisbot/CyberChef into artemisbot-pgp-verify 2019-07-03 12:38:10 +01:00
n1474335 bb0eaf4597 8.35.0 2019-07-03 12:34:17 +01:00
n1474335 8ada3bae0c Updated CHANGELOG 2019-07-03 12:34:13 +01:00
n1474335 db72cad610 Merge branch 'more-image-ops' of https://github.com/j433866/CyberChef into j433866-more-image-ops 2019-07-03 12:24:03 +01:00
j433866 455b42aa85 Fix whitespace and comment typos.
Add comment to inputworker default values.
2019-07-03 11:53:38 +01:00
j433866 2d95092479 Remove no file extension error 2019-07-03 11:45:36 +01:00
j433866 0f87c70cee Add comma to CSS rule 2019-07-03 11:41:31 +01:00
j433866 4312d39624 Show or hide thumbnail when the option is changed. 2019-07-03 11:41:22 +01:00
j433866 cf500b7296 Fix getInputValue not returning inputs that are arraybuffers 2019-07-03 11:39:24 +01:00
j433866 7a0180213d Update inputWorker description 2019-07-03 10:34:15 +01:00
j433866 160e4a0479 Change ZipWorker to use Dish.get() 2019-07-03 10:34:02 +01:00
j433866 bed66298d1 Change jpeg test data to be a full image 2019-07-03 08:53:44 +01:00
mshwed 44643c151a Fixed linting issues and added CRC-8 tests 2019-07-02 15:30:59 -04:00
mshwed bc1bd2427d Added checksum calculation and helper functions 2019-07-02 15:13:11 -04:00
n1474335 6726994ad5 8.34.3 2019-07-02 18:40:03 +01:00
n1474335 5abc5279f5 Fixed spread operator support in older browsers 2019-07-02 18:39:21 +01:00
j433866 1135ca5fb4 Remove duplicate function.
Fix reading QR codes with transparent backgrounds
2019-07-02 16:31:26 +01:00
j433866 be08a62f52 Add webpack config for font files 2019-07-02 15:31:29 +01:00
j433866 f473807459 Bring up to date with master 2019-07-02 14:23:17 +01:00
j433866 3a197379d5 Remove unused self.port variable 2019-07-02 13:44:04 +01:00
j433866 a9f8dac656 Fix stepping.
Move stepping logic into App.
Change toggleBakeButtonFunction to use a str instead of booleans.
Tidy up handleLoaderMessage in InputWaiter.
2019-07-02 12:23:46 +01:00
j433866 3dc57c4a4a Update copyright year on solarized themes 2019-07-02 10:35:06 +01:00
mshwed 4c9a61f5a7 Added bit reversal 2019-07-01 19:02:07 -04:00
j433866 ba4740a245 Correct documentation 2019-07-01 13:42:06 +01:00
j433866 86c37bab3f Clone dish instead of using the current dish.
Use Dish.STRING instead of "string" for get()
2019-07-01 13:41:48 +01:00
j433866 dd5038c15b Bring up to date with master 2019-07-01 11:51:17 +01:00
mshwed 550ab403f6 Initial operation setup 2019-06-30 21:28:00 -04:00
h345983745 bac2e8c014 Removed V4 + V6 options 2019-06-29 01:12:50 +01:00
n1474335 d148cae814 8.34.2 2019-06-28 17:13:58 +01:00
n1474335 f22211ce8c Backslashes are now escaped correctly by 'Unescape string'. CLoses #582 2019-06-28 17:13:54 +01:00
n1474335 f9c24f2528 8.34.1 2019-06-28 17:09:04 +01:00
n1474335 6f6786d79e Baking controls now scale to fit the pane correctly 2019-06-28 17:09:00 +01:00
n1474335 a5ea7f7d58 8.34.0 2019-06-28 15:03:55 +01:00
n1474335 d637ac7633 Updated CHANGELOG 2019-06-28 15:03:49 +01:00
n1474335 c1ad2386ef Improvements to Entropy operation. Converted to ArrayBuffers, improved efficiency with large files, added present method back in. 2019-06-28 15:00:19 +01:00
mshwed b0b6de116d Fixed linting issue 2019-06-27 14:11:26 -04:00
mshwed 1b161f997b Refactored advanced entropy operation into entropy operation 2019-06-27 14:09:41 -04:00
mshwed b99af58636 Merge branch 'master' of https://github.com/gchq/CyberChef into feature/advanced-entropy 2019-06-27 13:15:19 -04:00
Matt c46928aefe Added tests 2019-06-27 17:51:37 +01:00
n1474335 d4edbb3c3e 8.33.1 2019-06-27 17:30:43 +01:00
n1474335 1b765605ca Updated dependencies 2019-06-27 17:29:27 +01:00
n1474335 8286dc26ad Updated patch dependencies 2019-06-27 17:06:07 +01:00
n1474335 19a438c15b Updated Bootstrap dependecy 2019-06-27 16:58:26 +01:00
n1474335 12898a1a8e Merge branch 'artemisbot-features/bz2-comp' 2019-06-27 16:48:15 +01:00
Matt 4c27a46d35 Added PGP verify operation
Added some more metadata to decrypt & verify
Fixes gchq/CyberChef#581
2019-06-27 16:48:03 +01:00
n1474335 541f2a2988 8.33.0 2019-06-27 16:47:32 +01:00
n1474335 d0277dde3f Updated CHANGELOG 2019-06-27 16:47:26 +01:00
n1474335 d184e40116 Added min and max for Bzip2 block size arg 2019-06-27 16:45:16 +01:00
n1474335 596db07647 Merge branch 'features/bz2-comp' of https://github.com/artemisbot/CyberChef into artemisbot-features/bz2-comp 2019-06-27 16:44:42 +01:00
n1474335 c233c5c67e Modified operation request template description 2019-06-27 16:01:44 +01:00
n1474335 db788b57e7 Merge branch 'update-issue-templates' of https://github.com/h345983745/CyberChef into h345983745-update-issue-templates 2019-06-27 15:58:38 +01:00
n1474335 c0983654d8 8.32.1 2019-06-27 15:56:16 +01:00
n1474335 30bf95f2c1 Merge branch 'oct' of https://github.com/wh0/CyberChef into wh0-oct 2019-06-27 15:55:34 +01:00
n1474335 da178107f9 8.32.0 2019-06-27 15:50:30 +01:00
n1474335 4dda1d9e49 Updated CHANGELOG 2019-06-27 15:45:17 +01:00
n1474335 e11aec64cd Modified wording for IC op 2019-06-27 15:42:32 +01:00
n1474335 71575e49d7 Merge branch 'index-of-coincidence' of https://github.com/Ge0rg3/CyberChef into Ge0rg3-index-of-coincidence 2019-06-27 15:41:20 +01:00
n1474335 393d070b05 8.31.8 2019-06-27 15:37:12 +01:00
n1474335 d7e4c28cd0 Merge branch 'bugfix/json-to-csv' of https://github.com/MShwed/CyberChef into MShwed-bugfix/json-to-csv 2019-06-27 15:36:12 +01:00
n1474335 ccf2348cd6 8.31.7 2019-06-27 15:34:22 +01:00
n1474335 cde3eb2c39 Merge branch 'popover-patch' of https://github.com/Ge0rg3/CyberChef into Ge0rg3-popover-patch 2019-06-27 15:31:57 +01:00
wh0 f29d8eeda8 Parse octal escape sequences 2019-06-25 18:35:25 -07:00
mshwed daee7ac761 Merge branch 'master' of https://github.com/gchq/CyberChef into feature/advanced-entropy 2019-06-20 14:11:51 -04:00
mshwed 313d1a580e Merge branch 'master' of https://github.com/gchq/CyberChef into bugfix/json-to-csv 2019-06-20 13:59:08 -04:00
mshwed 824d8e929a Fixed linting issues 2019-06-20 13:26:35 -04:00
mshwed 862d2adf1d Added missing HTML entities 2019-06-20 13:08:20 -04:00
j433866 906ece0c02 Remove loading files modal 2019-06-20 13:47:30 +01:00
j433866 0bcf57e89c Improve printing text to improve output quality.
Now resizes the text instead of the image
2019-06-20 12:58:02 +01:00
j433866 c529a406cd Fix switchClick not always being fired.
Run detectFileType on switched output
2019-06-18 15:10:51 +01:00
j433866 05d81eb734 Merge remote-tracking branch 'upstream/master' into multiple-input-files 2019-06-14 14:56:16 +01:00
j433866 ca9bab5d4c 8.31.6 2019-06-14 14:32:15 +01:00
j433866 e35ef8f39b Escape HTML for error messages being sent to alert 2019-06-14 14:31:38 +01:00
j433866 370cae3c8d Fix incorrect value being sent to dishworker 2019-06-13 15:39:11 +01:00
j433866 5731f5c75c Add dishworker 2019-06-13 14:48:38 +01:00
j433866 34d03973f9 Improve queueing for getDish... messages.
Force wheel event to be not passive.
Change maxworkers to be navigator.hardwareConcurrency - 1
2019-06-13 14:48:28 +01:00
j433866 84204c1d12 Add mime type detection to tab title.
Move addition of close tab button back
2019-06-13 11:13:53 +01:00
j433866 6ee76e3bf0 Add getDishTitle function 2019-06-13 09:43:58 +01:00
j433866 f497dc3170 Handle progressMessage in background waiter.
Don't update tab progress if there's no set recipe
2019-06-11 10:01:40 +01:00
j433866 749ffdd5d1 Move input tab code 2019-06-11 09:50:29 +01:00
George O e709582062 Disappearing Popover Fix 2019-06-10 19:19:50 +01:00
j433866 713f10e63a Turn input tabs into progress bars 2019-06-10 16:07:01 +01:00
j433866 9d60ef5f72 Turn output tabs into progress bars! 2019-06-10 15:39:21 +01:00
j433866 5a52e5e9b3 Remove new lines from input tab header 2019-06-10 13:08:03 +01:00
j433866 d99cf9d499 Use function in TabWaiter 2019-06-10 13:03:07 +01:00
j433866 be0e12589d Display preview of output in output tab headers.
Remove unused argument from setLogLevel()
2019-06-10 12:47:27 +01:00
George O a6732ba815 Added Index of Coincidence Tests 2019-06-09 00:57:02 +01:00
George O 466d872d30 Added Index of Coincidence Operation 2019-06-09 00:57:02 +01:00
j433866 ad982746dd Display recipe progress in status message 2019-06-07 13:52:47 +01:00
j433866 8c2cc5b6d2 Improve removing tabs experience 2019-06-07 13:52:04 +01:00
j433866 3cf7238106 8.31.5 2019-06-07 11:04:00 +01:00
j433866 f8d08cc5db Merge branch 'j433866-aes-gcm-fix' 2019-06-07 10:55:53 +01:00
j433866 97f86af6b9 Improve speed of changing input tabs.
Handle not finding an active tab
2019-06-06 16:53:58 +01:00
j433866 c2087f6d5f Move tab logic into a new TabWaiter 2019-06-06 16:33:35 +01:00
j433866 98af95a6ce Change pasting to keep cursor position.
Move output scrolling to changeTab() instead of set()
2019-06-06 10:26:16 +01:00
j433866 39101610d5 Scroll I/O areas to the top when switching tabs 2019-06-06 09:33:51 +01:00
j433866 b77239fc15 Move waiters and workers into separate folders. 2019-06-06 09:09:48 +01:00
j433866 31a3af1f84 Remove step and progress from Chef.
It's now all handled by the App!
2019-06-04 14:02:45 +01:00
j433866 0e5944e9c6 Set URL input parameter when setting input.
(e.g. when tab changed or removed)
2019-06-04 11:59:44 +01:00
j433866 99e9df0211 Holding down on tab change buttons will scroll.
Hide loading stats when there's only one input
2019-06-04 11:42:27 +01:00
j433866 c1bdca8df3 Change to use byte strings instead of byte array 2019-06-04 10:19:00 +01:00
j433866 15b5cf7c20 Correctly handle clicking cancel on go to dialog 2019-06-04 09:41:47 +01:00
j433866 f55102716e Add min / max tabs to go to tab dialog (output) 2019-06-04 09:39:47 +01:00
j433866 17b95f1609 Add min / max inputNums on go to tab dialog 2019-06-04 09:36:50 +01:00
j433866 2575a762e1 Make input and output tab areas scrollable 2019-06-03 16:10:05 +01:00
j433866 f5cf7bb1f2 Rename 'move output to input' to 'replace input with output'
Shrink close tab buttons
2019-06-03 15:37:14 +01:00
j433866 d3e8616e90 Add close all tabs button to input tab dropdown 2019-06-03 15:12:59 +01:00
j433866 87dc325932 Move debouncer to App.
Debounce drag of splitter and window resize
2019-06-03 14:59:41 +01:00
j433866 eb91dd7a7d Add documentation for getURIParams 2019-06-03 14:23:00 +01:00
j433866 89c4f54ce8 Only show bake stats when theres more than 1 input
Better handle canceling a bake when inputs are loading
Don't create chefworkers if we don't need them
Fix capitalisation of bake stats
2019-06-03 14:09:03 +01:00
j433866 b3cb800f35 Default inputNum to -1 when one isn't sent.
Improve jsdoc comments
2019-06-03 14:01:00 +01:00
j433866 4a0f62b636 Change getLargest/getSmallest to use a for loop.
Math.max() and Math.min() were exceeding call stack size
2019-06-03 13:48:49 +01:00
j433866 bcaefe39aa Improve transferable object syntax.
Fix capitalisation on loading info.
Improve error when an action isnt sent by inputworker
2019-06-03 11:20:06 +01:00
j433866 54bb17c109 Remove getAllInput() function.
Improve documentation.
2019-06-03 11:16:54 +01:00
j433866 dc74a389d8 Add documentation for inputNum.
Fix syntax for transferable objects.
2019-06-03 11:15:48 +01:00
j433866 784b3b58ca Fix to stop find tab CSS affecting operations 2019-06-03 11:15:10 +01:00
j433866 34b7c47533 Fix highlighting not working 2019-05-31 15:37:20 +01:00
j433866 d6a80b4865 Use toLocaleString for final bake stats 2019-05-31 09:59:23 +01:00
j433866 1d20fe13f3 Reset displayed load progress when clearing IO 2019-05-31 08:54:01 +01:00
j433866 7586c3ef8a Merge remote-tracking branch 'upstream/master' into multiple-input-files 2019-05-30 15:02:14 +01:00
j433866 b232069631 If a tab can't be added, show the shadow on the...
last tab to indicate there are more tabs
2019-05-30 14:32:05 +01:00
j433866 11d2a96ecb Pause for a second to allow autobake to finish.
Otherwise nightwatch was clicking cancel instead of bake
2019-05-30 14:18:34 +01:00
j433866 586e5a3db8 Further improvements to tab search UI 2019-05-30 14:08:02 +01:00
j433866 d94a431537 Improve searching for tabs UI.
Content / filename search is now a regex.
Use .toLocaleString() for loading / baking stats
2019-05-30 13:28:45 +01:00
j433866 9b2f44efb1 Turn extract click listener back on.
Add shadow to tabs when there are more tabs that aren't displayed
2019-05-29 16:29:34 +01:00
j433866 12e4fe4120 Fix clear all button breaking everything.
Rearrange baking a bit to hopefully fix firefox
2019-05-29 14:08:37 +01:00
j433866 476d9c8034 Remove unused parameter 2019-05-29 14:07:46 +01:00
j433866 85809efcc0 Adjust number of tabs shown when resizing window.
Improve refresh tabs logic.
Fix input not being shown when loaded from a URL
2019-05-29 13:25:12 +01:00
j433866 722edcc274 Display file size in header 2019-05-29 11:46:21 +01:00
j433866 919c3fd999 Fix display file slice displaying raw instead of presented data.
Fix errored filter when searching for tabs.
2019-05-28 15:01:49 +01:00
j433866 6c711ec211 Add and remove chefworkers when adding or removing inputs.
This increases the responsiveness of baking as it means we don't have to...
spin up workers when bake is clicked
2019-05-28 14:11:05 +01:00
j433866 7528065d4d Fix stepping again.
Add new getInput function to inputWorker
2019-05-28 11:59:57 +01:00
d98762625 79e2ca6284 remove symlink 2019-05-24 18:42:47 +01:00
d98762625 d22d22d24c Try and include symlink at project root to make deep import specifier easier 2019-05-24 17:48:38 +01:00
d98762625 1a9c9a5ddf Actually need to return the translation 2019-05-24 16:46:07 +01:00
j433866 0bced35931 Fix stepping again 2019-05-23 15:31:18 +01:00
j433866 4dcd60adc0 Improve handling of displaying large outputs.
Bring getDishStr and getDishBuffer back.
2019-05-23 15:29:58 +01:00
d98762625 d51e8ec378 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-05-23 15:07:28 +01:00
j433866 59cdd259ac Add new parse ssh host key operation 2019-05-23 11:11:37 +01:00
j433866 2be2c83f67 8.31.4 2019-05-21 16:56:23 +01:00
j433866 a271eaabd0 Merge branch 'j433866-load-regex-fix' 2019-05-21 16:53:47 +01:00
j433866 e95f92cdeb Bake inputs after clearing IO 2019-05-21 11:24:44 +01:00
j433866 cb86cb1882 Change baking to not send all inputs at once.
Add input debouncer.
Remove old HTML comments and unnecessary CSS
(Step is currently a bit broken!)
2019-05-20 16:53:56 +01:00
h345983745 1d130c88a8 Inital commit 2019-05-19 15:40:17 +01:00
j433866 c50f5769db Add key bindings for tabs 2019-05-16 15:02:32 +01:00
j433866 6df9b649a1 Terminate zipworker when clearing all io 2019-05-16 13:04:04 +01:00
j433866 6f5018d45e Don't change option value if new value is blank 2019-05-16 11:59:25 +01:00
j433866 f51ee76c72 Merge pull request #3 from gchq/master
Bring up to date with gchq/master
2019-05-16 11:53:58 +01:00
j433866 a750b0f08a Use transferable objects to send arraybuffers back to the workerwaiter 2019-05-16 10:42:27 +01:00
j433866 0e850b2a85 Fix stepping not working.
Use transferable object for sending arraybuffers to workers
2019-05-16 10:42:07 +01:00
j433866 d326cad611 Remove unused parameter 2019-05-16 09:38:34 +01:00
j433866 2ddb9b8f7c Remove unecessary progress item 2019-05-16 09:33:28 +01:00
j433866 6237db9ba6 Use detectFileType to autodetect file extensions in zip 2019-05-16 09:27:46 +01:00
j433866 0cff7bdd04 Improve handling of OperationErrors.
Make output filter refresh when changing stale or errored checkboxes
2019-05-15 16:24:49 +01:00
j433866 413e80ed3e Add clicking on output search result 2019-05-15 16:03:18 +01:00
j433866 5d52f4a760 Add searching for output tabs.
Remove all existing chefworkers before starting a bake.
Clear breakpoint when starting a bake
2019-05-15 09:37:07 +01:00
j433866 0855dc617f Add comments to inputWorker.
Slightly improve logic for getNearbyNums
2019-05-14 16:13:36 +01:00
j433866 04587a8a47 Merge branch 'multiple-input-files' of github.com:j433866/CyberChef into multiple-input-files 2019-05-14 11:45:22 +01:00
j433866 392b96dc34 Commenting 2019-05-14 11:45:13 +01:00
h345983745 219469f24f Intial Commit
Consolidated IP Regex's

Fixed Logic Error

Added Tests

Removed Changes Outside Of Operation

Added to category
2019-05-12 21:19:54 +01:00
j433866 84cc3d16ed Fix close tab buttons not working in old firefox. 2019-05-10 16:54:28 +01:00
j433866 e34d521dcc Improve UI for searching for input tabs 2019-05-10 13:48:03 +01:00
j433866 2c02900edf Improve handling of errors.
Add parameter to some update functions for whether or not to set the output
2019-05-10 13:47:48 +01:00
j433866 f5442c307a Only set the input of the active input if the progress has changed.
Autobake when the input loads instead of when all load.
2019-05-10 13:45:27 +01:00
j433866 802879ced2 Merge pull request #2 from gchq/master
Bring branch up to date with gchq/master
2019-05-10 09:09:58 +01:00
j433866 0c9e8fe050 8.31.3 2019-05-09 17:07:12 +01:00
j433866 8f41571e47 Merge branch 'd98762625-use-node-lts' 2019-05-09 16:43:08 +01:00
j433866 6d14368e2f Merge branch 'use-node-lts' of https://github.com/d98762625/CyberChef into d98762625-use-node-lts 2019-05-09 16:42:19 +01:00
j433866 f90ad48906 Update dependencies 2019-05-09 16:20:42 +01:00
j433866 e95dac82c2 8.31.2 2019-05-09 11:56:27 +01:00
j433866 144601ffd4 Merge branch 'j433866-load-recipe-fix' 2019-05-09 11:54:18 +01:00
j433866 cbcc2aa731 Fix regex to handle multiple escaped backslashes 2019-05-09 10:04:06 +01:00
j433866 f9354c8cd1 Merge remote-tracking branch 'upstream/master' 2019-05-09 09:08:01 +01:00
j433866 aff0416405 Remove some comments 2019-05-09 09:07:28 +01:00
j433866 6d9a14feed Display when an input errors on load.
Autobake when all inputs have loaded.
Improve load experience.
2019-05-08 16:44:11 +01:00
j433866 3c2e5c143a Set bake button to "Loading..." when an autobake is started 2019-05-08 16:42:19 +01:00
j433866 cbf1d2feb0 Add specific handling for DOMExceptions 2019-05-08 16:42:06 +01:00
j433866 65bb7f32e9 Fix refreshTabs not always hiding the tab bar 2019-05-08 14:58:09 +01:00
j433866 3b8c365f7e Remove unused zip dependency 2019-05-08 14:48:37 +01:00
j433866 43747accd5 Change to add input tabs as inputs are added, instead of at the end.
Change outputWaiter to use outputExists instead of getOutput
2019-05-08 14:47:05 +01:00
j433866 50f9bbeac3 Make set() asynchronous 2019-05-08 13:46:29 +01:00
j433866 3cffd9334f Fix file slice not always being displayed 2019-05-08 12:54:55 +01:00
j433866 f72749304d Improve handling of errors in operations.
Remove unused dependencies.
2019-05-08 11:57:22 +01:00
j433866 689d08416b Don't create more ChefWorkers than we need. 2019-05-08 10:53:04 +01:00
j433866 28182713bf Fix showing slice of output not working.
Fix output status message not being reset.
Hide magic button when baking.
2019-05-08 10:10:14 +01:00
j433866 8190c7aac7 Add maximise output button 2019-05-07 15:36:42 +01:00
j433866 6268f091b8 Bring back moving the output into the input.
Change wording for download as zip button
2019-05-07 15:34:36 +01:00
j433866 cbfde7ddb1 Don't highlight if the input and output tab numbers are different 2019-05-07 14:33:38 +01:00
j433866 35d6c7d79e Bring highlighting back.
Fix backgroundMagic using output result instead of dish value
2019-05-07 14:20:18 +01:00
j433866 f1a2cf7efc Add cancellation of zipping 2019-05-07 12:00:53 +01:00
j433866 ec4eb22a72 Don't include loading inputs in complete percentage 2019-05-07 12:00:37 +01:00
j433866 97c218cb4c Fix where zipworker was using output presented result.
Now uses the raw dish value
2019-05-07 12:00:14 +01:00
j433866 07021b8dd5 Add new worker for zipping outputs.
Use bakeId to track which outputs are stale.
2019-05-07 09:26:55 +01:00
d98762625 aa9bf08157 amend comments, remove return type from Dish translate 2019-05-03 14:38:29 +01:00
d98762625 90dd7037c8 update TestRegister location for new tests 2019-05-03 13:54:10 +01:00
d98762625 6084759907 Merge branch 'use-node-lts' into node-lib 2019-05-03 13:42:45 +01:00
d98762625 0a3d87dfe3 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-05-03 13:41:05 +01:00
d98762625 65a3897f87 add dish translation tests for node 2019-05-03 13:36:08 +01:00
j433866 df20196201 Fix magic not always working 2019-05-03 11:49:14 +01:00
j433866 e9d60f73f4 Fix some more autobake weirdness.
Input passed in the URL is now set on load.
Added a new progress bar.
2019-05-02 15:44:31 +01:00
j433866 8e9717906f Improve autobake further to behave more like it did before.
Improve generation of state URI.
2019-05-02 13:54:15 +01:00
j433866 82183bf204 Improve queueing of inputs to avoid baking the same input twice.
Fix generation of input URL.
Fix worker log levels not being set correctly.
2019-05-02 11:29:54 +01:00
j433866 b2406b0465 Run set() when a bake is cancelled.
This will make sure the output shows the most recently baked data,
and also shows the stale indicator if needed
2019-05-02 09:20:28 +01:00
j433866 1bdef97dc7 Wait for stale indicator to disappear before clicking bake.
As the new inputWorker is slower, nightwatch was clicking cancel and thus showing the stale indicator.
2019-05-01 17:09:13 +01:00
j433866 ff9c68db56 Update handling of bake errors.
Add preview thumbnail for image input.
2019-05-01 17:08:36 +01:00
j433866 1cedc94652 Fix status messages for baking 2019-05-01 15:19:01 +01:00
j433866 02bda3250b Fix magic button.
Fix download all files not working
2019-05-01 14:46:05 +01:00
j433866 f6f60e8203 Update LoaderWorker to not use messagechannels 2019-05-01 14:13:40 +01:00
j433866 55beb433f3 Go back to sending messages via the main thread.
A MessageChannel is faster on Chrome, but causes issues in Firefox.
Bake button now says "Loading..." when the inputWorker is gathering inputs for baking
2019-05-01 14:12:36 +01:00
j433866 2fff18cb61 Don't create a new loaderWorker until we need one.
This was causing issues on single core systems after I got rid of the active status as we had already reached the max number of workers.
Instead, we just create a loaderWorker when needed as loaderWorkers are small enough!
2019-04-30 15:23:41 +01:00
j433866 6d8bf3a08a Enable filter buttons in manager 2019-04-30 14:45:34 +01:00
j433866 13ee79a06b Add searching for inputs 2019-04-30 14:15:05 +01:00
j433866 b4208ede3b Add clear io button.
Fix some weirdness with removing tabs
2019-04-30 13:34:00 +01:00
j433866 a96cb3f99f Add clear all io button. 2019-04-30 13:18:22 +01:00
j433866 1f39a922d1 Reset bake button background when state changed 2019-04-30 12:58:29 +01:00
j433866 145fba5949 Input pasting now works 2019-04-30 11:48:01 +01:00
d98762625 7a4f418e75 configure travis to use node LTS instead of latest 2019-04-29 17:10:40 +01:00
mshwed 8fa8e34027 Added support for parsing JSON with number type values. Added support for non-array JSON objects. Added extra tests for JSON to CSV operation. 2019-04-28 16:29:15 -04:00
mshwed 5225874498 Fixed handling of large files and fixed issue with line histogram colour fill 2019-04-28 14:38:03 -04:00
j433866 8cb86c364d Increase file limit 2019-04-26 15:19:17 +01:00
j433866 6d98014ad2 New max limit for files 2019-04-26 15:16:15 +01:00
j433866 1cf83c2485 Change baking to send all inputs individually.
Re-enable go to tab button.
Active tab is now autobaked on load completion.
Handle (ish) loaderWorker errors.
Improve load performance.
2019-04-26 15:15:44 +01:00
j433866 f638bd4ded If sending arraybuffer back, use a transferable object 2019-04-26 14:01:49 +01:00
j433866 7b169fb798 Add css for search box 2019-04-25 16:33:02 +01:00
j433866 406cbb0f41 Move input logic into a new worker (InputWorker)
Change OutputWaiter to use dict of outputs instead of list
LoaderWorker communicates with InputWorker using a messagechannel
2019-04-25 16:32:48 +01:00
mshwed 802493fec4 Merge branch 'master' of https://github.com/gchq/CyberChef into feature/advanced-entropy 2019-04-24 19:48:03 -04:00
d98762625 aeb08caf77 move NodeDish tests out into own file 2019-04-24 08:47:37 +01:00
j433866 6d8daac5ca Merge remote-tracking branch 'upstream/master' into multiple-input-files 2019-04-23 09:02:04 +01:00
j433866 82186c8592 Add search box for input tabs 2019-04-23 09:02:00 +01:00
j433866 f099a352b3 Change get input function calls 2019-04-23 09:01:25 +01:00
n1474335 01f0625d6a Fixed XSS in 'Text Encoding Brute Force. Closes #539 2019-04-14 22:00:17 +01:00
n1474335 38ff7ec89f 8.31.1 2019-04-14 21:56:01 +01:00
n1474335 7163a0802d Tidied up build directory 2019-04-14 21:55:52 +01:00
n1474335 8d0fcf37c5 8.31.0 2019-04-12 18:58:48 +01:00
n1474335 3da5a8bb34 Merge branch 'downloadable-zip' 2019-04-12 18:58:36 +01:00
n1474335 fad33b583b Updated CHANGELOG 2019-04-12 18:58:22 +01:00
n1474335 8f450501cc Downloadble version is now a .zip file instead of a single .htm file 2019-04-12 18:54:31 +01:00
n1474335 b3ae0e577a 8.30.1 2019-04-12 16:25:47 +01:00
n1474335 aedac94e40 Merge branch 'd98762625-init-dish' 2019-04-12 16:25:38 +01:00
n1474335 08c5dbce09 Merge branch 'init-dish' of https://github.com/d98762625/CyberChef into d98762625-init-dish 2019-04-12 16:24:23 +01:00
n1474335 482d658de7 8.30.0 2019-04-12 16:20:00 +01:00
n1474335 39e34081fc Updated CHANGELOG 2019-04-12 16:18:25 +01:00
n1474335 5797786a75 Merge branch 'feature-protobuf' 2019-04-12 16:16:03 +01:00
n1474335 f6977ea264 Added test for 'Decode Protobuf' operation 2019-04-12 16:13:10 +01:00
d98762625 de8c99eceb merge init-dish & update tests 2019-04-08 18:06:01 +01:00
d98762625 cdc15c0f20 change empty Dish initialisation to use ArrayBuffer 2019-04-08 17:58:46 +01:00
Matt 18408901be removed old bzip2 dependency 2019-04-07 19:11:46 +01:00
Matt 982c915931 Change author 2019-04-07 19:02:27 +01:00
Matt a339eacd45 Bzip2 compression support changed to use wasm backend
x4 speed.
2019-04-07 18:59:03 +01:00
mshwed 8fc0e012e3 Fixed formatting issues 2019-04-06 23:09:46 -04:00
mshwed b7fb9635e5 Added operation for entropy visualization as an image 2019-04-06 19:40:07 -04:00
mshwed f988a958bb Added support for generating an entropy curve based on the input data 2019-04-06 15:59:36 -04:00
mshwed c80cb57b07 Added histogram line, refactored axes generation 2019-04-05 14:30:24 -04:00
d98762625 e764ddf0b8 update TestRegister references 2019-04-05 18:45:47 +01:00
d98762625 a210f951da more linting 2019-04-05 17:40:52 +01:00
d98762625 367532cf8d linting and comment for readFileSync 2019-04-05 17:35:20 +01:00
d98762625 d3e6200385 remove babel-polyfill and update plugins to work with uplifted version 2019-04-05 17:15:21 +01:00
d98762625 af504891e4 incorporate ArrayBuffer base Dish type. Add global file shim to node index. Fix Buffer -> ArrayBuffer transformation 2019-04-05 16:51:14 +01:00
mshwed dec28e16d4 Added histogram visualization for text entropy 2019-04-05 11:12:44 -04:00
j433866 bd3777f9de Change maximum file size in readme 2019-04-05 10:51:39 +01:00
d98762625 e4ee0fc397 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-04-04 15:21:52 +01:00
j433866 9690ccd8a0 Fix being unable to go to tab 1 2019-04-04 14:42:21 +01:00
j433866 0804647441 Load in the right order 2019-04-04 13:14:45 +01:00
j433866 76da287cca Bake in the right order 2019-04-04 13:13:38 +01:00
j433866 8739dd97d6 Change srcElement to target
(srcElement is non-standard)
2019-04-04 13:13:21 +01:00
d98762625 a7874cc351 improve naming in API 2019-04-04 11:28:46 +01:00
j433866 de21f14fd8 Move the tab buttons onto the tab bar 2019-04-04 10:57:01 +01:00
j433866 b90cca77a9 Fix more tab weirdness.
Move tab buttons onto tab bar.
Calculate size of maxTabs automatically on page load.
Display total execution time when a bake finishes.
2019-04-04 10:15:13 +01:00
j433866 1eadc08098 Fix some weirdness with tabs.
Adjust worker logic to avoid closing and reopening a worker as often
2019-04-03 16:05:10 +01:00
j433866 9df26b8c84 Output tabs now (mostly) work.
Add downloading files as an archive (needs work)
Add option for keeping the tabs in sync
2019-04-03 12:00:47 +01:00
n1474335 525cb0689f Added 'Protobuf Decode', 'VarInt Decode' and 'VarInt Encode' operations 2019-04-02 17:27:14 +01:00
Matt 7796c473ae Fix lint issue 2019-04-02 17:01:47 +01:00
j433866 e0c9aba25e Improve WorkerWaiter and OutputWaiter.
- Will run and display outputs in the output area as they're baked
- Creates output tabs
- Can change output tabs (only the first 4 at the moment)
2019-04-02 16:58:36 +01:00
j433866 2cb33bfec4 Bring up to date with master 2019-04-02 16:54:34 +01:00
j433866 2aad7647ef Add tab buttons (don't work yet).
Change some of the HTML around the tab bar
2019-04-02 16:53:15 +01:00
j433866 6430129b2a Remove some inputNum stuff for now 2019-04-02 16:52:43 +01:00
Matt 8445165491 Use all the arraybuffers
cuts a solid 1/3 off the compression time
2019-04-02 16:47:38 +01:00
Matt c5698fcd65 Merge remote-tracking branch 'upstream/master' into features/bz2-comp 2019-04-02 16:26:29 +01:00
n1474335 786e50c3c3 8.29.1 2019-04-02 15:34:35 +01:00
n1474335 7d03be3a77 Dish._translate now uses ArrayBuffer as its intermediate type instead of byteArray. This should speed up operations on large files. 2019-04-02 15:34:30 +01:00
mshwed 4496d7762b Converted js files to mjs. Added test cases for hashing 2019-04-02 09:41:49 -04:00
Matt 8b12caad78 Merge gchq/master into bz2-comp 2019-04-02 12:08:30 +01:00
Matt e1492c3bb1 Added (non-garbage) description and fixed wikipedia link. 2019-04-02 12:05:17 +01:00
Matt 3cc66e9db9 Added Bzip2 compression support 2019-04-02 11:55:59 +01:00
mshwed 37389a62c1 Added support for hashing version 1994 and 2012. Added S-Box selection for 1994 version. Added length selection 2019-04-01 23:14:40 -04:00
mshwed aef65620da Merge remote-tracking branch 'origin/master' into feature/streebog-hash 2019-04-01 21:57:33 -04:00
j433866 cd094d1475 Change "input-tabs" id to be for the actual ul element.
Automatically disable auto-bake if more than 20 files are input.
2019-04-01 16:15:09 +01:00
j433866 99bef09e0e Fix invalid file type error 2019-04-01 14:13:30 +01:00
j433866 c97e77c765 Merge with qr-improvements.
Change QR code ops to use ArrayBuffer.
Add new function to Utils to convert a string to arraybuffer.
2019-04-01 14:11:37 +01:00
Martin Gillow 8ece8ebec2 Updated description 2019-04-01 13:40:53 +01:00
j433866 e44a22e143 Change ops to use ArrayBuffer instead of byteArray 2019-04-01 10:54:46 +01:00
j433866 c2496fe63e Change to use Promise.all 2019-04-01 09:00:41 +01:00
j433866 7bf8467637 Add maximum limit to the thumbnail image size 2019-04-01 08:53:52 +01:00
n1474335 27677adbe8 Fixed option default 2019-04-01 00:29:10 +01:00
n1474335 6fa06a4f8b 8.29.0 2019-03-31 22:42:16 +01:00
n1474335 a3be4d2945 Merge branch 'h345983745-blake2' 2019-03-31 22:41:13 +01:00
n1474335 3dc5b5c31a Changed input type for BLAKE hashing ops to ArrayBuffer and tidied 2019-03-31 22:40:54 +01:00
n1474335 342e11f83e Merge branch 'blake2' of https://github.com/h345983745/CyberChef into h345983745-blake2 2019-03-31 22:25:40 +01:00
n1474335 b6d78b4001 8.28.0 2019-03-31 21:47:24 +01:00
n1474335 2aaa6db538 Updated CHANGELOG 2019-03-31 21:47:18 +01:00
n1474335 fc909d8199 Fix lint 2019-03-31 21:43:20 +01:00
n1474335 262136393b Merge branch 'artemisbot-module-charts' 2019-03-31 21:41:32 +01:00
n1474335 1640859542 Tidied up charts operations 2019-03-31 21:40:54 +01:00
n1474335 f0b48acaf9 Merge branch 'master' into artemisbot-module-charts 2019-03-31 21:21:08 +01:00
h345983745 bb8c305fc8 Updated description 2019-03-31 18:02:04 +00:00
h345983745 3950dba2c5 Added Key Option 2019-03-31 18:02:04 +00:00
h345983745 903ea45228 Update Generate All Hashes 2019-03-31 18:02:03 +00:00
h345983745 b116b8ba1e Added Output Encoding Option 2019-03-31 18:02:03 +00:00
h345983745 908043fb7f Added to Categories and updated info URL's 2019-03-31 18:02:03 +00:00
h345983745 2d7e3f180e Added to "Generate All Hashes" operation 2019-03-31 18:02:03 +00:00
h345983745 c813d17595 Fixed Author Tags 2019-03-31 18:02:03 +00:00
h345983745 7d16265c4e Initial Commit – Working hash functionality 2019-03-31 18:02:02 +00:00
n1474335 4fb4764d3f 8.27.2 2019-03-30 14:56:53 +00:00
n1474335 2385f1cbf8 Updated dependencies 2019-03-30 14:56:43 +00:00
martin gillow 4d39c3bbd2 Fixed code spacing and formatting 2019-03-30 13:42:29 +00:00
martin gillow 23ddb87c9f Fixed code spacing and formatting 2019-03-30 13:02:14 +00:00
martin gillow db662a7662 Removed debug. Final testing 2019-03-30 10:13:25 +00:00
j433866 eb5809fd17 Fix tab info not being updated in refreshTabs() 2019-03-29 14:51:11 +00:00
j433866 f6ab82faaf Fix file preview not working 2019-03-29 13:42:07 +00:00
j433866 0d8584f499 Merge with ui-improvements 2019-03-29 13:35:30 +00:00
j433866 c289e1beef Rewrite InputWaiter to be less messy.
Don't create a DOM element for every tab, just reuse the same ones.
Display file information while the files are loading.
(Output tabs no longer work)
2019-03-29 13:29:24 +00:00
mshwed db491cbb09 Added initial hashing for Streebog GOST R 34.11-94 2019-03-28 11:46:04 -04:00
n1474335 3d80d66925 Merge branch 'module-charts' of https://github.com/artemisbot/CyberChef into artemisbot-module-charts 2019-03-27 23:17:30 +00:00
n1474335 ce208b69fe 8.27.1 2019-03-27 23:12:08 +00:00
n1474335 a44418c6a1 Merge branch 'MShwed-feature/hex-support-percent-delimiter' 2019-03-27 23:11:08 +00:00
n1474335 5ac84491c1 Merge branch 'feature/hex-support-percent-delimiter' of https://github.com/MShwed/CyberChef into MShwed-feature/hex-support-percent-delimiter 2019-03-27 23:09:25 +00:00
n1474335 58769eb06e Merge branch 'h345983745-missing-comment' 2019-03-27 23:07:57 +00:00
n1474335 59ae9c6437 Improved 'Extract Files' description 2019-03-27 23:07:43 +00:00
n1474335 81d698c091 Merge branch 'missing-comment' of https://github.com/h345983745/CyberChef into h345983745-missing-comment 2019-03-27 23:03:15 +00:00
n1474335 bce0895392 Updated helper capabilities 2019-03-27 23:02:10 +00:00
martin gillow 39f3383709 Renamed option 2019-03-27 20:57:04 +00:00
martin gillow 4f8fc8d65e Fixed p5 limitation 2019-03-27 20:44:57 +00:00
j433866 a2cc7a84db Sync output tabs to input tabs.
Output tabs are created when input tabs are.
Fix initial bake not working
2019-03-27 13:48:54 +00:00
Martin Gillow 0397ba857f Fixed motor wheel movement 2019-03-27 13:02:18 +00:00
j433866 90dd2b5ac2 Add css for output tabs 2019-03-27 09:39:38 +00:00
j433866 3597aacce9 Add wrapper to output 2019-03-27 09:38:13 +00:00
j433866 61bc5436a2 Fix number of running workers not being correct.
(This needs some work!)
2019-03-27 09:26:01 +00:00
j433866 37428fbe3b Bake all inputs, not just the active tab.
Limits number of workers to number of cpu threads (4 if not supported)
Creates output tabs (switching doesn't work yet)
Disabled some highlighting for now.
2019-03-27 09:05:10 +00:00
martin gillow 444fb4555b Custom wheel settings 2019-03-25 21:10:47 +00:00
martin gillow 294f890a92 Merge branch 'master' of https://github.com/VirtualColossus/CyberChef 2019-03-25 19:47:50 +00:00
martin gillow 578502187d Added custom lug option 2019-03-25 19:37:20 +00:00
Martin Gillow 786082a9d0 Adding Lorenz SZ40/42 operation 2019-03-25 13:43:34 +00:00
Martin Gillow b6eb851a13 Added Lorenz SZ40/42 operation 2019-03-25 13:34:25 +00:00
Martin Gillow 93c41f044c Added Lorenz SZ40/42 operation 2019-03-25 13:31:13 +00:00
VirtualColossus a7f61397f7 Added Lorenz SZ40/42 Operation 2019-03-25 13:26:26 +00:00
VirtualColossus 0f5f20247a Added Lorenz SZ40/42 operation 2019-03-25 13:25:13 +00:00
h345983745 e909eea82a Added description 2019-03-23 16:14:40 +00:00
n1474335 ef4b977bef Added a cyber helper 2019-03-22 17:10:00 +00:00
j433866 fbe1e2c2cc Show tab number on tab title.
Don't show lines value if tab contents is a file.
2019-03-22 15:55:35 +00:00
j433866 9b86ed7c45 Fix input highlighter size 2019-03-22 15:19:03 +00:00
j433866 c0c83c5cdc Stores inputs in memory instead of in textareas.
Allow selecting multiple files.
Allow drag and dropping multiple files.
Clear all IO button will close all tabs.
Will now spawn multiple loaderworkers simultaneously.
Improve tab logic to break less and work in Firefox.
2019-03-22 15:10:19 +00:00
d98762625 638093d40e correct translation from node Buffer to byte array 2019-03-22 09:42:25 +00:00
mshwed 8707287349 Added percent delimiter for "To Hex" operation 2019-03-21 20:10:45 -04:00
j433866 37218c1e81 Add UI for input tabs.
Can add, remove and switch tabs
2019-03-21 12:31:01 +00:00
d98762625 b98cab7d62 pass full dish into NodeDish Apply to allow apply from ArrayBuffer type to work 2019-03-20 17:46:01 +00:00
d98762625 656cf32753 remove extra step from grunt test-node command 2019-03-20 16:41:44 +00:00
d98762625 9e2aac0696 update tests file name and linting 2019-03-20 16:34:20 +00:00
d98762625 8c48d73b03 debug why travis fails 2019-03-20 16:30:43 +00:00
d98762625 b48a55bd74 add all options to argOptions. Add some extra test case for Zip 2019-03-20 16:27:35 +00:00
d98762625 a1b116d2f5 update travis build to include node tests. Minor refactor to grunt jobs for node 2019-03-20 15:10:16 +00:00
d98762625 aad1bc898e update file shim to use detectFileType. 2019-03-20 12:38:49 +00:00
d98762625 4add484d2a update TestRegister relative path in some tests 2019-03-20 12:00:22 +00:00
d98762625 8eed2232ee add immutable presentAs method to Dish for node REPL display. add test for exact match help 2019-03-20 11:57:47 +00:00
j433866 6a01e40394 Fix bug where GIF input would error on output.
Also minor corrections to jsdocs in ImageManipulation
2019-03-20 11:20:34 +00:00
j433866 757176727d Fix the aspect ratio fix 2019-03-20 10:52:00 +00:00
j433866 d9fdae9175 Adjust css to keep aspect ratio of previewed image 2019-03-20 10:40:59 +00:00
j433866 4a84cf3ac7 Add css styling option for banner URL 2019-03-20 10:23:09 +00:00
d98762625 8f5f3e56cb prefer exact matches in help function 2019-03-20 10:23:03 +00:00
j433866 e03e51c450 Add styling of checkboxes.
Change fonts in solarized themes to match classic.
Add styling of input fields to modals
2019-03-20 10:01:19 +00:00
d98762625 f61e33aa71 update disassemble test after vendor code change 2019-03-20 09:46:53 +00:00
d98762625 4bc3fc274b Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-03-20 09:42:09 +00:00
d98762625 e3cdf6361e make unzip test accurate 2019-03-20 09:41:59 +00:00
j433866 674f879fb8 Change file thumb to normal icon when file closed 2019-03-19 16:54:50 +00:00
j433866 b195fc69dd Remove old css file 2019-03-19 14:39:46 +00:00
j433866 2049e4e1d5 Add image preview to input file overlay.
This can be turned off
2019-03-19 14:38:46 +00:00
j433866 d09ab4a153 Add new solarized light and dark themes.
Add more elements to be controlled by theme css:
- Preloader spinner colours
- Operation disable / breakpoint icons
- Auto bake checkbox
- Search highlight colour
- Categories header colour
2019-03-19 14:37:46 +00:00
j433866 328c0ade22 Merge remote-tracking branch 'upstream/master' 2019-03-19 14:21:28 +00:00
j433866 b312e17904 Change title to title case 2019-03-19 13:54:39 +00:00
j433866 2cd3e9cacd Add new implementation of gaussian blur.
Changed SharpenImage to use the new algorithm.
2019-03-19 13:54:26 +00:00
j433866 ce72acdd61 Add 'add text to image' operation.
Included variants of the Roboto fonts as bitmap fonts for jimp.
Changed webpack config to import the font files.
2019-03-19 13:53:09 +00:00
Matt b3d92b04cb Updated nodom dependency to upstream 2019-03-19 11:24:29 +00:00
j433866 8e74acbf3e Add opaque background option 2019-03-18 09:43:37 +00:00
n1474335 a5703cb4f1 Updated CHANGELOG 2019-03-15 15:17:15 +00:00
d98762625 76cc7f1169 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-03-14 17:57:53 +00:00
d98762625 b8cb7e9ba8 add tests for File and test based operations. Only unzip to go 2019-03-14 17:54:06 +00:00
d98762625 2019ae43d7 File shim now translates correctly 2019-03-14 16:33:09 +00:00
n1474335 bb5b92571e Updated CHANGELOG 2019-03-14 16:08:25 +00:00
Matt 3ad5f889a0 Wrote some tests, fixed imports for node 2019-03-14 13:37:11 +00:00
n1474335 3ff10bfeae 8.27.0 2019-03-14 12:26:07 +00:00
n1474335 c8a2a8b003 Updated CHANGELOG 2019-03-14 12:26:00 +00:00
n1474335 6acb3a7ca5 Merge branch 's2224834-feature/bombe' 2019-03-14 12:20:12 +00:00
n1474335 ef38897a01 Updated CHANGELOG 2019-03-14 12:20:05 +00:00
n1474335 33db0e666a Final tweaks to Bombe svg and preloader css 2019-03-14 12:11:41 +00:00
n1474335 cf32372a57 Added Enigma wiki article link to Enigma, Typex, Bombe and Multi-Bombe operation descriptions. 2019-03-14 12:08:35 +00:00
n1474335 b98cf9538d Long HTML output is now replaced with an overlay in the same way as long string output. 2019-03-14 11:43:23 +00:00
Matt 768fef502d Changed version of nodom to actually functioning fork 2019-03-14 11:39:46 +00:00
d98762625 d080c5dd14 debugging File shim 2019-03-14 08:27:06 +00:00
j433866 4fafa39e54 Fix magic library to better handle operation error 2019-03-13 13:09:02 +00:00
j433866 bb7487c476 Change to use new FileType library 2019-03-13 09:20:13 +00:00
j433866 308195279c Bring up to date with master 2019-03-13 09:17:43 +00:00
s2224834 1a707eab86 Merge branch 'feature/bombe' into feature/typex 2019-03-12 18:21:34 +00:00
s2224834 e2efc3e8e8 package lock changes 2019-03-12 18:21:27 +00:00
s2224834 fa6d5e60ce Merge branch 'master' into feature/bombe 2019-03-12 18:07:39 +00:00
j433866 e95b7075b9 Add convert image format operation 2019-03-12 16:29:20 +00:00
j433866 dfbc1beccd Add sharpen image operation 2019-03-12 16:24:43 +00:00
j433866 0a7a0ac681 Merge pull request #1 from gchq/master
bring up to date with master
2019-03-12 13:27:24 +00:00
n1474335 981d4be44d 8.26.3 2019-03-11 13:31:33 +00:00
n1474335 80bdf7410b Merge branch 'artemisbot-bugs/disassembler-fix' 2019-03-11 13:31:26 +00:00
Matt 6f45d33c8a Fix disassembler issue
Fix disassembler issue properly
2019-03-11 13:06:17 +00:00
Matt cd22985f11 Fix categories JSON issue 2019-03-11 12:09:29 +00:00
Matt 66c0425080 Merge branch 'master' into module-charts 2019-03-11 11:57:19 +00:00
Matt fd7fd9ca35 Remove jsdom from dependencies 2019-03-11 11:55:44 +00:00
n1474335 7b3efa746e 8.26.2 2019-03-11 11:54:19 +00:00
n1474335 90ddc2bfa7 Merge branch 'MShwed-bugs/xpath-namespace-prefix-fix' 2019-03-11 11:54:11 +00:00
n1474335 8e3425ed6d Merge branch 'bugs/xpath-namespace-prefix-fix' of https://github.com/MShwed/CyberChef into MShwed-bugs/xpath-namespace-prefix-fix 2019-03-11 11:53:06 +00:00
n1474335 c1bb42fe65 8.26.1 2019-03-11 11:44:39 +00:00
n1474335 b99f73919f Merge branch 'artemisbot-bugs/disassembler' 2019-03-11 11:44:32 +00:00
n1474335 978bf75765 Merge branch 'bugs/disassembler' of https://github.com/artemisbot/CyberChef into artemisbot-bugs/disassembler 2019-03-11 11:44:11 +00:00
d98762625 14d591caa1 more debugging 2019-03-11 09:47:58 +00:00
Matt 432d5b43a1 Fix some misspellings 2019-03-10 17:51:30 +00:00
mshwed 3412372d1e Added support for non-prefixed default namespace selectors 2019-03-10 13:02:13 -04:00
Matt ca6d472e5d Update nodom 2019-03-10 16:07:14 +00:00
Matt c2e130f369 Update disassembler 2019-03-10 13:19:04 +00:00
Matt 6501454424 Cleanup 2019-03-10 13:08:47 +00:00
Matt 0019a4e1db Found a different dom implementation that removes 6MB 2019-03-10 12:03:53 +00:00
Matt f8874fc586 Actually made operations work (and made the module 8MB)
Unfortunately they need jsdom
2019-03-10 11:44:02 +00:00
Matt 4ae875601a Ported final two chart operations 2019-03-10 10:33:47 +00:00
n1474335 e8880f068f 8.26.0 2019-03-09 07:23:57 +00:00
n1474335 45c1c23e09 Merge branch 'j433866-image-operations' 2019-03-09 07:23:31 +00:00
n1474335 e10d4bf45c Tidied up image manipulation ops 2019-03-09 07:23:11 +00:00
n1474335 369b640408 Merge branch 'master' into j433866-image-operations 2019-03-09 06:29:19 +00:00
n1474335 d2d30bf668 8.25.0 2019-03-09 06:28:05 +00:00
n1474335 dcb59edb79 Merge branch 'feature-extract-files' 2019-03-09 06:26:36 +00:00
n1474335 84d31c1d59 Added 'Move to input' button to output file list. Improved zlib extraction efficiency. 2019-03-09 06:25:27 +00:00
n1474335 58d41f4458 8.24.3 2019-03-09 05:38:13 +00:00
n1474335 360effb839 Merge branch 'j433866-fork-fix' 2019-03-09 05:37:57 +00:00
j433866 3e428c044a Add min values to operation args 2019-03-08 13:38:59 +00:00
j433866 d923c99975 Fix same bug in subsection 2019-03-07 16:33:38 +00:00
j433866 2b538061e9 Fix fork operation not setting ingredient values correctly. 2019-03-07 16:26:42 +00:00
j433866 11451ac6b9 Add image format pattern.
("borrowed" from RenderImage)
2019-03-07 13:35:37 +00:00
j433866 21a8d03201 Move parsing and generation of QR codes to lib folder.
Also rewrote QR code parsing to be more readable and actually error out properly.
2019-03-07 13:21:26 +00:00
j433866 0c9db5afe9 Fix typo 2019-03-07 11:36:29 +00:00
j433866 1031429550 Add error handling 2019-03-07 11:19:04 +00:00
j433866 4a7ea469d4 Add status messages for image operations 2019-03-07 10:03:09 +00:00
j433866 833c1cd98f Add Contain Image, Cover Image and Image Hue / Saturation / Lightness ops 2019-03-07 10:02:37 +00:00
j433866 662922be6f Add resizing status message 2019-03-06 10:32:58 +00:00
j433866 370ae323f6 Fix linting 2019-03-05 11:49:25 +00:00
j433866 514eef50de Add image filter operation 2019-03-04 14:48:17 +00:00
j433866 ec1fd7b923 Add image opacity operation 2019-03-04 14:38:25 +00:00
j433866 737ce99398 Add image brightness / contrast operation 2019-03-04 14:24:57 +00:00
j433866 4f1a897e18 Add Crop Image operation 2019-03-04 13:48:48 +00:00
j433866 588a8b2a3a Fix code syntax 2019-03-04 13:48:29 +00:00
j433866 f281a32a4e Add Wikipedia URLs 2019-03-04 13:48:13 +00:00
j433866 d09e6089ca Add min width and height values 2019-03-04 11:52:54 +00:00
j433866 7b6062a4a2 Set min blur amount to 1, add status message for gaussian blur. 2019-03-04 11:47:50 +00:00
j433866 7975fadfe9 Add options for min, max and step values for number inputs. 2019-03-04 11:46:27 +00:00
Karsten Silkenbäumer ad571e6019 Change author URL 2019-03-03 17:20:54 +01:00
Karsten Silkenbäumer 14d924f6c7 Add test for the error fixed before 2019-03-02 22:27:53 +01:00
Karsten Silkenbäumer 282f02f4d5 Fix error when decoding a text with 2+ whitespaces in AMNZ mode 2019-03-02 22:17:44 +01:00
Karsten Silkenbäumer d36cede0c7 Use better names for the alphabet selection 2019-03-02 17:55:03 +01:00
Karsten Silkenbäumer a262d70b88 Add Bacon cipher encoding 2019-03-02 17:33:17 +01:00
n1474335 9fa7edffbf Improved file extraction error handling 2019-03-02 16:12:21 +00:00
n1474335 24a47445f6 Merge branch 'master' into feature-extract-files 2019-03-02 15:40:32 +00:00
Karsten Silkenbäumer 77b098c5fe Add Bacon cipher decoding 2019-03-02 15:00:42 +01:00
d98762625 e4b688a2c3 Make Frequency dist test more sensible 2019-03-01 16:58:43 +00:00
d98762625 6d219ade2d remove legacy async api from NodeRecipe 2019-03-01 16:56:14 +00:00
d98762625 b48c16b4db Refactor Dish _translate to handle sync and async depending on environment. 2019-03-01 16:38:54 +00:00
d98762625 0a1ca18de5 refactor Dish get to handle sync and async 2019-03-01 08:59:18 +00:00
s2224834 9a0b784153 Typex: improve operation description 2019-02-28 18:56:59 +00:00
s2224834 a446ec31c7 Improve Enigma/Bombe descriptions a little. 2019-02-28 18:48:36 +00:00
s2224834 9323737d1d Bombe: fix rotor listing order for multibombe 2019-02-28 18:37:48 +00:00
s2224834 d288acdd4e Add some files that escaped commit before 2019-02-28 17:50:10 +00:00
s2224834 765aded208 Typex: add simple tests 2019-02-28 17:22:09 +00:00
s2224834 1f9fd92b01 Typex: rotors in same order as Enigma 2019-02-28 17:21:47 +00:00
s2224834 2be642e4c9 Merge branch 'feature/bombe' into feature/typex 2019-02-28 17:00:33 +00:00
s2224834 934356dea8 Tweaks for new rotor order 2019-02-28 16:56:28 +00:00
s2224834 a037bf6f9d Merge branch 'master' into feature/bombe 2019-02-28 16:29:21 +00:00
n1474335 c005c86c27 Added argSelector ingredient type and reversed rotors in Enigma and Bombe operations. 2019-02-28 16:05:23 +00:00
Matt 68278267e1 Update libyara-wasm 2019-02-23 15:13:58 +00:00
Matt da2d5674a5 Ported heatmap and hex density chart ops 2019-02-23 00:41:19 +00:00
Matt 5bb8eb22ec Merge branch 'master' into module-charts 2019-02-22 23:36:14 +00:00
j433866 0d86a7e427 Add resize algorithm option 2019-02-20 15:35:53 +00:00
j433866 9f4aa0a123 Remove trailing space 2019-02-20 13:17:57 +00:00
j433866 da838e266e Add flip image operation 2019-02-20 13:04:15 +00:00
j433866 fd160e87e8 Add image operations to Categories 2019-02-20 11:54:59 +00:00
j433866 0dd4304902 Add new Blur Image operation.
Performs both fast blur and gaussian blur
2019-02-20 11:48:24 +00:00
j433866 a0b94bba4e Change run() functions to be async 2019-02-20 11:26:39 +00:00
j433866 74c2a2b5cb Add Invert Image operation 2019-02-20 11:12:15 +00:00
j433866 b691c30677 Add dither image operation 2019-02-20 09:20:38 +00:00
j433866 01acefe4cf Remove scale image operation.
(Same functionality is implemented in Resize Image)
2019-02-19 16:20:36 +00:00
j433866 1a2c5a95c7 Add resize image operation 2019-02-19 16:19:34 +00:00
j433866 eb8725a0db Fix degrees error 2019-02-19 16:10:53 +00:00
j433866 57e1061063 Add Scale Image operation 2019-02-19 15:37:59 +00:00
j433866 91f4681a3c Add rotate image operation 2019-02-19 15:37:49 +00:00
GCHQ 77703 822a4fab86 Fix operation linting 2019-02-19 10:16:51 +00:00
GCHQ 77703 44a164ed28 Fix test script linter 2019-02-19 09:56:38 +00:00
d98762625 ff2521aa9f WIP Dish now working on dev with dynamically loaded _translate and get functions 2019-02-15 16:26:22 +00:00
d98762625 9094e8bde9 WIP tidy up. WHy is dish being passed back with chef.bake now? 2019-02-15 16:11:13 +00:00
d98762625 573a292e16 WIP dynamically define async functions in Dish, only if needed 2019-02-15 15:40:29 +00:00
d98762625 04b7f2fa8c WIP HAD to move NodeDish out - NONE of it is async! 2019-02-15 15:20:05 +00:00
GCHQ 77703 1f09c03d48 Add De Bruijn Operation 2019-02-15 14:23:16 +00:00
d98762625 aafde8986d tidy up gruntfile for node 2019-02-13 14:48:55 +00:00
d98762625 03e3ab5599 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-02-12 15:32:59 +00:00
n1474335 8148c1a8a8 8.24.2 2019-02-11 18:45:27 +00:00
n1474335 ce61bcc078 Merge branch 'd98762625-dynamic-import' 2019-02-11 18:45:00 +00:00
n1474335 49e2b05a11 Dynamic module loading is now cached and Webpack includes the import in the main chunk. 2019-02-11 18:44:41 +00:00
d98762625 c76322c40d force webpack to only emit one file when using dynamic import 2019-02-11 17:21:16 +00:00
d98762625 39c68ff26e Merge branch 'dynamic-import' into node-lib-dynamic 2019-02-11 16:56:50 +00:00
d98762625 481f2a4717 Merge branch 'master' of github.com:gchq/CyberChef into dynamic-import 2019-02-11 16:54:31 +00:00
d98762625 c01c076561 try/catch to allow chef to run from prod file 2019-02-11 16:51:23 +00:00
d98762625 2391e08ac1 tidy up 2019-02-11 15:47:28 +00:00
d98762625 a7a2fe243a prod working with mini css webpack plugin 2019-02-11 15:40:18 +00:00
n1474335 b5c655dd70 8.24.1 2019-02-11 14:48:45 +00:00
n1474335 d84a61d108 Merge branch 'j433866-open-file-button' 2019-02-11 14:48:38 +00:00
n1474335 13abbd2c5d Abstracted out loadFile logic to separate function 2019-02-11 14:48:25 +00:00
d98762625 d22eac9f35 WIP getting prod working with minicss webpack plugin 2019-02-11 14:29:29 +00:00
n1474335 d71aa8d7e2 Merge branch 'open-file-button' of https://github.com/j433866/CyberChef into j433866-open-file-button 2019-02-11 14:28:32 +00:00
n1474335 4db6199fd9 Fixed timings for Bombe animation fast rotor 2019-02-10 21:45:55 +00:00
s2224834 dd9cbbac77 Bombe: add note about rotor step in crib 2019-02-09 23:01:52 +00:00
s2224834 069d4956aa Bombe: Handle boxing stop correctly 2019-02-09 22:57:57 +00:00
s2224834 61fee3122a Bombe: add Rebuild Project to authors 2019-02-08 21:16:42 +00:00
s2224834 5a8255a9f4 Bombe: fix tests after output table patch 2019-02-08 19:25:28 +00:00
s2224834 5a2a8b4c8e Typex: input wiring is reversed 2019-02-08 18:53:08 +00:00
n1474335 1079080f5c Bombe results are now presented in a table 2019-02-08 18:41:20 +00:00
n1474335 1e914c4cf2 Fixed Bombe svg animation in standalone version 2019-02-08 18:40:09 +00:00
n1474335 53226c1050 Added populateMultiOption ingredient type 2019-02-08 18:36:59 +00:00
n1474335 7a4e0301d2 8.24.0 2019-02-08 18:07:10 +00:00
n1474335 42826e542d Updated changelog 2019-02-08 18:07:03 +00:00
n1474335 42d1c9403c Merge branch 'h345983745-dnsoverhttps' 2019-02-08 18:02:39 +00:00
n1474335 ab43635583 Tidied up 'DNS over HTTPS' operation and fixed manualBake flag. 2019-02-08 18:02:13 +00:00
n1474335 b8ecd83bfd Merge branch 'dnsoverhttps' of https://github.com/h345983745/CyberChef into h345983745-dnsoverhttps 2019-02-08 17:34:33 +00:00
n1474335 0db0ced1ab 8.23.4 2019-02-08 17:28:16 +00:00
n1474335 3d20833d42 Fixed populateOption HTML escape bug. Closes #490 2019-02-08 17:28:10 +00:00
n1474335 7d09ba5669 8.23.3 2019-02-08 17:06:42 +00:00
n1474335 310ff30278 Merge branch 'j433866-xss_fixes' 2019-02-08 17:06:32 +00:00
n1474335 821bc9405c Merge branch 'xss_fixes' of https://github.com/j433866/CyberChef into j433866-xss_fixes 2019-02-08 17:05:51 +00:00
n1474335 d54d66cffc 8.23.2 2019-02-08 16:54:11 +00:00
n1474335 d2b4c40357 Fixed BigNumber/XRegExp incompatibility. CLoses #481 2019-02-08 16:54:04 +00:00
n1474335 f48af97ddc 8.23.1 2019-02-08 15:53:42 +00:00
n1474335 f1264d6310 Update package-lock.json 2019-02-08 15:53:40 +00:00
n1474335 4dc5a1499a Merge branch 'j433866-coords-fix' 2019-02-08 15:52:40 +00:00
d98762625 dd51b675b0 removed OpModules bodge from index generation scripts 2019-02-08 14:49:19 +00:00
d98762625 7679705369 Merge branch 'dynamic-import' into node-lib-dynamic 2019-02-08 14:42:07 +00:00
d98762625 58a8af20a6 Highligting for Recipe now working. Discovered bug when highlighting on a test case 2019-02-08 14:28:53 +00:00
h345983745 75a58f465c Removed jpath import 2019-02-07 21:05:07 +00:00
s2224834 220053c044 Typex: add ring setting 2019-02-07 18:10:16 +00:00
h345983745 613cbaa556 Fixing Formating Issues 2019-02-07 08:28:23 +00:00
h345983745 0d0a634255 Added More Request Types 2019-02-06 23:27:27 +00:00
h345983745 105090db60 Spelling Check 2019-02-06 22:50:46 +00:00
h345983745 3e9c75f735 Added to Categories 2019-02-06 22:34:43 +00:00
h345983745 d42075072b Small Updates 2019-02-06 20:54:06 +00:00
h345983745 6a099f0813 Inital Commit 2019-02-06 20:20:20 +00:00
d98762625 9af5e40071 update linting to allow dybnamic import. Recipe highlight still broken 2019-02-01 14:05:48 +00:00
d98762625 4bf2a29070 WIP: bundle all css into main.css with mini-css-extract. Cannot split into vendor and styles without breaking at the moment. 2019-02-01 13:45:47 +00:00
d98762625 069d0e48c1 WIP: use mini-css-extract-plugin instead of extract-text, to work with dynamic import. Currently outputting only one css and recipe highlight doesnt work 2019-02-01 12:00:45 +00:00
d98762625 c8cb2692dd WIP: Recipe refactored to use dynamic import 2019-02-01 10:52:21 +00:00
j433866 74a22bcf9c Swap ordering of truncating and escaping 2019-01-31 15:22:25 +00:00
j433866 8b44927cb6 Fix XSS for To Table operation and Magic button 2019-01-31 15:18:37 +00:00
d98762625 781ff956e3 add dev builds for node 2019-01-23 10:06:55 +00:00
d98762625 7522e5de33 remove unnecessary operationConfig manipulation 2019-01-23 09:55:29 +00:00
j433866 3209c94622 Fix conversion breaking when compass directions are used as delimiters 2019-01-21 12:50:30 +00:00
d98762625 dd4a7f9fac Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-01-21 10:46:54 +00:00
n1474335 6f8a5ea1be Merge branch 'j433866-coordinates' 2019-01-18 17:14:39 +00:00
n1474335 69837837b0 Tidied up co-ordinate operation 2019-01-18 17:14:25 +00:00
n1474335 03d8bf2836 Merge branch 'coordinates' of https://github.com/j433866/CyberChef into j433866-coordinates 2019-01-18 16:05:44 +00:00
n1474335 eca2c142f3 8.23.0 2019-01-18 15:37:42 +00:00
n1474335 715f7bbbc2 Lint 2019-01-18 15:37:25 +00:00
n1474335 291ebd5c12 Merge branch 'artemisbot-features/yara' 2019-01-18 15:35:14 +00:00
n1474335 ba04cac7ac Tidied up YARA operation 2019-01-18 15:34:56 +00:00
j433866 acb8c0b5af Change icon from folder to input 2019-01-18 15:12:03 +00:00
j433866 0c14bacea7 Add button to input to allow opening of files using the file prompt. 2019-01-18 15:07:19 +00:00
n1474335 4cabb849f3 Merge branch 'features/yara' of https://github.com/artemisbot/CyberChef into artemisbot-features/yara 2019-01-18 14:56:26 +00:00
n1474335 445a85798b 8.22.1 2019-01-18 14:50:00 +00:00
n1474335 55775f48e9 Merge branch 'picapi-b64-description-fix' 2019-01-18 14:49:53 +00:00
j433866 b491b9d77d Move conversion of co-ordinates to run() instead of present() 2019-01-18 11:31:53 +00:00
j433866 237f792fb4 Add new Show on map operation 2019-01-18 11:19:06 +00:00
j433866 4bd923dc06 Improved handling of negative numbers and weirder inputs.
Negative numbers shouldn't make it go weird any more.
Automatic detection of input formats should be more reliable.
2019-01-17 13:53:42 +00:00
j433866 439654ed7f Add tests for new co-ordinate conversion module.
Removed To/From geohash tests
2019-01-17 13:49:36 +00:00
n1474335 87e956fe7d Added old loading icon back for initial page load. 2019-01-16 17:54:55 +00:00
n1474335 02b9dbdee9 Replaced loading animation with animated Bombe SVG 2019-01-16 17:54:55 +00:00
j433866 69797e58cb Add better error handling.
Also now doesn't do anything if there's no input
2019-01-16 16:57:58 +00:00
Matt d1961ca3fa Marginally reduced size of libyara-wasm 2019-01-16 01:15:51 +00:00
Matt 2e9b1e079c Merge remote-tracking branch 'upstream/master' into features/yara 2019-01-15 23:46:49 +00:00
Matt 3dfaaf4c25 Update libyara for test pass 2019-01-15 23:45:40 +00:00
Matt fcc39a0397 Added File upload support to textarea 2019-01-15 23:42:05 +00:00
Matt 0602f457ce Added initial tests & counts support 2019-01-15 16:24:29 +00:00
j433866 d00b0f4c0e Basically rewrote the whole thing using the new geodesy module 2019-01-15 15:55:49 +00:00
j433866 5e68959c03 Catch when OS grid references aren't calculated 2019-01-15 10:25:49 +00:00
j433866 ad4451a757 Rewrite MGRS to use new Geodesy module.
Added Ordnance Survey grid reference support
2019-01-15 10:13:11 +00:00
Callum Fraser 4d8127a7d9 Modified description of ToBase64 operation
Addresses #472
2019-01-14 22:25:49 +00:00
n1474335 cd2c8078c8 Added ELF extractor. You can now specific which categories to search for in file type operations. 2019-01-14 18:55:10 +00:00
s2224834 ffc4b0a0a8 Bombe: lol 2019-01-14 17:15:54 +00:00
j433866 ee360521bb Remove MGRS npm module 2019-01-14 16:41:06 +00:00
j433866 04b0b8c723 Tidy up code 2019-01-14 14:58:41 +00:00
j433866 b3ac8d0835 Removed some debug logging 2019-01-14 13:49:49 +00:00
j433866 1a88a0164c Fix delimiter breaking Geohash detection 2019-01-14 13:00:14 +00:00
j433866 8b77ad7748 Stop delimiters breaking MGRS conversion 2019-01-14 12:49:28 +00:00
j433866 8d1f668fc5 Remove old Geohash modules 2019-01-14 11:56:27 +00:00
j433866 68fbbb64db Add new Convert co-ordinate format module.
Also added autodetect of co-ordinate format / delimiter
2019-01-14 11:49:57 +00:00
s2224834 eee92aa1aa Bombe: fix some outdated docs 2019-01-12 12:56:21 +00:00
s2224834 74eb4cca86 Bombe: tweaks
Twiddle the default rotor sets a bit.
Add a time remaining estimate for the multibombe.
2019-01-12 01:35:24 +00:00
s2224834 49f5c94a75 Bombe: further optimisation 2019-01-12 01:10:47 +00:00
Matt 8bba4b2973 More speedrun stats (literally 10x faster) 2019-01-12 00:20:25 +00:00
s2224834 d94e8c8187 Bombe: wording/docs tweaks 2019-01-11 18:24:16 +00:00
n1474335 2307325af8 Added Zlib extraction 2019-01-11 17:58:25 +00:00
n1474335 4e57b4be88 Completed GZIP extraction 2019-01-11 17:44:13 +00:00
s2224834 21335e7d05 Bombe: Add checking machine 2019-01-11 13:18:25 +00:00
j433866 abdd70c6fa Add ConvertCoordinates to lib folder 2019-01-11 11:59:13 +00:00
s2224834 78768e00d4 Bombe: Firefox optimisation
Switch a couple of for of loops in the critical path for classic fors.
This loses about 10% performance in Chrome, but it brings Firefox
performance in line with Chrome's, rather than 2.5 times slower.
2019-01-10 18:49:06 +00:00
s2224834 3eb44708e5 Add MultiBombe
Runs the Bombe multiple times with different rotor specs.
Edits the core BombeMachine a little to add the ability to switch rotors
without rewiring everything
2019-01-10 18:04:02 +00:00
n1474335 c077b22410 Stream.readBits() method implemented. Unfinished. 2019-01-10 17:30:52 +00:00
n1474335 9787ab04cd 8.22.0 2019-01-10 15:44:02 +00:00
n1474335 79d3c90026 Merge branch 'j433866-subsection' 2019-01-10 15:43:05 +00:00
n1474335 c2068b343b Tidied up and added global matching to Subsection operation 2019-01-10 15:42:48 +00:00
j433866 9e63e40dab Add new MGRS module and update webpack-dev-server 2019-01-10 15:24:29 +00:00
n1474335 6424839731 Merge branch 'subsection' of https://github.com/j433866/CyberChef into j433866-subsection 2019-01-10 15:11:34 +00:00
n1474335 863a525625 8.21.0 2019-01-10 15:02:26 +00:00
n1474335 f82a727e24 Merge branch 'masq-insense' 2019-01-10 15:01:22 +00:00
n1474335 995fcab071 Tidied up Case Insensitive Regex ops 2019-01-10 15:01:01 +00:00
n1474335 c5270d75a1 Merge branch 'insense' of https://github.com/masq/CyberChef into masq-insense 2019-01-10 14:53:21 +00:00
s2224834 8c757d1e03 Bombe: optimise
This cuts about 85% off the execution time.
2019-01-09 21:07:05 +00:00
n1474335 324c409ff1 8.20.0 2019-01-09 16:38:53 +00:00
n1474335 1db8e6dddc Merge branch 'klaxon1-feature/lorem-ipsum-generator' 2019-01-09 16:38:46 +00:00
n1474335 c49a770c59 Tidied up Lorem Ipsum op 2019-01-09 16:36:34 +00:00
Matt dd9ba4d250 Fixed problems flagged by n's review 2019-01-09 15:28:50 +00:00
n1474335 0e601d5b5f Merge branch 'feature/lorem-ipsum-generator' of https://github.com/klaxon1/CyberChef into klaxon1-feature/lorem-ipsum-generator 2019-01-09 14:50:48 +00:00
Matt ebb632e888 Added metadata, string identifiers and operation args 2019-01-09 14:29:14 +00:00
Matt 4db2335107 Speedrunning strats (increased speed on big files) 2019-01-09 11:45:11 +00:00
Matt 26a2fb6662 Increased size of rule inp & expanded memory for wasm 2019-01-09 09:56:55 +00:00
Matt 4c1521a98e No data matches & warnings support 2019-01-08 23:26:14 +00:00
Matt df8abb099c Added code argtype 2019-01-08 22:23:14 +00:00
s2224834 e74c86842b Bombe: add trial decryption preview 2019-01-08 19:37:34 +00:00
n1474335 fe1332f18e 8.19.7 2019-01-08 18:29:14 +00:00
n1474335 cb9ab7a2c9 Fixed 'Maximise output' button functionality 2019-01-08 18:29:07 +00:00
s2224834 ad6e30f3d4 Bombe: review, tests, validation 2019-01-08 18:25:42 +00:00
n1474335 3a6b2875d5 8.19.6 2019-01-08 17:51:47 +00:00
n1474335 766de7e6fa Fixed bug in 'Regular expression' operation when highlighting lookaheads 2019-01-08 17:51:43 +00:00
Matt 13439e100e Merge remote-tracking branch 'upstream/master' into features/yara 2019-01-08 16:28:14 +00:00
Matt 5ac469b174 Added yara rule support 2019-01-08 16:19:58 +00:00
j433866 8ac5b48493 Update operation description 2019-01-08 11:51:33 +00:00
j433866 1a827ef44f Add Subsection to Flow Control category 2019-01-08 11:17:06 +00:00
j433866 0f0e346a02 Add new Subsection operation 2019-01-08 11:12:02 +00:00
s2224834 b6eb4e84e4 Add Bombe operation
Still needs some work, but functional
2019-01-07 19:48:44 +00:00
n1474335 2a6db47aeb Began implementing GZIP/DEFLATE extraction. Unfinished. 2019-01-04 18:12:49 +00:00
d98762625 f7d425189a update test sample data 2019-01-04 16:31:06 +00:00
d98762625 6ca78ce8cb Merge branch 'node-lib-tests' into node-lib 2019-01-04 16:25:48 +00:00
d98762625 4b7c927ca4 remove old node tests from ops test suite 2019-01-04 16:25:06 +00:00
n1474335 19b7957523 Added RTF extractor 2019-01-04 14:57:31 +00:00
s2224834 1b1a3c261d Typex: random rotors 2019-01-04 13:21:15 +00:00
d98762625 9d674ce5a7 move node test suite into its own grunt command 2019-01-04 12:14:02 +00:00
d98762625 f22e9ceec6 refactor TestRegister and some test suite functions into common area 2019-01-04 12:00:01 +00:00
n1474335 0d2cb02f97 Fixed FLV previous tag size error 2019-01-04 11:49:12 +00:00
d98762625 a4de937eb6 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2019-01-04 09:27:32 +00:00
n1474335 7d8d80ca2c Added extractor for MS Office 2007+ files 2019-01-03 19:01:12 +00:00
s2224834 b4e130234c Enigma: make sure op class is called Enigma 2019-01-03 18:51:39 +00:00
s2224834 53cc413eae Typex: move machine implementation to lib/ 2019-01-03 18:49:01 +00:00
n1474335 0449c46b38 Added FLV extractor. 2019-01-03 18:40:22 +00:00
s2224834 f8450183c1 Enigma: fix 4th rotor ringstellung 2019-01-03 17:51:20 +00:00
s2224834 eb1f8b4bc6 Add Typex operation
WIP
2019-01-03 16:40:29 +00:00
s2224834 088864fd9c Add Enigma operation 2019-01-03 16:36:56 +00:00
n1474335 cd0c86e0d6 File scan now uses bytesMatch() instead of signatureMatches(), reducing call stack size 2019-01-03 13:03:41 +00:00
n1474335 a56f92cdee Significantly improved performance when scanning for embedded files by implementing a fastcheck algorithm. 2019-01-02 17:50:47 +00:00
n1474335 c82971f8db 8.19.5 2019-01-01 20:49:24 +00:00
n1474335 cb2c376c63 Increasing Node memory limit from 1G to 2G 2019-01-01 20:27:38 +00:00
n1474335 bc00fa0694 8.19.4 2019-01-01 20:15:29 +00:00
n1474335 c86007da71 Removed increase-memory-limit plugin in favour of NODE_OPTIONS environment variable. 2019-01-01 20:15:16 +00:00
n1474335 1bf513ca74 8.19.3 2019-01-01 19:56:20 +00:00
n1474335 29411c903f Added increase-memory-limit plugin to TravisCI build process to reduce 'JavaScript heap out of memory' errors. 2019-01-01 19:56:12 +00:00
n1474335 017dde364c 8.19.2 2019-01-01 19:22:10 +00:00
n1474335 c123d7370a Merge branch 'edwardwall-patch-2' 2019-01-01 19:21:11 +00:00
n1474335 76f1e5e8f3 Merge branch 'patch-2' of https://github.com/edwardwall/CyberChef into edwardwall-patch-2 2019-01-01 19:20:07 +00:00
n1474335 4e466c7886 8.19.1 2019-01-01 19:19:16 +00:00
n1474335 d469fb9c58 Updated dependencies 2019-01-01 19:19:07 +00:00
n1474335 4c285bce57 Refactored scanning for file types to be more than twice as fast. 2019-01-01 15:12:01 +00:00
Edward Wall 050ab03448 Simplify to improve readability 2018-12-30 17:06:48 +00:00
Edward Wall 40acf751a8 Update to understand Generalized / UTC Time
Future proofing for when certificates with dates after 2049 begin being issued.
These certificates' dates will be in Generalized Time not UTC Time as per RFC 5280
2018-12-30 16:46:18 +00:00
Spencer Walden 126ad585c0 Registers tests for 'To/From Case Insensitive Regex' operations 2018-12-30 03:26:44 -08:00
Spencer Walden 1d04b649e0 Adds 'To/From Case Insensitive Regex' operations under 'Utils' 2018-12-30 03:26:44 -08:00
Spencer Walden b750006cf0 Adds tests for 'To/From Case Insensitive Regex' operations 2018-12-30 03:26:44 -08:00
Spencer Walden 3c16b839b6 Adds 'From Case Insensitive Regex' operation 2018-12-30 03:26:44 -08:00
Spencer Walden 32aea6b86c Adds 'To Case Insensitive Regex' operation 2018-12-30 03:26:44 -08:00
Edward Wall 688c2d0df5 Update ParseX509Certificate.mjs 2018-12-30 03:15:07 +00:00
n1474335 ede75530d0 Added PNG and BMP extractors 2018-12-30 02:21:45 +00:00
n1474335 3ae225ac59 Untar operation now uses lib/Stream library 2018-12-30 01:36:58 +00:00
n1474335 fd07b89028 Merge branch 'master' into feature-extract-files 2018-12-30 01:16:46 +00:00
n1474335 0cea56dc62 8.19.0 2018-12-30 01:07:54 +00:00
n1474335 bb44268c30 Merge branch 'feature-browser-testsuite' 2018-12-30 01:07:42 +00:00
n1474335 19b3dcf1c2 Updated CHANGELOG 2018-12-30 01:07:26 +00:00
n1474335 71e0a4e0ce Increased UI test timeouts 2018-12-30 00:47:10 +00:00
n1474335 7f2e879e24 Added explicit bake after input added in test suite. 2018-12-30 00:37:44 +00:00
n1474335 840e44deac Tidied up UI tests 2018-12-30 00:26:28 +00:00
n1474335 f7707faece Added Chrome to TravisCI config 2018-12-30 00:02:41 +00:00
n1474335 b631e3fef6 Added nightwatch tests to TravisCI build process for prod and inline versions. 2018-12-29 23:46:13 +00:00
n1474335 b0fb9db4b8 Added nightwatch.js test suite for confirming that the app loads correctly and can run operations from each module. Currently only support the latest version of Chrome. 2018-12-29 02:58:05 +00:00
n1474335 c7e9115994 Restructured tests directory 2018-12-28 21:49:40 +00:00
Klaxon f2d115ee4d add lorem ipsum generator 2018-12-29 00:44:59 +10:00
n1474335 0198f05112 Added and improved file signatures. 2018-12-27 00:03:41 +00:00
n1474335 729307336e Converted all previous file signatures to the new format. 2018-12-26 23:19:46 +00:00
n1474335 f4f9b5c91c Added 'isImage' and 'isType' functions 2018-12-26 18:40:27 +00:00
n1474335 f355fe3447 Merge branch 'feature-extract-files' of github.com:gchq/CyberChef into feature-extract-files 2018-12-26 18:01:55 +00:00
n1474335 321718d43a Merge branch 'master' into feature-extract-files 2018-12-26 16:57:34 +00:00
n1474335 a1b161493c 8.18.1 2018-12-26 16:50:36 +00:00
n1474335 5acee80463 'editableOption's are now full width. 'editableOptionShort' type added to replace the old style. 2018-12-26 16:50:32 +00:00
n1474335 e6932401ad 8.18.0 2018-12-26 16:35:34 +00:00
n1474335 7a4eff0f5c Merge branch 'artemisbot-features/colour-channel' 2018-12-26 16:33:26 +00:00
n1474335 8b533e9893 Tidied up 'Split Colour Channels' operation and added 'Multimedia' category 2018-12-26 16:33:10 +00:00
n1474335 02b92c7977 Merge branch 'features/colour-channel' of https://github.com/artemisbot/CyberChef into artemisbot-features/colour-channel 2018-12-26 16:10:44 +00:00
n1474335 e386863bdb 8.17.2 2018-12-26 00:39:38 +00:00
n1474335 16be7cb28a Fixed grunt-webpack circular reference issue 2018-12-26 00:39:30 +00:00
n1474335 f6d97c19d9 8.17.1 2018-12-26 00:01:21 +00:00
n1474335 8fef01d961 Fixed bundle analyzer filepath 2018-12-26 00:01:12 +00:00
n1474335 43dcd544f2 Added webpack-bundle-analyzer to production build. Refactored some modules to improve performance. Removed moment-timezone from Utils to drastically reduce module size. 2018-12-25 23:58:00 +00:00
n1474335 b29bb6fdd7 Added 'DishError' and refined test results. 2018-12-25 22:38:53 +00:00
n1474335 d2325306db 8.17.0 2018-12-25 21:55:51 +00:00
n1474335 dfe31980b7 Merge branch 'j433866-qrcodes' 2018-12-25 21:55:35 +00:00
n1474335 9734b78aeb Tidied up QR code operations 2018-12-25 21:54:38 +00:00
n1474335 4ee0800990 Merge branch 'qrcodes' of https://github.com/j433866/CyberChef into j433866-qrcodes 2018-12-25 19:07:59 +00:00
n1474335 387008bd9c 8.16.1 2018-12-25 19:02:13 +00:00
n1474335 bf24547202 The 'option' and 'editableOption' arguments can now specify a 'defaultIndex' to populate, instead of using the first in the provided list. 2018-12-25 19:02:05 +00:00
Matt C 454ef0076b Disabled tests 2018-12-21 17:19:33 +00:00
Matt C 18693d2471 Add tests, however non-functional due to lack of File in Node
Also add jimp to package.json
2018-12-21 17:17:11 +00:00
Matt C 5a9583c970 Add to categories 2018-12-21 17:15:30 +00:00
Matt C 0046f7e3d7 Added colour channel splitting support 2018-12-21 17:08:09 +00:00
n1474335 8d3836cb16 Added support for a number of further file types and file detection methods. 2018-12-21 12:48:08 +00:00
j433866 c2f6b8df66 Add tests for Parse QR Code module 2018-12-21 11:26:03 +00:00
j433866 d0e428b728 Improve image normalising 2018-12-21 11:24:31 +00:00
j433866 ae5128a33a Always generate a PNG if the format isn't SVG 2018-12-21 11:23:51 +00:00
d98762625 83fa50bf13 linting 2018-12-21 10:24:20 +00:00
d98762625 3efe9309ef Merge branch 'arg-options' into node-lib 2018-12-21 09:48:01 +00:00
d98762625 456b85ed03 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2018-12-21 09:47:28 +00:00
d98762625 6bc5f87cb7 Merge branch 'master' of github.com:gchq/CyberChef into arg-options 2018-12-21 09:47:14 +00:00
d98762625 a010bba047 add test and change name of property to argOptions 2018-12-21 09:46:30 +00:00
j433866 ed25017e2d Add process.browser to webpack config, so we don't include stuff we don't need 2018-12-20 14:46:24 +00:00
j433866 e5b2b84073 Add new ParseQRCode operation 2018-12-20 14:45:23 +00:00
j433866 1953d9a4c8 Add Jimp and jsqr modules 2018-12-20 14:42:32 +00:00
j433866 b3113c109b Change module to Image, change default format value to PNG 2018-12-20 14:42:12 +00:00
n1474335 9829491c4c Merge branch 'master' into feature-extract-files 2018-12-20 12:28:23 +00:00
n1474335 8c3569ea63 8.16.0 2018-12-19 17:59:55 +00:00
n1474335 ae28d476de Merge branch 'anthony-arnold-play-media' 2018-12-19 17:58:51 +00:00
n1474335 01c4cfdc8d Tidied up 'Play Media' operation 2018-12-19 17:58:38 +00:00
n1474335 8c6c3a1c01 Merge branch 'play-media' of https://github.com/anthony-arnold/CyberChef into anthony-arnold-play-media 2018-12-19 17:39:07 +00:00
n1474335 f367c1f78b 8.15.1 2018-12-19 17:25:05 +00:00
n1474335 13d87d397d Merge branch 'j433866-master' 2018-12-19 17:24:52 +00:00
n1474335 ed2c886359 Magic crib now only applies after all branches have been explored. 2018-12-19 17:24:38 +00:00
n1474335 6337e84708 Merge branch 'master' of https://github.com/j433866/CyberChef into j433866-master 2018-12-19 16:38:34 +00:00
j433866 ae20a951be Add customisation arguments.
Add presentation of QR code in HTML.
2018-12-19 14:43:31 +00:00
Anthony Arnold 866dd546c8 Add the Play Media operation and place it under a new "Multimedia" category. Move the Render Image to this new category as well. 2018-12-20 00:05:10 +10:00
j433866 2070e1a96b Add new Generate QR Code module 2018-12-19 13:27:45 +00:00
j433866 952f49e2e1 Add qr-image to package 2018-12-19 13:27:18 +00:00
j433866 f600571c6d Fix to make the filter work when intensive mode was turned on. 2018-12-19 09:42:09 +00:00
n1474335 e6fb0be1d0 Refactored file type detection engine 2018-12-18 17:44:42 +00:00
j433866 5d4c7244e1 Add note about crib to operation description 2018-12-18 16:52:09 +00:00
n1474335 d02124550b Merge branch 'master' into feature-extract-files 2018-12-18 15:45:53 +00:00
j433866 b6bdcaa71f Rename output filter argument to Crib 2018-12-18 14:19:52 +00:00
j433866 c8eab5d218 Commenting 2018-12-18 14:06:39 +00:00
n1474335 8ab56a29ac 8.15.0 2018-12-18 13:50:30 +00:00
n1474335 973b5f3f5c Merge branch 'Cynser-text-brute-force' 2018-12-18 13:50:23 +00:00
n1474335 076a1f97c2 Tidied up 'Text Encoding Brute Force' operations and updated CHANGELOG 2018-12-18 13:50:10 +00:00
n1474335 d96ef37d81 Merge branch 'text-brute-force' of https://github.com/Cynser/CyberChef into Cynser-text-brute-force 2018-12-18 12:28:27 +00:00
n1474335 56f8302402 8.14.0 2018-12-18 12:20:03 +00:00
n1474335 97e6a7cbd8 Merge branch 'tcode2k16-master' 2018-12-18 12:19:56 +00:00
n1474335 d89d79116c Cleaned up Base62 ops and updated CHANGELOG 2018-12-18 12:19:42 +00:00
j433866 367d79e820 Fix filtering to work on all the data and not just the result snippet 2018-12-18 11:55:49 +00:00
j433866 283d7f2159 Add Output Filter option to Magic operation 2018-12-18 10:40:18 +00:00
Cynser dacb3ef6c3 Added decode option 2018-12-17 19:39:12 +00:00
tcode2k16 22454ae842 Add "To Base62" and "From Base62" operations 2018-12-17 12:37:00 +08:00
n1474335 79b9b63982 8.13.0 2018-12-15 00:26:41 +00:00
n1474335 2f68bf30a4 Merge branch 'jarmovanlenthe-master' 2018-12-15 00:26:31 +00:00
n1474335 50f078cc45 Updated CHANGELOG 2018-12-15 00:26:15 +00:00
n1474335 47a410d6ab Merge branch 'master' of https://github.com/jarmovanlenthe/CyberChef into jarmovanlenthe-master 2018-12-15 00:19:16 +00:00
n1474335 31cbf8cccc 8.12.4 2018-12-15 00:16:23 +00:00
n1474335 88bd321e3e Merge branch 'imhotepisinvisible-master' 2018-12-15 00:16:13 +00:00
Jarmo van Lenthe b4a586c0b9 Some lets to consts and removing of trailing spaces from grunt lint 2018-12-14 22:35:43 +01:00
Oliver Grubin 63593f1b6c Fix HMAC operation when hex key has bytes >= 0x80 (#437)
Add test vectors from RFC4231
2018-12-14 21:32:44 +00:00
Jarmo van Lenthe dcff8971e8 Added simple A1Z26 'cipher' 2018-12-14 22:29:51 +01:00
n1474335 6aa9d2b492 Added 'Extract Files' operation and 'Forensics' category. 2018-12-14 16:43:03 +00:00
Cynser 3f7059a235 Remove unnecessary escape character 2018-12-12 17:49:11 +00:00
Cynser 71c743ff5a Add Text Encoding Brute Force operation 2018-12-12 17:34:45 +00:00
d98762625 19366e3624 arg array options to wrapped func 2018-12-07 15:46:05 +00:00
d98762625 18f6ab451d pull from master 2018-12-07 13:27:23 +00:00
n1474335 15fbe5a459 8.12.3 2018-11-23 16:07:30 +00:00
n1474335 cd47394709 Merge branch 'PhillipNordwall-JSON_Object_Sort' 2018-11-23 16:07:21 +00:00
n1474335 6f4ee8b7b6 Tidied JSON Beautify op. Changed default indent to 4 spaces instead of a tab. 2018-11-23 16:05:51 +00:00
n1474335 8c5d05b611 Merge branch 'JSON_Object_Sort' of https://github.com/PhillipNordwall/CyberChef into PhillipNordwall-JSON_Object_Sort 2018-11-23 15:56:59 +00:00
n1474335 3bdcf4d851 8.12.2 2018-11-23 14:58:38 +00:00
n1474335 1d1c69ca51 Updated magic pattern matches for QP and B64 encodings to handle whitespace better 2018-11-23 14:58:30 +00:00
Phillip Nordwall c4c679021d Adding Sort Object Keys, and tests for it. 2018-11-22 11:10:10 -08:00
Phillip Nordwall c16d13e2c9 Adding test cases for JSON Minify 2018-11-22 11:07:48 -08:00
Phillip Nordwall 97613eb3c7 Adding test cases for JSON Beautify 2018-11-22 10:31:22 -08:00
n1474335 a946d04a72 8.12.1 2018-11-21 17:48:03 +00:00
n1474335 cc35ec82eb Fixed babel transpilation of jsesc and crypto-api 2018-11-21 17:47:56 +00:00
n1474335 d6604e0008 Updated CHANGELOG 2018-11-21 12:48:27 +00:00
n1474335 b9e63efc37 Fixed version links in CHANGELOG 2018-11-21 12:40:55 +00:00
n1474335 b458707921 8.12.0 2018-11-21 12:29:25 +00:00
n1474335 6ec52c6cd2 Merge branch 'bwhitn-citrix' 2018-11-21 12:28:36 +00:00
n1474335 79d7a5dd87 Tidied up Citrix CTX1 operations and updated CHANGELOG 2018-11-21 12:28:19 +00:00
n1474335 1653d0212a Merge branch 'citrix' of https://github.com/bwhitn/CyberChef into bwhitn-citrix 2018-11-21 10:23:39 +00:00
Brian Whitney c378bcb00b Fixed lint issues 2018-11-20 11:24:50 -05:00
Brian Whitney 215e7a5f5d Citrix CTX1 encoding/decoding 2018-11-20 11:09:52 -05:00
bwhitn 6b686681d5 Encoding ctx1 2018-11-19 23:48:33 -05:00
n1474335 20ea050728 Updated description for 'Substitute' to include note about escaping backslashes. 2018-11-19 14:54:37 +00:00
n1474335 4b6132a2d7 8.11.2 2018-11-19 14:34:56 +00:00
n1474335 4cf80e3ebb Added RFC numbers to relevant Base64 alphabets. Closes #410 2018-11-19 14:34:52 +00:00
n1474335 045747f543 8.11.1 2018-11-14 12:27:55 +00:00
n1474335 b10c5e3256 Fixed faulty package-lock.json 2018-11-14 12:27:47 +00:00
n1474335 69df2e4183 Updated comments 2018-11-13 18:05:52 +00:00
n1474335 12ebd35c4d 8.11.0 2018-11-13 17:56:46 +00:00
n1474335 30c5f76cf0 Updated changelog 2018-11-13 17:56:40 +00:00
n1474335 3a979b6cda 'JSON to CSV' operation now escapes characters correctly. Added tests for CSV/JSON operations. 2018-11-13 17:54:43 +00:00
n1474335 863bdffa84 Added 'CSV to JSON' and 'JSON to CSV' operations. Closes #277 2018-11-09 17:40:19 +00:00
n1474335 42b956e402 Fixed JSDoc comment 2018-11-09 15:28:47 +00:00
n1474335 4acf7b4e4f 8.10.2 2018-11-09 15:25:22 +00:00
n1474335 42e881326f Added 'Binary' key option to all bitwise operations. Closes #398 2018-11-09 15:25:16 +00:00
d98762625 b19f8f65a4 update HMAC test after merge and add loader to allow external uglifyjs plugin to work for node builds 2018-11-09 14:40:40 +00:00
d98762625 97255bbb33 merge upstream 2018-11-09 12:33:19 +00:00
n1474335 3c4893d7c7 8.10.1 2018-11-07 15:20:51 +00:00
n1474335 027aca4ab2 Merge branch 'qistoph-NumSortHex' 2018-11-07 15:20:43 +00:00
n1474335 2d471f551f Lint 2018-11-07 15:20:09 +00:00
n1474335 5c598b69b0 Merge branch 'NumSortHex' of https://github.com/qistoph/CyberChef into qistoph-NumSortHex 2018-11-07 15:15:39 +00:00
n1474335 037300de79 8.10.0 2018-11-07 15:10:57 +00:00
n1474335 6990dcae89 Updated changelog 2018-11-07 15:10:25 +00:00
n1474335 6e81d6dfcd Merge branch 'klaxon1-feature/remove-letter-accents' 2018-11-07 15:08:09 +00:00
n1474335 cea30465d8 Changed 'Remove Letter Accents' to 'Remove Diacritics' 2018-11-07 15:07:54 +00:00
n1474335 b301d16cb2 Merge branch 'feature/remove-letter-accents' of https://github.com/klaxon1/CyberChef into klaxon1-feature/remove-letter-accents 2018-11-07 14:57:05 +00:00
n1474335 19c002fcdd 8.9.2 2018-11-07 14:40:13 +00:00
n1474335 ab3a73fe58 Merge branch 'qistoph-FromNegs' 2018-11-07 14:39:51 +00:00
n1474335 91fc2c28dc Added signed feature to 'To Decimal' 2018-11-07 14:39:33 +00:00
n1474335 ca47ba3c7c Merge branch 'FromNegs' of https://github.com/qistoph/CyberChef into qistoph-FromNegs 2018-11-07 14:23:39 +00:00
n1474335 e1b456c01c 8.9.1 2018-11-07 14:21:26 +00:00
n1474335 5eb7e00eac Merge branch 'qistoph-HmacToggleStr' 2018-11-07 14:21:18 +00:00
n1474335 8bcf68c8a1 Merge branch 'HmacToggleStr' of https://github.com/qistoph/CyberChef into qistoph-HmacToggleStr 2018-11-07 14:18:24 +00:00
n1474335 520eaedd9a 8.9.0 2018-11-07 13:23:26 +00:00
n1474335 4c5e664ce0 Merge branch 'arnydo-add_url_defang' 2018-11-07 13:23:17 +00:00
n1474335 53c500eb1b Added various options to the 'Defang URL' operation. 2018-11-07 13:23:05 +00:00
n1474335 253346a201 Merge branch 'add_url_defang' of https://github.com/arnydo/CyberChef into arnydo-add_url_defang 2018-11-07 12:29:58 +00:00
n1474335 c5d82a76ab 8.8.8 2018-11-07 12:29:32 +00:00
n1474335 18a9dfffc7 Updated dependencies. Removed shim from HMAC op and postinstall js-to-mjs step due to CryptoAPI fixes. 2018-11-07 12:29:23 +00:00
n1474335 38838e4dca 8.8.7 2018-11-06 18:52:31 +00:00
n1474335 5c151d727b Merge branch 'bwhitn-bugfixes' 2018-11-06 18:52:17 +00:00
n1474335 2d5b157c91 Merge branch 'bugfixes' of https://github.com/bwhitn/CyberChef into bwhitn-bugfixes 2018-11-06 18:51:40 +00:00
n1474335 10d3d27a33 8.8.6 2018-11-05 12:48:29 +00:00
n1474335 1614442bd7 Fixed theming issues 2018-11-05 12:48:22 +00:00
bwhitn a3c5b1e107 Simplified while loop in FromBase58 to match ToBase58 2018-10-28 18:37:00 -04:00
Chris van Marle 3f0af9cdea Add tests for From Decimal 2018-10-22 17:51:26 +08:00
Brian Whitney f4de4de8c1 Fixing the babel, scrypt, and base58 issues 2018-10-21 21:10:49 -04:00
arnydo 69033a7343 Add Defang URL 2018-10-16 15:03:29 -04:00
arnydo 5a22106731 Create DefangURL.mjs 2018-10-16 15:02:39 -04:00
d98762625 5155d0ed56 Merge branch 'qistoph-RegexTooltip' 2018-10-12 15:44:17 +01:00
Chris van Marle 9be674103f Tooltip regex matches #279
Tooltip shows offset and matched groups
2018-10-12 15:42:44 +01:00
Chris van Marle ba24e12454 Update hexadecimal sort after review
- Use Array.map instead of for-loop
- Add test case
2018-10-12 15:39:06 +02:00
Chris van Marle b76aa16143 Fix Hash test 2018-10-12 13:54:40 +02:00
d98762625 8f7bb3a7c9 Merge pull request #371 from OllieGeek/master
CSS label / register-list Aesthetics
2018-10-12 12:12:48 +01:00
Chris van Marle be2b466376 Use toggleString for Key in HMAC #263 2018-10-12 13:05:32 +02:00
n1474335 f957925aac 8.8.5 2018-10-12 10:51:01 +00:00
n1474335 1bf8d63d1a Merge branch 'Cynser-fix-wiki-urls' 2018-10-12 10:50:27 +00:00
d98762625 214d6c4405 merge from upstream 2018-10-12 11:46:50 +01:00
n1474335 8875144307 Merge branch 'fix-wiki-urls' of https://github.com/Cynser/CyberChef into Cynser-fix-wiki-urls 2018-10-12 10:45:54 +00:00
d98762625 fa87fc8325 replace operations on Dish with apply 2018-10-12 11:44:19 +01:00
n1474335 d5c01f387a 8.8.4 2018-10-12 10:43:01 +00:00
n1474335 32709cd60f Merge branch 'klaxon1-feature/improve-email-extract' 2018-10-12 10:42:21 +00:00
n1474335 aaf0a91975 Fixed populateOption overflows 2018-10-12 10:42:03 +00:00
n1474335 6cc6230b91 Merge branch 'feature/improve-email-extract' of https://github.com/klaxon1/CyberChef into klaxon1-feature/improve-email-extract 2018-10-12 10:34:00 +00:00
n1474335 dd630f20f8 8.8.3 2018-10-12 10:28:23 +00:00
n1474335 0c6efd95fa Modified bzip2 library export to use ES6 syntax. Fixes #382. 2018-10-12 10:28:15 +00:00
Chris van Marle a276378887 Enable parsing of negative decimals #176 2018-10-12 10:08:24 +02:00
Cynser 98d861a639 Add check for Forensics Wiki URLs 2018-10-11 17:27:51 +01:00
Chris van Marle 3b3c27072f Fix lint errors 2018-10-11 15:50:58 +02:00
Klaxon 3089c39369 add test 2018-10-11 22:26:44 +10:00
Chris van Marle 0cbb17f7ce Support hexadecimal and other bases in numeric sorting 2018-10-11 14:23:05 +02:00
Klaxon 54793f2b78 update operation 2018-10-11 21:52:49 +10:00
Klaxon f1ffe19ec8 Merge branch 'master' into feature/remove-letter-accents 2018-10-11 21:28:04 +10:00
Klaxon e638fb69b5 fix comment 2018-10-11 20:52:12 +10:00
Klaxon 718a94b5e0 add tests for internationalized email addresses 2018-10-11 20:42:16 +10:00
Klaxon 3079059ce3 Update regex to support a wider variety of email addresses. 2018-10-11 18:25:05 +10:00
n1474335 d6c6981bc0 8.8.2 2018-10-10 15:49:11 +00:00
n1474335 8aeb7b60a7 Updated dependencies 2018-10-10 15:49:07 +00:00
n1474335 9197ac6510 8.8.1 2018-10-10 14:08:32 +00:00
n1474335 b67ad3073c Merge branch 'Cynser-csv-escape' 2018-10-10 14:08:20 +00:00
n1474335 4a4f37f888 Merge branch 'csv-escape' of https://github.com/Cynser/CyberChef into Cynser-csv-escape 2018-10-10 14:06:49 +00:00
n1474335 c55331f220 8.8.0 2018-10-10 13:59:37 +00:00
n1474335 757ec98554 Updated CHANGELOG 2018-10-10 13:59:28 +00:00
n1474335 14309f2069 Merge branch 'GCHQ77703-tlv' 2018-10-10 13:56:47 +00:00
n1474335 e6b89d571e Tidied up TLV operation and tests 2018-10-10 13:56:20 +00:00
Cynser d957198fd6 Make the check for Wikipedia URLs slightly stricter 2018-10-07 22:52:08 +01:00
Cynser 903bd22999 Stop treating backslashes in CSV as escape character 2018-10-07 22:20:43 +01:00
d98762625 48f3a3b18f Do not mangle names on minification for Node prod build - property names are used for search in bake 2018-10-05 18:24:06 +01:00
d98762625 25e0585742 Improve use of files as input. Add dish to repl 2018-10-05 18:06:15 +01:00
Klaxon 04ee2fb3e4 add function to replace accent chars with latin chars 2018-10-03 13:26:01 +10:00
Klaxon ac2466a304 create operation from npm run newop 2018-10-03 13:11:22 +10:00
Klaxon ab4c9ef0d6 fix comment 2018-10-02 15:12:51 +10:00
Klaxon a69063de9b add tests 2018-10-02 13:51:55 +10:00
Klaxon 62b76777c0 update regex to match more email address variations 2018-10-02 13:40:47 +10:00
d98762625 431f1d4be0 housekeeping & add repl command to package 2018-09-27 17:51:44 +01:00
OllieGeek 32a91bda0a CSS label / register-list Aesthetics
Occasionally depending on the page width and the operation used, the label.bmd-label-floating's wraps and covers the input - CSS to hide the wrap

On register-list, if the regex match is not a word and longer than the div, it'll over run - CSS of word-break: break-all
2018-09-24 22:56:38 +01:00
d98762625 cc840c050b Add header to repl. Use uppercase Dish in chef export. Fix SyncDish constructor call 2018-09-21 12:24:34 +01:00
d98762625 e19d3d0d06 simplify repl-index - no longer needs its own config script. Just needs grunt node. 2018-09-04 10:08:05 +01:00
d98762625 749a587eb2 fix tests after merge; remove detectFileType as it behaves erratically 2018-09-04 09:55:41 +01:00
d98762625 5047619e54 Merge branch 'master' of github.com:gchq/CyberChef into node-lib 2018-09-04 09:42:05 +01:00
d98762625 63a23e4dcc make chef.help emulate search function in UI. Didnt extract search logic from web as it is fairly entwined. 2018-09-04 09:34:55 +01:00
n1474335 a15af602e0 Merge branch 'tlv' of https://github.com/GCHQ77703/CyberChef into GCHQ77703-tlv 2018-08-31 15:12:54 +00:00
d98762625 3466f4e452 add help, bake to top level export so theyre in the expected place in ES5 chef 2018-08-31 15:17:33 +01:00
n1474335 ec9dfd2918 Updated NPM token 2018-08-31 14:08:18 +00:00
d98762625 b36e3adf7c add assertions for chef.bake leniancy on op names 2018-08-31 15:03:53 +01:00
n1474335 016086ef4e 8.7.0 2018-08-31 14:00:29 +00:00
n1474335 2e5ea968ee Updated CHANGELOG 2018-08-31 14:00:24 +00:00
n1474335 5dde1c1c04 Merge branch 'GCHQ77703-jwt' 2018-08-31 13:58:33 +00:00
n1474335 be14d56eae Tidied up JWT operations 2018-08-31 13:58:06 +00:00
d98762625 c6a292bccb rename node Recipe > NodeRecipe to avoid naming confusion 2018-08-31 14:52:14 +01:00
d98762625 f51d924ec9 Remove duplicate wiping of opconfig in node index config script 2018-08-31 14:48:46 +01:00
d98762625 96d5930f05 Throw ExcludedOperationError when excluded operation is called from API 2018-08-31 14:43:14 +01:00
d98762625 7c9ebafd00 toggleString args now additionally accept just input value, taking first option as default. 2018-08-31 13:45:12 +01:00
n1474335 100b097ace Merge branch 'jwt' of https://github.com/GCHQ77703/CyberChef into GCHQ77703-jwt 2018-08-31 12:20:37 +00:00
GCHQ 77703 3833c5f9fe Rename operation, add working tests, add info URL 2018-08-31 13:20:28 +01:00
d98762625 f6c4b5073c Expose Dish (SyncDish) in API and make it composable. 2018-08-31 13:09:22 +01:00
d98762625 f73452e01f making SyncDish composable! we want to exclude certain ops from top level api export (chef, etc) and make an Order (or something) class to start the chain off maybe? 2018-08-31 13:09:22 +01:00
d98762625 55f7cac526 Remove Buffer from Dish. Convert into ByteArray in api and then pass in as ArrayBuffer. Add some PNG files to tests 2018-08-31 13:08:55 +01:00
n1474335 3470dd9f3b Merge branch 'GCHQ77703-alphabetical' 2018-08-31 11:41:43 +00:00
Matt C 31e758ca45 Attempt to make RSA key generation functional 2018-08-31 11:25:05 +01:00
GCHQ 77703 f81ca3ba60 Implement RSA generation and signing of messages 2018-08-30 22:38:01 +01:00
GCHQ 77703 c5e8649284 alphabetically sort tests 2018-08-29 22:48:47 +01:00
GCHQ 77703 a95f43aa4d Implement tests, fix options argument 2018-08-29 22:43:10 +01:00
n1474335 0420aa8edb Merge branch 'Sam-Dowling-patch-1' 2018-08-29 19:09:53 +00:00
n1474335 806b43dfec Merge branch 'patch-1' of https://github.com/Sam-Dowling/CyberChef into Sam-Dowling-patch-1 2018-08-29 19:09:19 +00:00
n1474335 98f4fe4c2b 8.6.2 2018-08-29 19:06:02 +00:00
n1474335 0d63b3cbae JSON output is now indented by default. Closes #350. 2018-08-29 19:05:58 +00:00
n1474335 7061c05f77 8.6.1 2018-08-29 18:58:01 +00:00
n1474335 9b9a182f9f Merge branch 'klaxon1-feature/improve-parse-ip-range' 2018-08-29 18:57:08 +00:00
n1474335 2d9e7fcc6d Added full stop to operation description 2018-08-29 18:56:50 +00:00
n1474335 56946a66aa Merge branch 'feature/improve-parse-ip-range' of https://github.com/klaxon1/CyberChef into klaxon1-feature/improve-parse-ip-range 2018-08-29 18:48:29 +00:00
n1474335 c9242e32fe Auto-generated configs and modules are now cleaned when starting a new dev or prod task 2018-08-29 18:21:46 +00:00
n1474335 22e8883934 8.6.0 2018-08-29 18:04:55 +00:00
n1474335 552a18d89a Updated CHANGELOG 2018-08-29 18:04:49 +00:00
n1474335 6b725e9114 Merge branch 'GCHQ77703-master' 2018-08-29 18:00:06 +00:00
n1474335 415beaa0b0 Tidied up Geohash operations 2018-08-29 17:59:48 +00:00
n1474335 e9fe227ed7 Merge branch 'master' of https://github.com/GCHQ77703/CyberChef into GCHQ77703-master 2018-08-29 17:48:23 +00:00
n1474335 c1be109592 8.5.1 2018-08-29 17:36:05 +00:00
n1474335 88e603bbf1 Merge branch 'PenguinGeorge-cascadexor-new' 2018-08-29 17:35:13 +00:00
n1474335 c7b2095bb4 Updated package-lock.json 2018-08-29 17:34:47 +00:00
n1474335 7396117d89 Merge branch 'cascadexor-new' of https://github.com/PenguinGeorge/CyberChef into PenguinGeorge-cascadexor-new 2018-08-29 17:31:59 +00:00
Sam Dowling fd96bf345b Fixed typo
Fixed typo in operation description.
Wirlpool -> Whirlpool
2018-08-29 17:15:52 +01:00
Klaxon 2820660264 fix regex issues and ESlint errors and warnings
fix comment

fix ESlint errors and warnings

fix regex

add author
2018-08-28 23:07:53 +10:00
Klaxon 86145dbf67 add tests 2018-08-28 23:07:48 +10:00
Klaxon 135b17186e update description 2018-08-28 23:07:40 +10:00
Klaxon ce494339ef add parse IPv6 list 2018-08-28 23:07:32 +10:00
Klaxon dd5af7eb10 add parse IPv4 list 2018-08-28 23:07:04 +10:00
GCHQ 77703 3abe99078e Fix linting 2018-08-27 16:03:15 +01:00
GCHQ 77703 edbd540c68 Add Dysfunctional Test 2018-08-27 15:42:07 +01:00
GCHQ 77703 06d9302d96 Implement TLV / KLV 2018-08-27 14:57:24 +01:00
GCHQ 77703 032b4bed7f Add Length Value Decoder Operatoin 2018-08-27 01:17:06 +01:00
GCHQ 77703 8559f5c8ea Add JWT Verify, Decode and Sign 2018-08-26 23:16:13 +01:00
GCHQ 77703 91133172d5 Remove subdomain from Wikipedia 2018-08-26 18:51:52 +01:00
GCHQ 77703 001f3f30cd Remove multi-line operations 2018-08-26 18:06:02 +01:00
GCHQ 77703 a1b1059ad1 Revert package-lock.json changes 2018-08-26 17:39:33 +01:00
GCHQ 77703 69a0122fea Fix "From Geohash" test 2018-08-26 17:20:50 +01:00
GCHQ 77703 3d505b4248 Add ToGeohash and FromGeohash operations 2018-08-26 14:27:15 +01:00
George J 70d4e3394c Updated XOR to include Cascade scheme 2018-08-24 22:33:24 +01:00
n1474335 3905c01a0d 8.5.0 2018-08-24 01:07:56 +01:00
n1474335 2a49af1ec3 'To Braille' and 'From Braille' operations added. Closes #255 2018-08-24 01:07:51 +01:00
n1474335 3d4f54e8bc 8.4.3 2018-08-24 00:32:57 +01:00
n1474335 61f2f2d2e3 'Show Base64 offsets' operation show supports base64 input. Closes #276 2018-08-24 00:32:52 +01:00
n1474335 00058bd5c7 8.4.2 2018-08-23 23:24:05 +01:00
n1474335 383fe50fc9 Support for negative values in 'Drop bytes' and 'Take bytes'. Closes #266 2018-08-23 23:23:00 +01:00
n1474335 e4fdadc573 8.4.1 2018-08-23 22:56:46 +01:00
n1474335 032f8808ef Fixed typo in Z85 alphabet 2018-08-23 22:56:18 +01:00
n1474335 10cf0d13c2 8.4.0 2018-08-23 22:10:23 +01:00
n1474335 6c9fea97ef Updated CHANGELOG 2018-08-23 22:10:15 +01:00
n1474335 4c2d612bdd Merge branch 'PenguinGeorge-ascii85-new' 2018-08-23 22:05:44 +01:00
n1474335 8e9fece77d Tidied up Base85 ops 2018-08-23 22:05:31 +01:00
n1474335 c818370123 Merge branch 'ascii85-new' of https://github.com/PenguinGeorge/CyberChef into PenguinGeorge-ascii85-new 2018-08-23 21:46:41 +01:00
n1474335 bf2643802a 8.3.1 2018-08-23 21:42:04 +01:00
n1474335 1ad079fbd4 'Find/Replace', 'Filter' and 'Register' now used XRegExp 2018-08-23 21:41:57 +01:00
George J 2d9e8773f5 Updated Base85 operations for latest CyberChef version 2018-08-22 20:24:32 +01:00
n1474335 5aa13f2428 Changelog improved 2018-08-22 03:26:02 +01:00
n1474335 38f5fcde86 8.3.0 2018-08-21 19:29:51 +01:00
n1474335 f99ab87ca1 Merge branch 'artemisbot-features/messagepack' 2018-08-21 19:29:39 +01:00
n1474335 d3d230a76d Tweaked MessagePack operations 2018-08-21 19:29:19 +01:00
n1474335 e7c6a05e9f Merge branch 'features/messagepack' of https://github.com/artemisbot/CyberChef into artemisbot-features/messagepack 2018-08-21 19:22:10 +01:00
n1474335 17ec5c2683 8.2.0 2018-08-21 19:11:15 +01:00
n1474335 8d1839b9e2 Updated CHANGELOG.md 2018-08-21 19:10:35 +01:00
n1474335 23213a4ac5 Merge branch 'PenguinGeorge-info-links' 2018-08-21 19:08:08 +01:00
n1474335 e81c81351d Added more infoLinks and updated newOperation script to include prompt for them. 2018-08-21 19:07:13 +01:00
Matt C 36e16d9925 Fixed linting issues 2018-08-20 19:14:19 +01:00
Matt C 84eaaf4819 Tests now work
Also they'll work in the node API too now
2018-08-20 19:08:01 +01:00
n1474335 757096d97a Added image licencing info 2018-08-20 01:20:02 +01:00
n1474335 2393eac218 Removed src/test.mjs 2018-08-20 00:50:59 +01:00
n1474335 745d21d1bc 8.1.4 2018-08-20 00:26:49 +01:00
n1474335 cb34518a89 Recipes with a single backslash argument are now parsed correctly. Fixes #319 2018-08-20 00:26:44 +01:00
Matt C 821dd9c48c Added messagepack tests but they don't work
and i'm too burnt out to figure out why
2018-08-20 00:20:04 +01:00
n1474335 740f3924df Pressing return on a highlighted search result now correctly adds it to the recipe in Firefox. 2018-08-20 00:10:57 +01:00
n1474335 f052ed9b00 Compile message no longer overflows on small screens 2018-08-20 00:04:49 +01:00
n1474335 2507362741 8.1.3 2018-08-19 23:08:02 +01:00
n1474335 481a4266b0 Reset progress on statechange events. Fixes #329. 2018-08-19 23:07:53 +01:00
n1474335 92d9abf43a 8.1.2 2018-08-19 22:58:35 +01:00
n1474335 5bcdd99870 'Change IP format' operation now uses the correct arguments. Fixes #332 2018-08-19 22:58:31 +01:00
n1474335 e11bb38625 8.1.1 2018-08-19 22:50:54 +01:00
n1474335 affe057cab Added 'Decimal' option for toggleStrings. Closes #337. 2018-08-19 22:50:49 +01:00
d98762625 20bb104006 use utils.inspect.custom Rready for node v12 2018-08-19 22:34:50 +01:00
n1474335 c1b2fc9400 Updated CHANGELOG.md 2018-08-19 17:39:49 +01:00
n1474335 782e0f3475 8.1.0 2018-08-19 17:37:19 +01:00
n1474335 6be7ac89d4 Merge branch 'sevzero-esm' 2018-08-19 17:37:03 +01:00
n1474335 ad2424cfdd Tidied up 'Dechunk HTTP Response' operation 2018-08-19 17:36:40 +01:00
n1474335 b9703e2bb6 8.0.2 2018-08-19 17:14:36 +01:00
n1474335 198b67104f Merge branch 'Cynser-fix-date-time' 2018-08-19 17:14:20 +01:00
n1474335 8dab0eac58 Removed excess newline 2018-08-19 17:14:07 +01:00
d98762625 1f771a9e01 fix scan embedded files, bson. Only RemoveExif remains 2018-08-17 17:36:15 +01:00
d98762625 223e2e0b73 add Buffer translation to Dish. Cannot work in SyncDish as typeEnums are static. Seeing as they will never be hit in the broswer, shouldnt be an issue 2018-08-17 17:16:24 +01:00
d98762625 fbcb626fd0 add test timer. Remove operations related to esprima 2018-08-16 18:14:02 +01:00
d98762625 8f85e57fc5 fix translatreDateTimeFormat args assignment error 2018-08-16 17:19:23 +01:00
d98762625 7557f43f77 Wrap async ops in an async wrapper 2018-08-16 17:14:28 +01:00
d98762625 a6c0db47ab Finished first run through of tests 2018-08-16 09:58:27 +01:00
Cynser 8b78383732 Newline at end of files 2018-08-16 03:31:09 +01:00
Cynser f1c31ea966 Added some tests for the Translate DateTime Format operation 2018-08-16 03:28:11 +01:00
Cynser 1a1fad7433 Fixed DateTime format arguments 2018-08-16 03:01:19 +01:00
d98762625 8675d1a666 add more tests 2018-08-15 17:54:26 +01:00
d98762625 1f634ed341 add more tests 2018-08-14 17:46:15 +01:00
d98762625 ab248a0209 Merge pull request #333 from d98762625/update-cla-doc
Update CLA info in README
2018-08-14 12:09:19 +01:00
d98762625 50c916216c adding more tests 2018-08-14 12:03:10 +01:00
d98762625 6155dbb6e9 Update CLA info in README 2018-08-14 09:35:41 +01:00
d98762625 f100356078 started on full op test suite 2018-08-13 17:57:53 +01:00
d98762625 a2f4e34866 need to inclide src/node/index for module use 2018-08-11 22:22:07 +01:00
d98762625 7c1ac4392e merge 8.0.1 release -> node-lib 2018-08-11 22:15:09 +01:00
d98762625 20452fe3cb include crypto-api src into lib to get around mjs import issue. compiled node lib now requires successfully. 2018-08-10 17:44:40 +01:00
n1474335 f7310369e6 8.0.1 2018-08-09 19:17:35 +01:00
n1474335 9b7f4e824a Improvements and basic tests for Magic op and addition of deep cloning for dishes 2018-08-09 19:17:24 +01:00
Matt C 0c06e64051 Added MessagePack operations 2018-08-09 11:09:28 +01:00
n1474335 2b6c280858 8.0.0 2018-08-06 08:17:36 +01:00
n1474335 6de74b8211 Merge branch 'esm' 2018-08-06 08:16:51 +01:00
n1474335 3e5b3900bc CSS tweak to dropdown toggle height 2018-08-06 07:53:30 +01:00
n1474335 0453bd098b Removed phantomjs-prebuilt from direct dependencies 2018-08-06 07:39:25 +01:00
n1474335 4dc6dac885 Added CHANGELOG.md 2018-08-06 07:35:30 +01:00
n1474335 8da9af8989 Updated dependencies 2018-08-04 19:32:30 +01:00
n1474335 bd34f6bb6d Merge branch 'Dachande663-operation-haversine' into esm 2018-08-03 21:19:14 +01:00
n1474335 ff59a9d130 Moved Haversine Distance operation in categories 2018-08-03 21:18:53 +01:00
n1474335 63e0e4eaeb Merge branch 'operation-haversine' of https://github.com/Dachande663/CyberChef into Dachande663-operation-haversine 2018-08-03 21:12:54 +01:00
n1474335 c9635bee06 Merge branch 'feature-bootstrap4' into esm 2018-08-03 20:22:27 +01:00
n1474335 1b2d09c1e5 Merge branch 'esm' into feature-bootstrap4 2018-08-03 20:21:59 +01:00
n1474335 a947e06140 Added option to turn off background auto magic 2018-08-03 20:18:19 +01:00
n1474335 53b92ae8ef Further CSS tweaks 2018-08-03 19:58:44 +01:00
Luke Lanchester 87b77215e4 Added Haversine distance operation
This operation calculates the great circle distance between two GPS co-ordinates, returning the value
2018-08-03 18:20:38 +01:00
n1474335 2a55f1317a Fixed themes for MD 2018-08-02 13:21:02 +01:00
n1474335 c3a353837f Linted 2018-07-27 15:54:49 +00:00
n1474335 035b6dfa95 Added font and icon 2018-07-27 15:52:32 +00:00
n1474335 33b2fd8d69 Improved magic and staleness indicator animations 2018-07-27 15:18:08 +00:00
n1474335 541e4ff8cd Added functionality to Magic button and improved the icon 2018-07-27 13:37:38 +00:00
n1474335 ba5c503c48 Added Magic button and tweaked margins for Windows 2018-07-26 17:47:14 +00:00
d98762625 91eb692d99 Merge branch 'bake' into node-lib 2018-07-20 14:02:21 +01:00
d98762625 9abaadf1b6 Build chef.bake. 2018-07-20 13:55:11 +01:00
n1474335 651ca6cf5d Fixed all HTML operations 2018-07-15 13:25:44 +01:00
n1474335 ab44100312 Changed table-condensed to table-sm 2018-07-13 13:03:13 +00:00
n1474335 a39e2c165d Fixed input and output cards 2018-07-13 12:10:24 +00:00
n1474335 d182261ff3 Switched to unbordered args 2018-07-13 10:30:24 +00:00
n1474335 052c32e2ce Arguments are now bordered white boxes again 2018-07-13 00:03:04 +01:00
d98762625 2480dca473 Make help function use OperationConfig.json file
Tidy up Gruntfile execs
2018-07-06 11:42:56 +01:00
n1474335 f101eefc56 'From Hexdump' now supports an alternative style of Wireshark hexdumps. Test added. 2018-07-06 11:42:56 +01:00
d98762625 fa8736b1a4 Make help function use OperationConfig.json file
Tidy up Gruntfile execs
2018-07-06 11:34:06 +01:00
d98762625 db7b52d84c Merge branch 'node-lib' into help 2018-07-06 09:27:40 +01:00
d98762625 2027b643b1 Merge branch 'esm' of github.com:gchq/CyberChef into node-lib 2018-07-06 09:27:27 +01:00
d98762625 a4d7065e42 add operation input case to chef.search 2018-06-25 17:58:57 +01:00
d98762625 2ff7b5902c fix args transformation for ops with editableOptions 2018-06-25 11:38:05 +01:00
n1474335 dcf3152dee Operation cursor now indicates that it can be dragged 2018-06-20 00:27:40 +01:00
n1474335 4338e2626b Replaced Bootstrap alert with Material Design snackbar 2018-06-20 00:18:59 +01:00
d98762625 e04f66f599 export help function on chef object 2018-06-19 17:10:04 +01:00
d98762625 27ee7f8592 exclude File operations until File API can be mimicked 2018-06-19 09:12:55 +01:00
d98762625 f95f01b895 Add ability to exclude operations from Node API. Exclude flow control ops 2018-06-19 09:08:45 +01:00
d98762625 866b36729c edit logging on gruntfile 2018-06-19 08:53:29 +01:00
n1474335 67dffbec32 Actually fixed flow control operation argument text colour 2018-06-19 01:06:10 +01:00
n1474335 7504f89666 Fixed flow control operation argument text colour 2018-06-19 01:03:55 +01:00
n1474335 ba79144036 Operation arguments are now arranged using CSS Grid 2018-06-19 00:55:08 +01:00
d98762625 471009bc17 remove example and remove cap issues for SyncDish 2018-06-18 13:15:29 +01:00
d98762625 c90f30a7a1 update editableOptions wrapper 2018-06-18 11:17:17 +01:00
d98762625 ffb65d8ea1 add more wrapper tests for node api 2018-06-18 10:52:45 +01:00
n1474335 974ab29e36 Switched toggle string dropdown sides and removed form-control padding 2018-06-17 23:52:00 +01:00
n1474335 fa523e0d4a Changed banner icons to Material Design 2018-06-17 14:09:52 +01:00
n1474335 ab9bc7e390 Fixed boolean arg checkboxes 2018-06-17 13:49:32 +01:00
n1474335 4147ec719b Converted modals to Bootstrap 4 Material Design 2018-06-17 12:44:12 +01:00
d98762625 a5d58071cd WIP: start testing ops with various arg types. AESENCRYPT result encoding error 2018-06-15 11:33:13 +01:00
n1474335 4ca14ed0ce 'From Hexdump' now supports an alternative style of Wireshark hexdumps. Test added. 2018-06-13 13:00:49 +00:00
n1474335 7d410fcdc9 Converted op-icons to material design and improved controls. 2018-06-10 14:55:15 +01:00
n1474335 2bacd6424d Converted operation arguments to material design 2018-06-10 12:03:55 +01:00
n1474335 27b0505ede Merged ESM into feature-bootstrap4 2018-06-09 10:48:35 +01:00
n1474335 1ce6e32086 Merged ESM into feature-bootstrap4. Started work on text inputs. 2018-06-09 10:43:36 +01:00
d98762625 fc1b8917a8 add node index to clean. generate node index before test 2018-06-07 10:06:44 +01:00
d98762625 ec00413a4b add example usage file 2018-06-06 17:57:16 +01:00
d98762625 33f2c89716 update tests to reflect new API behaviour 2018-06-06 17:29:30 +01:00
d98762625 45d2fbc5fc create SyncDish and wrap results in it. 2018-06-06 16:37:12 +01:00
d98762625 d00b9e0928 generate node index needs to be without other generate scripts 2018-06-06 09:13:26 +01:00
d98762625 58a7f7b739 Merge branch 'esm' of github.com:gchq/CyberChef into node-lib 2018-06-06 08:28:08 +01:00
n1474335 40a1da10e3 Merge branch 'esm' of github.com:gchq/CyberChef into esm 2018-06-03 17:33:39 +01:00
n1474335 1ef4f71d8b ESM: Added BackgroundWorkerWaiter for running Magic on output in the background 2018-06-03 17:33:13 +01:00
n1474335 a0f034b843 ESM: Fixed magic errors 2018-06-01 12:43:36 +00:00
d98762625 dcf6564d0a linting for generated node/index.mjs 2018-05-30 11:35:36 +01:00
d98762625 6db9521419 re-add translateTo call to chef export 2018-05-30 11:29:38 +01:00
d98762625 336810cbf4 amend generateNodeIndex script 2018-05-30 11:12:57 +01:00
d98762625 9d5e533e32 Merge branch 'esm' of github.com:gchq/CyberChef into top-export 2018-05-30 08:52:27 +01:00
n1474335 37c8d1b7ea ESM: Fixed OpModules import to make inline version function correctly 2018-05-29 16:22:04 +00:00
n1474335 6a4bc3c9df ESM: Fixed PGP ops and added tests 2018-05-29 16:00:24 +00:00
n1474335 78c1c4d680 ESM: Added builder script to generate new operations. npm run newop 2018-05-29 14:18:39 +00:00
d98762625 b45fc630ae Merge branch 'esm' of github.com:gchq/CyberChef into top-export 2018-05-29 08:58:20 +01:00
n1474335 60340fc8ae ESM: Removed legacy files 2018-05-29 01:20:44 +01:00
n1474335 be0fc7591d Merge branch 'picapi-ip-convert' into esm 2018-05-29 00:48:45 +01:00
n1474335 7f9a2eeb6b ESM: Tidied up IP operations 2018-05-29 00:48:30 +01:00
n1474335 40b29d770a Merge branch 'artemisbot-esmconversion' into esm 2018-05-28 15:47:50 -07:00
n1474335 3f3a3e0016 ESM: Tidied up recently added operations 2018-05-28 15:42:43 -07:00
Matt C 6a561185df ESM: Ported RegEx operations 2018-05-28 00:39:03 +01:00
Matt C 049656ec6b ESM: Ported PublicKey operations 2018-05-27 23:53:43 +01:00
Matt C 709630f39b Ported Image operations + some cleanup 2018-05-27 23:27:11 +01:00
Matt C eb3a2502f5 Ported rest of Code ops & enabled/fixed some tests 2018-05-27 22:07:09 +01:00
n1474335 ade056e881 Merge branch 'artemisbot-esmconversion' into esm 2018-05-27 16:13:43 +01:00
n1474335 6768038a2f ESM: Tidied up recently ported ops 2018-05-27 16:13:18 +01:00
Matt C 905bc6699e ESM: Ported case converters, generic beautifier and syntax highlighting 2018-05-26 18:04:53 +01:00
d98762625 9a471d2a26 remove extra preamble for grunt task. improve index script 2018-05-25 12:20:56 +01:00
d98762625 0a0240e520 WIP: generate top level node exports - manually mock lib files 2018-05-25 11:26:28 +01:00
d98762625 0977e82170 Merge branch 'esm' into node-lib 2018-05-24 16:12:26 +01:00
sevzero ed84614389 Fixed issues raised by Travis 2018-05-24 13:39:14 +00:00
sevzero 67bd2605c0 Updated variable scope in legacy HTTP.js file 2018-05-24 13:21:50 +00:00
sevzero 83c145c2ac Reduced variable scopes 2018-05-24 13:17:46 +00:00
sevzero 53bf52c989 Added decoder for chunked HTTP encoding
This decoder will join up a HTTP response sent using chunked transfer encoding, raised in issue #168.

This is useful when attempting to extract files or gzipped responses sent using chunked transfer encoding, particularly when combined with the gunzip operation.
2018-05-24 13:09:04 +00:00
Matt C 176e83a79f Converted JS operations
Deleted legacy files, neatened args in other ported ops
2018-05-23 20:36:29 +01:00
Matt C 95f81ad740 Ported Bitwise operations
also enabled bitshift tests
2018-05-23 18:59:57 +01:00
Matt C 9ffab374db Converted PBKDF2 and RC2, enabled tests, deleted legacy Cipher file
Also made DESDecrypt test pass
2018-05-23 18:31:26 +01:00
Matt C 46b8b2fa7e Converted DES and TripleDES ops 2018-05-23 18:23:03 +01:00
Matt C 189e077247 Ported blowfish operations and library to ESM modules 2018-05-23 16:54:12 +01:00
n1474335 c29ea53405 ESM: Ported Punycode, HTTP and PRNG operations 2018-05-21 19:08:24 +00:00
n1474335 0d1e5311dc ESM: Changed thrown errors to OperationErrors 2018-05-21 18:34:52 +00:00
n1474335 cefe3fc542 ESM: Ported Bzip2, Diff and Tar operations 2018-05-21 18:23:05 +00:00
n1474335 749b0510e7 ESM: Ported BSON, ToTable, Filetime and XKCD operations 2018-05-21 17:37:32 +00:00
n1474335 eed28f67d5 ESM: Ported UUID, OTP, Numberwang and PHP operations 2018-05-21 12:35:11 +00:00
n1474335 739e06d7d3 Merge branch 'd98762625-port-flowcontrol' into esm 2018-05-21 11:45:28 +00:00
n1474335 28b24b725f ESM: Tidied up FlowControl ops 2018-05-21 11:39:10 +00:00
n1474335 1472f82205 Merge branch 'port-flowcontrol' of https://github.com/d98762625/CyberChef into d98762625-port-flowcontrol 2018-05-21 11:27:00 +00:00
n1474335 4990a1f9f1 ESM: Added file exists check to npm postinstall script. 2018-05-21 11:25:13 +00:00
d98762625 10556f528f update comments 2018-05-21 11:12:58 +01:00
d98762625 8ff6596657 add other flowcontrol ops. Update tests 2018-05-21 10:58:35 +01:00
d98762625 046e1ebad9 Merge branch 'esm' into port-flowcontrol 2018-05-21 09:02:58 +01:00
d98762625 9f52689fde Merge branch 'esm' of github.com:gchq/CyberChef into esm 2018-05-21 09:02:21 +01:00
n1474335 093a7c8c8a ESM: Config files are now initialised correctly. 2018-05-20 17:05:59 +01:00
n1474335 ee519c7352 Merged esm branch into feature-magic. Ported FileType ops. 2018-05-20 16:49:42 +01:00
d98762625 ec0ecf5151 add comments 2018-05-18 12:52:16 +01:00
d98762625 bfb405c4a6 Add Jump 2018-05-18 12:50:23 +01:00
d98762625 bca73b496f add Merge (without Fork). Add flowcontrol setter to Operation 2018-05-18 12:38:37 +01:00
d98762625 72d943aca2 Add register 2018-05-18 12:24:31 +01:00
d98762625 0f6ee68731 edit setter in Register 2018-05-18 12:23:58 +01:00
d98762625 3f08fa3b23 update package-lock 2018-05-18 11:40:24 +01:00
n1474335 1dddcb4345 ESM: Ported various tests for completed operations 2018-05-17 15:34:00 +00:00
n1474335 3fd1f4e6d9 ESM: Ported all Hash and Checksum operations 2018-05-17 15:11:34 +00:00
Callum Fraser 3ba12ae9ac Made variables non-private, and followed convention for the references to the IP lib. 2018-05-16 22:32:46 +01:00
Callum Fraser ea36687205 Merge branch 'esm' of https://github.com/gchq/CyberChef into ip-convert 2018-05-16 21:52:40 +01:00
Callum Fraser c17e897674 Ported the ParseIPv4Header operation. 2018-05-16 21:51:51 +01:00
Callum Fraser b7bdd4eed6 Ported the GroupIPAddresses operation. 2018-05-16 21:51:24 +01:00
Callum Fraser 792218df9c Ported the ChangeIPFormat operation. 2018-05-16 21:51:04 +01:00
Callum Fraser 161f89c038 Ported the TCPIPChecksum operation.
Main content has been moved to the IP lib file, as it is used in multiple files.
Changed the name, due to it originally containing a backslash, which caused issues with the script.
2018-05-16 21:50:48 +01:00
Callum Fraser 1920e9c7fb Added more content to the Ip.mjs file, required for other functions. 2018-05-16 21:37:48 +01:00
n1474335 5362508a99 ESM: Ported HTML, Unicode, Quoted Printable and Endian operations 2018-05-16 17:10:50 +00:00
n1474335 f26d175cad ESM: Ported Base58, Base and BCD operations 2018-05-16 16:25:05 +00:00
n1474335 84df055888 ESM: Ported MS and Entropy operations 2018-05-16 11:39:30 +01:00
n1474335 ebcc5bd9c8 ESM: Added generateConfig calls to relevant grunt tasks 2018-05-16 10:25:29 +01:00
n1474335 b760c2f1a0 ESM: Fixed OperationError detection and tidied up ops. 2018-05-16 10:17:49 +01:00
n1474335 acb8a342a7 Merge branch 'esmconversion' of https://github.com/artemisbot/CyberChef into esm 2018-05-16 09:28:24 +01:00
Callum Fraser 654596ea79 Ported "Parse IPv6 Address" 2018-05-15 23:48:33 +01:00
Callum Fraser 8d2adfaae7 Updated the Ip core file with more required functions/variables 2018-05-15 23:48:18 +01:00
Callum Fraser 5b6d57fd47 Ported "Parse IP Range". 2018-05-15 23:31:03 +01:00
Callum Fraser 39ba83eefb Created a Ip for now which contains all the helper functions, they may be moved into their corrosponding files in the future 2018-05-15 23:30:35 +01:00
Matt C 03f435915b Imported OperationError to TranslateDateTimeFormat 2018-05-15 18:50:04 +01:00
n1474335 07715bd167 ESM: Rewritten src/web/ in ESM format. 2018-05-15 17:36:45 +00:00
Matt C 2e4f5b7070 Changed all error returns to OperationErrors 2018-05-15 18:01:04 +01:00
Matt C b3ee251ee3 ESM: Port Extract.js module 2018-05-15 16:30:17 +01:00
n1474335 c90acd24f5 ESM: Added author tag to Sum op 2018-05-15 15:21:50 +00:00
n1474335 e41eb3d8a2 Merge branch 'port-arithmetic' of https://github.com/d98762625/CyberChef into esm 2018-05-15 15:16:56 +00:00
Matt C 3c214ce17c Deleted PGP file 2018-05-15 16:07:51 +01:00
Matt C 285e512483 Actually made these ops work 2018-05-15 16:04:57 +01:00
n1474335 b8d3b33963 ESM: Ported CharEnc operations 2018-05-15 15:03:41 +00:00
d98762625 3bbfc130d4 create arithmetic specific delimiter options 2018-05-15 14:59:28 +01:00
d98762625 6ddc1b1c9c export Arithmetic funcs individually. Use existing Delim 2018-05-15 14:32:39 +01:00
d98762625 f79dd29ed3 port standard deviation ops 2018-05-15 10:47:06 +01:00
d98762625 1198094d3b port median operation 2018-05-15 10:42:51 +01:00
d98762625 2716be397c port mean operation 2018-05-15 10:40:26 +01:00
d98762625 9de93022d6 port divide operation 2018-05-15 10:33:58 +01:00
d98762625 bf28410812 port multiply operation 2018-05-15 10:24:35 +01:00
d98762625 30288c6237 add Subtract op 2018-05-15 10:19:06 +01:00
Matt C 2b0c327001 Ported x86 Disassembler & PGP ops 2018-05-15 10:15:31 +01:00
d98762625 4fe34a4839 port Sum operation 2018-05-15 10:12:59 +01:00
Matt C b8d39f49b2 Convert URL operations
Delete legacy URL module
2018-05-14 22:15:28 +01:00
Matt C c9e9499106 Merge remote-tracking branch 'upstream/esm' into esmconversion 2018-05-14 20:39:13 +01:00
n1474335 a7d763287e ESM: Ported AES operations 2018-05-14 18:23:16 +00:00
n1474335 61832a9e2a ESM: whitespace tidying 2018-05-14 18:07:17 +00:00
n1474335 cbb5e7c611 Merge branch 'esmconversion' of https://github.com/artemisbot/CyberChef into esm 2018-05-14 17:49:57 +00:00
n1474335 bad45f19d6 ESM: Ported DateTime operations 2018-05-14 17:48:57 +00:00
Matt C e6f19c3dfd Fixed linebreaks in test index (thanks VSCode) 2018-05-14 18:33:16 +01:00
Matt C 24e4e268dc Converted RC4, RC4Drop and Derive EVP 2018-05-14 18:30:52 +01:00
n1474335 10005ce104 ESM: Ported OS operations 2018-05-14 17:16:42 +00:00
Matt C 4008dbf38a Merge remote-tracking branch 'upstream/esm' into esmconversion
Also removed substitute operation from legacy module
2018-05-14 18:09:21 +01:00
n1474335 cefe5bbaa8 ESM: Ported Convert operations 2018-05-14 17:03:23 +00:00
n1474335 d327dd47b2 ESM: Ported SeqUtils operations 2018-05-14 16:46:54 +00:00
n1474335 66c768fe31 ESM: Ported Tidy operations. Updated portOperation script to attempt to find the run function and list related constants. 2018-05-14 15:55:17 +00:00
n1474335 037e2f3771 ESM: Ported StrUtils and NetBIOS operations. 2018-05-14 14:31:04 +00:00
n1474335 a98d37e61c Merged master into esm branch 2018-05-14 11:58:01 +00:00
George J 77a0238406 Fixes syntax error 2018-05-13 13:27:52 +01:00
d98762625 0a0316a000 Make optional args in operation call use named properties rather than array 2018-05-11 19:25:14 +01:00
d98762625 7e8f78acaa dont decapitalise all-caps operation names 2018-05-11 17:33:14 +01:00
Matt C 2d6a56343b Converted substitute operation, added tests & moved to OperationError 2018-05-11 16:32:19 +01:00
d98762625 615cb561e4 add some chef.translateTo tests 2018-05-11 11:58:09 +01:00
d98762625 c96a1df8e1 add namespaces to docas 2018-05-11 11:09:04 +01:00
Matt C 350d10d98b Added toggleString support 2018-05-11 10:03:06 +01:00
Matt C 6bec68021c Converted Vignere, added more tests and cleaned stuff up 2018-05-09 21:13:09 +01:00
Matt C 789ec94eff Converted Bifid & moved over tests 2018-05-09 20:28:28 +01:00
Matt C f87666f659 Converted Affine/Atbash operations to mjs & added tests 2018-05-09 20:18:33 +01:00
n1474335 6987e6b1b9 ESM: Ported Bit shift, MAC address and Morse Code operations. 2018-05-07 12:12:58 +01:00
n1474335 0ca0e7427d Merge branch 'esm' of github.com:gchq/CyberChef into esm 2018-05-07 11:35:35 +01:00
n1474335 be61419b80 ESM: Added remaining ByteRepr operations. 2018-05-06 13:18:41 +01:00
n1474335 1f877817f4 ESM: Added portOperation.mjs script. Added To and From Hexdump operations. 2018-05-06 12:24:01 +01:00
George J c7f13ff67f Added 'More Info' links to the descriptions of many operations for #265 2018-05-05 00:43:42 +01:00
d98762625 5efc3f15f2 linting 2018-05-03 13:58:15 +01:00
d98762625 5fb50a1759 OperationErrors now bubble up to the top of the API.
Added test functionality for node api
refactor TestRegister into class
2018-05-03 13:53:40 +01:00
d98762625 e50758f0a6 Merge branch 'esm' of github.com:gchq/CyberChef into node-lib 2018-05-03 13:52:50 +01:00
n1474335 4cff1c8fa9 Merge branch 'd98762625-op-errors' into esm 2018-04-30 17:26:11 +00:00
n1474335 0dbc7d4fd1 Tidied up OperationError code. 2018-04-30 17:25:13 +00:00
d98762625 3d672802a3 remove find Type - not used any more 2018-04-27 16:47:52 +01:00
d98762625 c238862efe in/out typing working. Added translateTo function 2018-04-27 16:45:02 +01:00
d98762625 7e7e5e7466 Merge branch 'op-errors' into node-lib 2018-04-27 11:33:27 +01:00
d98762625 cc20ad9567 Add OperationError error type and use for errors to be printed to the output panel 2018-04-27 10:59:53 +01:00
n1474335 b0a8ca56bc Added File and JSON Dish types and updated types for compression ops. 2018-04-27 10:44:40 +01:00
n1474335 fbec0a1c7d The raw, unpresented dish is now returned to the app after baking, where it can be retrieved as various different data types. 2018-04-27 10:44:40 +01:00
d98762625 d5b5443a84 update readme 2018-04-27 09:01:45 +01:00
n1474335 a8aa1bc5e8 Added File and JSON Dish types and updated types for compression ops. 2018-04-21 13:41:42 +01:00
n1474335 76a066ab74 The raw, unpresented dish is now returned to the app after baking, where it can be retrieved as various different data types. 2018-04-21 12:25:48 +01:00
d98762625 b8b98358d0 function tidy, add comments 2018-04-20 12:23:20 +01:00
d98762625 fca4ed7013 simplified API 2018-04-20 10:55:17 +01:00
d98762625 59877b5138 Exporing options with API. 2018-04-13 12:14:40 +01:00
n1474335 30aa4e05ef ESM: 'grunt test' now generates configs before running 2018-04-11 18:08:42 +00:00
n1474335 4e38b09e18 ESM: Config scripts now run synchronously before webpack builds start 2018-04-11 17:58:40 +00:00
n1474335 23f69bd21d Merge branch 'd98762625-set-operations' into esm 2018-04-11 17:31:19 +00:00
n1474335 dc5ce31087 ESM: .gitignore now ignores generated files 2018-04-11 17:30:15 +00:00
n1474335 e99331f305 ESM: Tidied up Set operations 2018-04-11 17:29:02 +00:00
d98762625 955a082614 add lint command to package.json. Remove old conflict remnants 2018-04-09 15:38:44 +01:00
d98762625 bbc580e71b Quick fix for empty recipe error. Changed deflate back to compression module 2018-04-09 15:21:09 +01:00
d98762625 76f27dbcdb pull from upstream 2018-04-09 11:23:18 +01:00
d98762625 543dce5721 remove setOps operation 2018-04-09 11:19:05 +01:00
d98762625 adc4f78e99 Add other set operations 2018-04-09 11:13:23 +01:00
d98762625 852c95a994 add Set Difference operation 2018-04-09 10:23:05 +01:00
n1474335 b7ed1becba ESM: Added new List<File> Dish type. Added present() method for displaying operation output in a nice way. Testing required. 2018-04-06 18:11:13 +00:00
d98762625 03ecaa81f7 move Set Intersection into its own operation class 2018-04-06 16:52:59 +01:00
d98762625 5f93c667a2 Pull SetUnion into its own operation 2018-04-06 16:27:24 +01:00
n1474335 ae55fde591 Merge branch 'artemisbot-esm' into esm 2018-04-06 12:41:13 +00:00
n1474335 fad4713a90 ESM: Tidied up Rotate operations 2018-04-06 12:40:39 +00:00
d98762625 f491461a57 inital move of two ops 2018-04-04 17:37:19 +01:00
d98762625 7ce1bf1048 merge esm 2018-04-04 16:00:37 +01:00
Matt C af51090ebb Added rotate ESM tests 2018-04-03 23:29:47 +01:00
Matt C 7e86f02e4e Deleted legacy Rotate module 2018-04-03 22:51:50 +01:00
Matt C 4988ead918 Rotate module converted to ESM
4 Ops:
- ROT-13
- ROT-47
- Rotate left
- Rotate right
+ module containing common functions
2018-04-03 22:50:26 +01:00
n1474335 083d2d1cc4 ESM: Added Zlib ops and created a Zlib library. 2018-04-02 20:46:55 +01:00
n1474335 fbb3a02315 ESM: The operations index is now generated automatically 2018-04-02 19:24:25 +01:00
n1474335 eeb1d0a891 ESM: Added Hex ops and created a Hex library. 2018-04-02 18:06:48 +01:00
n1474335 0011e9caa8 Added .editorconfig 2018-04-02 17:32:17 +01:00
n1474335 041cd9fb8e ESM: Added remaining Base64 ops and created a Base64 library. Added the prefer-const eslint rule. 2018-04-02 17:10:51 +01:00
n1474335 9b4fc3d3aa Converted the core to ES modules 2018-03-26 23:14:23 +01:00
d98762625 e403adb9a1 fix more linting errors 2018-03-25 17:51:36 +01:00
d98762625 f3610e7c95 fix lint errors 2018-03-25 17:44:10 +01:00
d98762625 951568ce22 use bind for partial application of power set function 2018-03-25 17:27:14 +01:00
d98762625 e8bb9e264d more comments 2018-03-25 17:10:55 +01:00
d98762625 208cb05c74 reuse difference function for symmetric difference 2018-03-25 17:03:05 +01:00
d98762625 2c68be3193 add comments 2018-03-25 16:42:33 +01:00
d98762625 20e54a8ecf add tests for setOperations 2018-03-22 18:11:24 +00:00
71846 7d15bfe58a initial functionality commit 2018-03-16 14:42:55 +00:00
n1474335 bcc8804495 Updated buttons, fonts and collapse 2018-03-02 16:30:20 +00:00
n1474335 5a7bb092c7 Fixed popovers in Bootstrap v4 2018-03-02 15:32:27 +00:00
n1474335 d166dda229 Started updating Bootstrap to v4 2018-03-02 14:04:58 +00:00
n1474335 56d33ea487 Magic operation now calculates the entropy of each option and displays tooltips explaining the properties. 2018-02-19 17:25:28 +00:00
n1474335 559741fd07 Fixed a few small bugs 2018-02-15 18:46:17 +00:00
n1474335 b3c52a8601 Magic operation now brute forces character encodings. Linted. 2018-02-15 17:38:39 +00:00
n1474335 27ec4aa923 Magic operation now recognises useful operations such as 'Render Image' even though their output cannot be analysed 2018-02-15 13:39:55 +00:00
n1474335 1760ab2305 Recipe errors are now ignored in the Magic operation 2018-02-14 17:00:14 +00:00
n1474335 99ade42e9a Added 'Intensive mode' to the Magic operation, where it brute-forces various simple encodings like XOR or bit rotates. 2018-02-14 16:08:59 +00:00
n1474335 544d78f461 The Magic operation now only checks the most commonly used Internet languages by default, to lower false positives and improve performance. 2018-02-14 13:08:03 +00:00
n1474335 2bc563b693 Added support for 238 languages to the Magic operation. 2018-02-10 17:53:59 +00:00
n1474335 23bdfd04a2 Magic operation now shows matching ops even if they are not run. 2018-02-10 15:31:50 +00:00
n1474335 6624f25a64 Magic operation now detects UTF8 and gives a probability score for each language 2018-02-10 15:10:53 +00:00
n1474335 865ee6a720 Magic operation tidying 2018-01-23 01:15:13 +00:00
n1474335 6947d2a7f3 Magic operation now displays an ordered table of the most likely decodings. 2018-01-22 23:34:24 +00:00
n1474335 28abd00d82 Added speculative execution of recipes to determine the most likely decodings. 2018-01-22 22:06:26 +00:00
n1474335 57314b77e5 Merge branch 'master' into feature-magic 2018-01-22 20:04:51 +00:00
n1474335 b035f6c410 Added detection patterns for X.509 certs, Morse Code, Tar, images and BCD. 2018-01-22 19:57:41 +00:00
n1474335 615a020469 Added detection patterns for UNIX timestamps, Zlib deflate, Gzip, Zip and Bzip2. 2018-01-22 17:50:00 +00:00
n1474335 48f8ca693d Added detection patterns for Octal, Binary, Decimal, Hexdumps, HTML Entities, URL encoding, escaped Unicode, and Quoted Printable encoding. 2018-01-14 18:26:06 +00:00
n1474335 a1624a9215 Added detection patterns for non-standard Base64 alphabets, Base58 and Base32. 2018-01-14 17:28:56 +00:00
n1474335 fc2828fee3 Added Magic operation with the ability to detect language, file type and some encoding types. 2018-01-14 16:07:39 +00:00
toby 6784a1c027 Add Series chart operation 2017-06-20 15:25:16 -04:00
toby 39ab600887 Add scatter plot operation 2017-06-06 14:08:21 -04:00
toby 49ea532cdc Tweak extent of hex density charts 2017-06-06 09:46:46 -04:00
toby 247e9bfbde Add "HTML to Text" operation 2017-06-05 21:47:32 -04:00
toby 5944568565 Change margins in hex density chart 2017-06-05 10:24:15 -04:00
toby 1c87707a76 Add heatmap chart operation 2017-06-05 10:24:06 -04:00
toby b4188db671 Hexagon density: allow dense plotting of hexagons 2017-05-31 15:00:57 -04:00
toby dc642be1f5 Hex plot: add edge drawing & changing colour opts 2017-05-30 15:49:22 -04:00
toby 6cdc7d3966 Hex density: split radius into draw & pack radii 2017-05-30 15:24:23 -04:00
toby 281d558111 Add hex density chart 2017-05-30 14:53:32 -04:00
toby fa89713f19 Add d3 as a dependency 2017-05-30 14:50:56 -04:00
895 changed files with 131032 additions and 40226 deletions

No files matched your search

-14
View File
@@ -1,14 +0,0 @@
{
"presets": [
["env", {
"targets": {
"chrome": 40,
"firefox": 35,
"edge": 14,
"node": "6.5"
},
"modules": false,
"useBuiltIns": true
}]
]
}
+14
View File
@@ -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,nightwatch.json}]
indent_style = space
indent_size = 2
+1 -2
View File
@@ -1,2 +1 @@
src/core/lib/**
src/core/config/MetaConfig.js
src/core/vendor/**
+23 -9
View File
@@ -1,10 +1,12 @@
{
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 8,
"ecmaVersion": 2022,
"ecmaFeatures": {
"impliedStrict": true
},
"sourceType": "module"
"sourceType": "module",
"allowImportExportEverywhere": true
},
"env": {
"browser": true,
@@ -36,12 +38,16 @@
// disable rules from base configurations
"no-control-regex": "off",
"require-atomic-updates": "off",
"no-async-promise-executor": "off",
// stylistic conventions
"brace-style": ["error", "1tbs"],
"space-before-blocks": ["error", "always"],
"block-spacing": "error",
"array-bracket-spacing": "error",
"comma-spacing": "error",
"spaced-comment": ["error", "always", { "exceptions": ["/"] } ],
"comma-style": "error",
"computed-property-spacing": "error",
"no-trailing-spaces": "warn",
@@ -57,7 +63,8 @@
}],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "double", {
"avoidEscape": true
"avoidEscape": true,
"allowTemplateLiterals": true
}],
"camelcase": ["error", {
"properties": "always"
@@ -84,19 +91,26 @@
"no-whitespace-before-property": "error",
"operator-linebreak": ["error", "after"],
"space-in-parens": "error",
"no-var": "error"
"no-var": "error",
"prefer-const": "error"
},
"overrides": [
{
"files": "tests/**/*",
"rules": {
"no-unused-expressions": "off",
"no-console": "off"
}
}
],
"globals": {
"$": false,
"jQuery": false,
"moment": false,
"log": false,
"app": false,
"COMPILE_TIME": false,
"COMPILE_MSG": false,
"PKG_VERSION": false,
"ENVIRONMENT_IS_WORKER": false,
"ENVIRONMENT_IS_NODE": false,
"ENVIRONMENT_IS_WEB": false
"PKG_VERSION": false
}
}
+6 -6
View File
@@ -6,7 +6,7 @@ There are lots of opportunities to contribute to CyberChef. If you want ideas, t
Before your contributions can be accepted, you must:
- Sign the [GCHQ Contributor Licence Agreement](https://github.com/gchq/Gaffer/wiki/GCHQ-OSS-Contributor-License-Agreement-V1.0)
- Sign the [GCHQ Contributor Licence Agreement](https://cla-assistant.io/gchq/CyberChef)
- Push your changes to your fork.
- Submit a pull request.
@@ -22,15 +22,15 @@ Before your contributions can be accepted, you must:
* Line endings: UNIX style (\n)
## Design Principals
## Design Principles
1. If at all possible, all operations and features should be client-side and not rely on connections to an external server. This increases the utility of CyberChef on closed networks and in virtual machines that are not connected to the Internet. Calls to external APIs may be accepted if there is no other option, but not for critical components.
2. Latency should be kept to a minimum to enhance the user experience. This means that all operation code should sit on the client, rather than being loaded dynamically from a server.
3. Use Vanilla JS if at all possible to reduce the number of libraries required and relied upon. Frameworks like jQuery, although included, should not be used unless absolutely necessary.
4. Minimise the use of large libraries, especially for niche operations that won't be used very often - these will be downloaded by everyone using the app, whether they use that operation or not (due to principal 2).
2. Latency should be kept to a minimum to enhance the user experience. This means that operation code should sit on the client and be executed there. However, as a trade-off between latency and bandwidth, operation code with large dependencies can be loaded in discrete modules in order to reduce the size of the initial download. The downloading of additional modules must remain entirely transparent so that the user is not inconvenienced.
3. Large libraries should be kept in separate modules so that they are not downloaded by everyone who uses the app, just those who specifically require the relevant operations.
4. Use Vanilla JS if at all possible to reduce the number of libraries required and relied upon. Frameworks like jQuery, although included, should not be used unless absolutely necessary.
With these principals in mind, any changes or additions to CyberChef should keep it:
With these principles in mind, any changes or additions to CyberChef should keep it:
- Standalone
- Efficient
+1 -14
View File
@@ -1,14 +1 @@
<!-- Prefix the title above with one of the following: -->
<!-- Bug report: -->
<!-- Operation request: -->
<!-- Feature request: -->
<!-- Misc: -->
### Summary
### Example
<!-- If describing a bug, tell us what happens instead of the expected behavior -->
<!-- Include a link that triggers the bug if possible -->
<!-- If you are requesting a new operation, include example input and output -->
<!-- Prefix the title above with 'Misc:' -->
+33
View File
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: 'Bug report: <Insert title here>'
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behaviour or a link to the recipe / input used to cause the bug:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behaviour**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (if relevant, please complete the following information):**
- OS: [e.g. Windows]
- Browser: [e.g. chrome 72, firefox 60]
- CyberChef version: [e.g. 9.7.14]
**Additional context**
Add any other context about the problem here.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for the project
title: 'Feature request: <Insert title here>'
labels: feature
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. E.g. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
@@ -0,0 +1,14 @@
---
name: Operation request
about: Suggest a new operation
title: 'Operation request: <Insert title here>'
labels: operation
assignees: ''
---
## Summary
### Example Input
### Example Output
+40
View File
@@ -0,0 +1,40 @@
name: "CodeQL Analysis"
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
types: [synchronize, opened, reopened]
schedule:
- cron: '22 17 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
+57
View File
@@ -0,0 +1,57 @@
name: "Master Build, Test & Deploy"
on:
workflow_dispatch:
push:
branches:
- master
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install
run: |
npm install
npm run setheapsize
- name: Lint
run: npx grunt lint
- name: Unit Tests
run: |
npm test
npm run testnodeconsumer
- name: Production Build
if: success()
run: npx grunt prod --msg="Version 10 is here! Read about the new features <a href='https://github.com/gchq/CyberChef/wiki/Character-encoding,-EOL-separators,-and-editor-features'>here</a>"
- name: Generate sitemap
run: npx grunt exec:sitemap
- name: UI Tests
if: success()
run: |
sudo apt-get install xvfb
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
- name: Prepare for GitHub Pages
if: success()
run: npx grunt copy:ghPages
- name: Deploy to GitHub Pages
if: success() && github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: ./build/prod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+40
View File
@@ -0,0 +1,40 @@
name: "Pull Requests"
on:
workflow_dispatch:
pull_request:
types: [synchronize, opened, reopened]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install
run: |
npm install
npm run setheapsize
- name: Lint
run: npx grunt lint
- name: Unit Tests
run: |
npm test
npm run testnodeconsumer
- name: Production Build
if: success()
run: npx grunt prod
- name: UI Tests
if: success()
run: |
sudo apt-get install xvfb
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
+44
View File
@@ -0,0 +1,44 @@
name: "Releases"
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install
run: |
npm install
npm run setheapsize
- name: Lint
run: npx grunt lint
- name: Unit Tests
run: |
npm test
npm run testnodeconsumer
- name: Production Build
if: success()
run: npx grunt prod
- name: Upload Release Assets
if: success()
id: upload-release-assets
uses: https://gitea.com/actions/release-action@main
with:
files: |-
file: build/prod/*.zip
api_key: '${{secrets.RELEASE_TOKEN}}'
+9 -4
View File
@@ -2,8 +2,13 @@ node_modules
npm-debug.log
travis.log
build
docs/*
!docs/*.conf.json
!docs/*.ico
.vscode
src/core/config/MetaConfig.js
.*.swp
src/core/config/modules/*
src/core/config/OperationConfig.json
src/core/operations/index.mjs
src/node/config/OperationConfig.json
src/node/index.mjs
**/*.DS_Store
tests/browser/output/*
.node-version
-1
View File
@@ -3,6 +3,5 @@ npm-debug.log
travis.log
build/*
!build/node
docs
.vscode
.github
+1
View File
@@ -0,0 +1 @@
18
-49
View File
@@ -1,49 +0,0 @@
language: node_js
node_js:
- "8.4"
install: npm install
before_script:
- npm install -g grunt
script:
- grunt lint
- grunt test
- grunt docs
- grunt node
- grunt prod --msg="$COMPILE_MSG"
before_deploy:
- grunt exec:sitemap
- grunt copy:ghPages
deploy:
- provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN
local_dir: build/prod/
target_branch: gh-pages
on:
repo: gchq/CyberChef
branch: master
- provider: releases
skip_cleanup: true
api_key:
secure: "HV1WSKv4l/0Y2bKKs1iBJocBcmLj08PCRUeEM/jTwA4jqJ8EiLHWiXtER/D5sEg2iibRVKd2OQjfrmS6bo4AiwdeVgAKmv0FtS2Jw+391N8Nd5AkEANHa5Om/IpHLTL2YRAjpJTsDpY72bMUTJIwjQA3TFJkgrpOw6KYfohOcgbxLpZ4XuNJRU3VL4Hsxdv5V9aOVmfFOmMOVPQlakXy7NgtW5POp1f2WJwgcZxylkR1CjwaqMyXmSoVl46pyH3tr5+dptsQoKSGdi6sIHGA60oDotFPcm+0ifa47wZw+vapuuDi4tdNxhrHGaDMG8xiE0WFDHwQUDlk2/+W7j9SEX0H3Em7us371JXRp56EDwEcDa34VpVkC6i8HGcHK55hnxVbMZXGf3qhOFD8wY7qMbjMRvIpucrMHBi86OfkDfv0vDj2LyvIl5APj/AX50BrE0tfH1MZbH26Jkx4NdlkcxQ14GumarmUqfmVvbX/fsoA6oUuAAE9ZgRRi3KHO4wci6KUcRfdm+XOeUkaBFsL86G3EEYIvrtBTuaypdz+Cx7nd1iPZyWMx5Y1gXnVzha4nBdV4+7l9JIsFggD8QVpw2uHXQiS1KXFjOeqA3DBD8tjMB7q26Fl2fD3jkOo4BTbQ2NrRIZUu/iL+fOmMPsyMt2qulB0yaSBCfkbEq8xrUA="
file:
- build/prod/cyberchef.htm
- build/node/CyberChef.js
on:
repo: gchq/CyberChef
tags: true
- provider: npm
skip_cleanup: true
email: "n1474335@gmail.com"
api_key:
secure: "Z3FK6bm4RfQEIRXZ1lBNzQkVIoHpivThr9U+XBHmsBgIfdrK/XUnzs/slugo+NIz8nPiGmMx4gxyJonBCLHDGb1ysky2aEWTl26c0teaF4DeQEjWC1ZaGzv8MV1/GkUamnr1qouXjyUhyEAp33rd8ccN9Rq3QNYB/qLDcA9/FCme7JCW6sCd4zWO0LGEYMJEMc2FzAUkqhqsI05hegGhSDgKXRn5PmLARek4yHD+Hx7pstaTeQIy0WoGJjdzoB3iJIMmo/hWZGzZafktUOh223c5qzx4zMpDRNmMngBUw6R94nKd4KvplYRgB87Y3L/aiVU4CF+axwLmK8RPaC1wbJnlHf06zxHPdiFmsY/zKPpNel+nOnxzRrF5l2KMU4TU6gug3s9Jnzp9T5UMfhp0jW3YkxHGeuOPOeE1i0lTUWUGWrPHLQquAhLfkr2zxaU4ETk/y85hq9W4LAy0ENEDVXX2jP7FnI4Z1fdpmljpmVNJR+outPg6t+Coqgvil7v7XpMtDm8lKQanVYuxwmkb/ncOWFRWuM2j5zIEg3CHnFDcJ9bYrfKRg0b0tb/2BWD14pQnV76goVwzJQYVzdPc8TKIYJw2BZ1Nh9c0iruQVebe/6l1FX9fDCkz8VMmltni61/LxZrf8y0NT1YaU1raeNY2dH5UWvEa9p72FPMI6Eg="
on:
tags: true
branch: master
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/83c143a6822e218d5b34
on_success: change
on_failure: always
on_start: never
+649
View File
@@ -0,0 +1,649 @@
# Changelog
## Versioning
CyberChef uses the [semver](https://semver.org/) system to manage versioning: `<MAJOR>.<MINOR>.<PATCH>`.
- MAJOR version changes represent a significant change to the fundamental architecture of CyberChef and may (but don't always) make breaking changes that are not backwards compatible.
- MINOR version changes usually mean the addition of new operations or reasonably significant new features.
- PATCH versions are used for bug fixes and any other small tweaks that modify or improve existing capabilities.
All major and minor version changes will be documented in this file. Details of patch-level version changes can be found in [commit messages](https://github.com/gchq/CyberChef/commits/master).
## Details
### [10.5.0] - 2023-07-14
- Added GOST Encrypt, Decrypt, Sign, Verify, Key Wrap, and Key Unwrap operations [@n1474335] | [#592]
### [10.4.0] - 2023-03-24
- Added 'Generate De Bruijn Sequence' operation [@gchq77703] | [#493]
### [10.3.0] - 2023-03-24
- Added 'Argon2' and 'Argon2 compare' operations [@Xenonym] | [#661]
### [10.2.0] - 2023-03-23
- Added 'Derive HKDF key' operation [@mikecat] | [#1528]
### [10.1.0] - 2023-03-23
- Added 'Levenshtein Distance' operation [@mikecat] | [#1498]
- Added 'Swap case' operation [@mikecat] | [#1499]
## [10.0.0] - 2023-03-22
- [Full details explained here](https://github.com/gchq/CyberChef/wiki/Character-encoding,-EOL-separators,-and-editor-features)
- Status bars added to the Input and Output [@n1474335] | [#1405]
- Character encoding selection added to the Input and Output [@n1474335] | [#1405]
- End of line separator selection added to the Input and Output [@n1474335] | [#1405]
- Non-printable characters are rendered as control character pictures [@n1474335] | [#1405]
- Loaded files can now be edited in the Input [@n1474335] | [#1405]
- Various editor features added such as multiple selections and bracket matching [@n1474335] | [#1405]
- Contextual help added, activated by pressing F1 while hovering over features [@n1474335] | [#1405]
- Many, many UI tests added for I/O features and operations [@n1474335] | [#1405]
<details>
<summary>Click to expand v9 minor versions</summary>
### [9.55.0] - 2022-12-09
- Added 'AMF Encode' and 'AMF Decode' operations [@n1474335] | [760eff4]
### [9.54.0] - 2022-11-25
- Added 'Rabbit' operation [@mikecat] | [#1450]
### [9.53.0] - 2022-11-25
- Added 'AES Key Wrap' and 'AES Key Unwrap' operations [@mikecat] | [#1456]
### [9.52.0] - 2022-11-25
- Added 'ChaCha' operation [@joostrijneveld] | [#1466]
### [9.51.0] - 2022-11-25
- Added 'CMAC' operation [@mikecat] | [#1457]
### [9.50.0] - 2022-11-25
- Added 'Shuffle' operation [@mikecat] | [#1472]
### [9.49.0] - 2022-11-11
- Added 'LZ4 Compress' and 'LZ4 Decompress' operations [@n1474335] | [31a7f83]
### [9.48.0] - 2022-10-14
- Added 'LM Hash' and 'NT Hash' operations [@n1474335] [@brun0ne] | [#1427]
### [9.47.0] - 2022-10-14
- Added 'LZMA Decompress' and 'LZMA Compress' operations [@mattnotmitt] | [#1421]
### [9.46.0] - 2022-07-08
- Added 'Cetacean Cipher Encode' and 'Cetacean Cipher Decode' operations [@valdelaseras] | [#1308]
### [9.45.0] - 2022-07-08
- Added 'ROT8000' operation [@thomasleplus] | [#1250]
### [9.44.0] - 2022-07-08
- Added 'LZString Compress' and 'LZString Decompress' operations [@crespyl] | [#1266]
### [9.43.0] - 2022-07-08
- Added 'ROT13 Brute Force' and 'ROT47 Brute Force' operations [@mikecat] | [#1264]
### [9.42.0] - 2022-07-08
- Added 'LS47 Encrypt' and 'LS47 Decrypt' operations [@n1073645] | [#951]
### [9.41.0] - 2022-07-08
- Added 'Caesar Box Cipher' operation [@n1073645] | [#1066]
### [9.40.0] - 2022-07-08
- Added 'P-list Viewer' operation [@n1073645] | [#906]
### [9.39.0] - 2022-06-09
- Added 'ELF Info' operation [@n1073645] | [#1364]
### [9.38.0] - 2022-05-30
- Added 'Parse TCP' operation [@n1474335] | [a895d1d]
### [9.37.0] - 2022-03-29
- 'SM4 Encrypt' and 'SM4 Decrypt' operations added [@swesven] | [#1189]
- NoPadding options added for CBC and ECB modes in AES, DES and Triple DES Decrypt operations [@swesven] | [#1189]
### [9.36.0] - 2022-03-29
- 'SIGABA' operation added [@hettysymes] | [#934]
### [9.35.0] - 2022-03-28
- 'To Base45' and 'From Base45' operations added [@t-8ch] | [#1242]
### [9.34.0] - 2022-03-28
- 'Get All Casings' operation added [@n1073645] | [#1065]
### [9.33.0] - 2022-03-25
- Updated to support Node 17 [@n1474335] [@john19696] [@t-8ch] | [[#1326] [#1313] [#1244]
- Improved CJS and ESM module support [@d98762625] | [#1037]
### [9.32.0] - 2021-08-18
- 'Protobuf Encode' operation added and decode operation modified to allow decoding with full and partial schemas [@n1474335] | [dd18e52]
### [9.31.0] - 2021-08-10
- 'HASSH Client Fingerprint' and 'HASSH Server Fingerprint' operations added [@n1474335] | [e9ca4dc]
### [9.30.0] - 2021-08-10
- 'JA3S Fingerprint' operation added [@n1474335] | [289a417]
### [9.29.0] - 2021-07-28
- 'JA3 Fingerprint' operation added [@n1474335] | [9a33498]
### [9.28.0] - 2021-03-26
- 'CBOR Encode' and 'CBOR Decode' operations added [@Danh4] | [#999]
### [9.27.0] - 2021-02-12
- 'Fuzzy Match' operation added [@n1474335] | [8ad18b]
### [9.26.0] - 2021-02-11
- 'Get Time' operation added [@n1073645] [@n1474335] | [#1045]
### [9.25.0] - 2021-02-11
- 'Extract ID3' operation added [@n1073645] [@n1474335] | [#1006]
### [9.24.0] - 2021-02-02
- 'SM3' hashing function added along with more configuration options for other hashing operations [@n1073645] [@n1474335] | [#1022]
### [9.23.0] - 2021-02-01
- Various RSA operations added to encrypt, decrypt, sign, verify and generate keys [@mattnotmitt] [@GCHQ77703] | [#652]
### [9.22.0] - 2021-02-01
- 'Unicode Text Format' operation added [@mattnotmitt] | [#1083]
### [9.21.0] - 2020-06-12
- Node API now exports `magic` operation [@d98762625] | [#1049]
### [9.20.0] - 2020-03-27
- 'Parse ObjectID Timestamp' operation added [@dmfj] | [#987]
### [9.19.0] - 2020-03-24
- Improvements to the 'Magic' operation, allowing it to recognise more data formats and provide more accurate results [@n1073645] [@n1474335] | [#966] [b765534b](https://github.com/gchq/CyberChef/commit/b765534b8b2a0454a5132a0a52d1d8844bcbdaaa)
### [9.18.0] - 2020-03-13
- 'Convert to NATO alphabet' operation added [@MarvinJWendt] | [#674]
### [9.17.0] - 2020-03-13
- 'Generate Image' operation added [@pointhi] | [#683]
### [9.16.0] - 2020-03-06
- 'Colossus' operation added [@VirtualColossus] | [#917]
### [9.15.0] - 2020-03-05
- 'CipherSaber2 Encrypt' and 'CipherSaber2 Decrypt' operations added [@n1073645] | [#952]
### [9.14.0] - 2020-03-05
- 'Luhn Checksum' operation added [@n1073645] | [#965]
### [9.13.0] - 2020-02-13
- 'Rail Fence Cipher Encode' and 'Rail Fence Cipher Decode' operations added [@Flavsditz] | [#948]
### [9.12.0] - 2019-12-20
- 'Normalise Unicode' operation added [@matthieuxyz] | [#912]
### [9.11.0] - 2019-11-06
- Implemented CFB, OFB, and CTR modes for Blowfish operations [@cbeuw] | [#653]
### [9.10.0] - 2019-11-06
- 'Lorenz' operation added [@VirtualColossus] | [#528]
### [9.9.0] - 2019-11-01
- Added support for 109 more character encodings [@n1474335]
### [9.8.0] - 2019-10-31
- 'Avro to JSON' operation added [@jarrodconnolly] | [#865]
### [9.7.0] - 2019-09-13
- 'Optical Character Recognition' operation added [@MShwed] [@n1474335] | [#632]
### [9.6.0] - 2019-09-04
- 'Bacon Cipher Encode' and 'Bacon Cipher Decode' operations added [@kassi] | [#500]
### [9.5.0] - 2019-09-04
- Various Steganography operations added: 'Extract LSB', 'Extract RGBA', 'Randomize Colour Palette', and 'View Bit Plane' [@Ge0rg3] | [#625]
### [9.4.0] - 2019-08-30
- 'Render Markdown' operation added [@j433866] | [#627]
### [9.3.0] - 2019-08-30
- 'Show on map' operation added [@j433866] | [#477]
### [9.2.0] - 2019-08-23
- 'Parse UDP' operation added [@h345983745] | [#614]
### [9.1.0] - 2019-08-22
- 'Parse SSH Host Key' operation added [@j433866] | [#595]
- 'Defang IP Addresses' operation added [@h345983745] | [#556]
</details>
## [9.0.0] - 2019-07-09
- [Multiple inputs](https://github.com/gchq/CyberChef/wiki/Multiple-Inputs) are now supported in the main web UI, allowing you to upload and process multiple files at once [@j433866] | [#566]
- A [Node.js API](https://github.com/gchq/CyberChef/wiki/Node-API) has been implemented, meaning that CyberChef can now be used as a library, either to provide specific operations, or an entire baking environment [@d98762625] | [#291]
- A [read-eval-print loop (REPL)](https://github.com/gchq/CyberChef/wiki/Node-API#repl) is also included to enable prototyping and experimentation with the API [@d98762625] | [#291]
- Light and dark Solarized themes added [@j433866] | [#566]
<details>
<summary>Click to expand v8 minor versions</summary>
### [8.38.0] - 2019-07-03
- 'Streebog' and 'GOST hash' operations added [@MShwed] [@n1474335] | [#530]
### [8.37.0] - 2019-07-03
- 'CRC-8 Checksum' operation added [@MShwed] | [#591]
### [8.36.0] - 2019-07-03
- 'PGP Verify' operation added [@artemisbot] | [#585]
### [8.35.0] - 2019-07-03
- 'Sharpen Image', 'Convert Image Format' and 'Add Text To Image' operations added [@j433866] | [#515]
### [8.34.0] - 2019-06-28
- Various new visualisations added to the 'Entropy' operation [@MShwed] | [#535]
- Efficiency improvements made to the 'Entropy' operation for large file support [@n1474335]
### [8.33.0] - 2019-06-27
- 'Bzip2 Compress' operation added and 'Bzip2 Decompress' operation greatly improved [@artemisbot] | [#531]
### [8.32.0] - 2019-06-27
- 'Index of Coincidence' operation added [@Ge0rg3] | [#571]
### [8.31.0] - 2019-04-12
- The downloadable version of CyberChef is now a .zip file containing separate modules rather than a single .htm file. It is still completely standalone and will not make any external network requests. This change reduces the complexity of the build process significantly. [@n1474335]
### [8.30.0] - 2019-04-12
- 'Decode Protobuf' operation added [@n1474335] | [#533]
### [8.29.0] - 2019-03-31
- 'BLAKE2s' and 'BLAKE2b' hashing operations added [@h345983745] | [#525]
### [8.28.0] - 2019-03-31
- 'Heatmap Chart', 'Hex Density Chart', 'Scatter Chart' and 'Series Chart' operation added [@artemisbot] [@tlwr] | [#496] [#143]
### [8.27.0] - 2019-03-14
- 'Enigma', 'Typex', 'Bombe' and 'Multiple Bombe' operations added [@s2224834] | [#516]
- See [this wiki article](https://github.com/gchq/CyberChef/wiki/Enigma,-the-Bombe,-and-Typex) for a full explanation of these operations.
- New Bombe-style loading animation added for long-running operations [@n1474335]
- New operation argument types added: `populateMultiOption` and `argSelector` [@n1474335]
### [8.26.0] - 2019-03-09
- Various image manipulation operations added [@j433866] | [#506]
### [8.25.0] - 2019-03-09
- 'Extract Files' operation added and more file formats supported [@n1474335] | [#440]
### [8.24.0] - 2019-02-08
- 'DNS over HTTPS' operation added [@h345983745] | [#489]
### [8.23.1] - 2019-01-18
- 'Convert co-ordinate format' operation added [@j433866] | [#476]
### [8.23.0] - 2019-01-18
- 'YARA Rules' operation added [@artemisbot] | [#468]
### [8.22.0] - 2019-01-10
- 'Subsection' operation added [@j433866] | [#467]
### [8.21.0] - 2019-01-10
- 'To Case Insensitive Regex' and 'From Case Insensitive Regex' operations added [@masq] | [#461]
### [8.20.0] - 2019-01-09
- 'Generate Lorem Ipsum' operation added [@klaxon1] | [#455]
### [8.19.0] - 2018-12-30
- UI test suite added to confirm that the app loads correctly in a reasonable time and that various operations from each module can be run [@n1474335] | [#458]
### [8.18.0] - 2018-12-26
- 'Split Colour Channels' operation added [@artemisbot] | [#449]
### [8.17.0] - 2018-12-25
- 'Generate QR Code' and 'Parse QR Code' operations added [@j433866] | [#448]
### [8.16.0] - 2018-12-19
- 'Play Media' operation added [@anthony-arnold] | [#446]
### [8.15.0] - 2018-12-18
- 'Text Encoding Brute Force' operation added [@Cynser] | [#439]
### [8.14.0] - 2018-12-18
- 'To Base62' and 'From Base62' operations added [@tcode2k16] | [#443]
### [8.13.0] - 2018-12-15
- 'A1Z26 Cipher Encode' and 'A1Z26 Cipher Decode' operations added [@jarmovanlenthe] | [#441]
### [8.12.0] - 2018-11-21
- 'Citrix CTX1 Encode' and 'Citrix CTX1 Decode' operations added [@bwhitn] | [#428]
### [8.11.0] - 2018-11-13
- 'CSV to JSON' and 'JSON to CSV' operations added [@n1474335] | [#277]
### [8.10.0] - 2018-11-07
- 'Remove Diacritics' operation added [@klaxon1] | [#387]
### [8.9.0] - 2018-11-07
- 'Defang URL' operation added [@arnydo] | [#394]
### [8.8.0] - 2018-10-10
- 'Parse TLV' operation added [@GCHQ77703] | [#351]
### [8.7.0] - 2018-08-31
- 'JWT Sign', 'JWT Verify' and 'JWT Decode' operations added [@GCHQ77703] | [#348]
### [8.6.0] - 2018-08-29
- 'To Geohash' and 'From Geohash' operations added [@GCHQ77703] | [#344]
### [8.5.0] - 2018-08-23
- 'To Braille' and 'From Braille' operations added [@n1474335] | [#255]
### [8.4.0] - 2018-08-23
- 'To Base85' and 'From Base85' operations added [@PenguinGeorge] | [#340]
### [8.3.0] - 2018-08-21
- 'To MessagePack' and 'From MessagePack' operations added [@artemisbot] | [#338]
### [8.2.0] - 2018-08-21
- Information links added to most operations, accessible in the description popover [@PenguinGeorge] | [#298]
### [8.1.0] - 2018-08-19
- 'Dechunk HTTP response' operation added [@sevzero] | [#311]
</details>
## [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) [@n1474335] [@d98762625] [@artemisbot] [@picapi] | [#284]
- Operation architecture restructured to make adding new operations a lot simpler [@n1474335] | [#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
- Threading support added. All recipe processing moved into a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) to increase performance and to allow long-running operations to be cancelled [@n1474335] | [#173]
- Module system created 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
- Webpack build process configured with Babel transpilation and ES6 imports and exports [@n1474335] | [#95]
## [4.0.0] - 2016-11-28
- Initial open source commit [@n1474335] | [b1d73a72](https://github.com/gchq/CyberChef/commit/b1d73a725dc7ab9fb7eb789296efd2b7e4b08306)
[10.5.0]: https://github.com/gchq/CyberChef/releases/tag/v10.5.0
[10.4.0]: https://github.com/gchq/CyberChef/releases/tag/v10.4.0
[10.3.0]: https://github.com/gchq/CyberChef/releases/tag/v10.3.0
[10.2.0]: https://github.com/gchq/CyberChef/releases/tag/v10.2.0
[10.1.0]: https://github.com/gchq/CyberChef/releases/tag/v10.1.0
[10.0.0]: https://github.com/gchq/CyberChef/releases/tag/v10.0.0
[9.55.0]: https://github.com/gchq/CyberChef/releases/tag/v9.55.0
[9.54.0]: https://github.com/gchq/CyberChef/releases/tag/v9.54.0
[9.53.0]: https://github.com/gchq/CyberChef/releases/tag/v9.53.0
[9.52.0]: https://github.com/gchq/CyberChef/releases/tag/v9.52.0
[9.51.0]: https://github.com/gchq/CyberChef/releases/tag/v9.51.0
[9.50.0]: https://github.com/gchq/CyberChef/releases/tag/v9.50.0
[9.49.0]: https://github.com/gchq/CyberChef/releases/tag/v9.49.0
[9.48.0]: https://github.com/gchq/CyberChef/releases/tag/v9.48.0
[9.47.0]: https://github.com/gchq/CyberChef/releases/tag/v9.47.0
[9.46.0]: https://github.com/gchq/CyberChef/releases/tag/v9.46.0
[9.45.0]: https://github.com/gchq/CyberChef/releases/tag/v9.45.0
[9.44.0]: https://github.com/gchq/CyberChef/releases/tag/v9.44.0
[9.43.0]: https://github.com/gchq/CyberChef/releases/tag/v9.43.0
[9.42.0]: https://github.com/gchq/CyberChef/releases/tag/v9.42.0
[9.41.0]: https://github.com/gchq/CyberChef/releases/tag/v9.41.0
[9.40.0]: https://github.com/gchq/CyberChef/releases/tag/v9.40.0
[9.39.0]: https://github.com/gchq/CyberChef/releases/tag/v9.39.0
[9.38.0]: https://github.com/gchq/CyberChef/releases/tag/v9.38.0
[9.37.0]: https://github.com/gchq/CyberChef/releases/tag/v9.37.0
[9.36.0]: https://github.com/gchq/CyberChef/releases/tag/v9.36.0
[9.35.0]: https://github.com/gchq/CyberChef/releases/tag/v9.35.0
[9.34.0]: https://github.com/gchq/CyberChef/releases/tag/v9.34.0
[9.33.0]: https://github.com/gchq/CyberChef/releases/tag/v9.33.0
[9.32.0]: https://github.com/gchq/CyberChef/releases/tag/v9.32.0
[9.31.0]: https://github.com/gchq/CyberChef/releases/tag/v9.31.0
[9.30.0]: https://github.com/gchq/CyberChef/releases/tag/v9.30.0
[9.29.0]: https://github.com/gchq/CyberChef/releases/tag/v9.29.0
[9.28.0]: https://github.com/gchq/CyberChef/releases/tag/v9.28.0
[9.27.0]: https://github.com/gchq/CyberChef/releases/tag/v9.27.0
[9.26.0]: https://github.com/gchq/CyberChef/releases/tag/v9.26.0
[9.25.0]: https://github.com/gchq/CyberChef/releases/tag/v9.25.0
[9.24.0]: https://github.com/gchq/CyberChef/releases/tag/v9.24.0
[9.23.0]: https://github.com/gchq/CyberChef/releases/tag/v9.23.0
[9.22.0]: https://github.com/gchq/CyberChef/releases/tag/v9.22.0
[9.21.0]: https://github.com/gchq/CyberChef/releases/tag/v9.21.0
[9.20.0]: https://github.com/gchq/CyberChef/releases/tag/v9.20.0
[9.19.0]: https://github.com/gchq/CyberChef/releases/tag/v9.19.0
[9.18.0]: https://github.com/gchq/CyberChef/releases/tag/v9.18.0
[9.17.0]: https://github.com/gchq/CyberChef/releases/tag/v9.17.0
[9.16.0]: https://github.com/gchq/CyberChef/releases/tag/v9.16.0
[9.15.0]: https://github.com/gchq/CyberChef/releases/tag/v9.15.0
[9.14.0]: https://github.com/gchq/CyberChef/releases/tag/v9.14.0
[9.13.0]: https://github.com/gchq/CyberChef/releases/tag/v9.13.0
[9.12.0]: https://github.com/gchq/CyberChef/releases/tag/v9.12.0
[9.11.0]: https://github.com/gchq/CyberChef/releases/tag/v9.11.0
[9.10.0]: https://github.com/gchq/CyberChef/releases/tag/v9.10.0
[9.9.0]: https://github.com/gchq/CyberChef/releases/tag/v9.9.0
[9.8.0]: https://github.com/gchq/CyberChef/releases/tag/v9.8.0
[9.7.0]: https://github.com/gchq/CyberChef/releases/tag/v9.7.0
[9.6.0]: https://github.com/gchq/CyberChef/releases/tag/v9.6.0
[9.5.0]: https://github.com/gchq/CyberChef/releases/tag/v9.5.0
[9.4.0]: https://github.com/gchq/CyberChef/releases/tag/v9.4.0
[9.3.0]: https://github.com/gchq/CyberChef/releases/tag/v9.3.0
[9.2.0]: https://github.com/gchq/CyberChef/releases/tag/v9.2.0
[9.1.0]: https://github.com/gchq/CyberChef/releases/tag/v9.1.0
[9.0.0]: https://github.com/gchq/CyberChef/releases/tag/v9.0.0
[8.38.0]: https://github.com/gchq/CyberChef/releases/tag/v8.38.0
[8.37.0]: https://github.com/gchq/CyberChef/releases/tag/v8.37.0
[8.36.0]: https://github.com/gchq/CyberChef/releases/tag/v8.36.0
[8.35.0]: https://github.com/gchq/CyberChef/releases/tag/v8.35.0
[8.34.0]: https://github.com/gchq/CyberChef/releases/tag/v8.34.0
[8.33.0]: https://github.com/gchq/CyberChef/releases/tag/v8.33.0
[8.32.0]: https://github.com/gchq/CyberChef/releases/tag/v8.32.0
[8.31.0]: https://github.com/gchq/CyberChef/releases/tag/v8.31.0
[8.30.0]: https://github.com/gchq/CyberChef/releases/tag/v8.30.0
[8.29.0]: https://github.com/gchq/CyberChef/releases/tag/v8.29.0
[8.28.0]: https://github.com/gchq/CyberChef/releases/tag/v8.28.0
[8.27.0]: https://github.com/gchq/CyberChef/releases/tag/v8.27.0
[8.26.0]: https://github.com/gchq/CyberChef/releases/tag/v8.26.0
[8.25.0]: https://github.com/gchq/CyberChef/releases/tag/v8.25.0
[8.24.0]: https://github.com/gchq/CyberChef/releases/tag/v8.24.0
[8.23.1]: https://github.com/gchq/CyberChef/releases/tag/v8.23.1
[8.23.0]: https://github.com/gchq/CyberChef/releases/tag/v8.23.0
[8.22.0]: https://github.com/gchq/CyberChef/releases/tag/v8.22.0
[8.21.0]: https://github.com/gchq/CyberChef/releases/tag/v8.21.0
[8.20.0]: https://github.com/gchq/CyberChef/releases/tag/v8.20.0
[8.19.0]: https://github.com/gchq/CyberChef/releases/tag/v8.19.0
[8.18.0]: https://github.com/gchq/CyberChef/releases/tag/v8.18.0
[8.17.0]: https://github.com/gchq/CyberChef/releases/tag/v8.17.0
[8.16.0]: https://github.com/gchq/CyberChef/releases/tag/v8.16.0
[8.15.0]: https://github.com/gchq/CyberChef/releases/tag/v8.15.0
[8.14.0]: https://github.com/gchq/CyberChef/releases/tag/v8.14.0
[8.13.0]: https://github.com/gchq/CyberChef/releases/tag/v8.13.0
[8.12.0]: https://github.com/gchq/CyberChef/releases/tag/v8.12.0
[8.11.0]: https://github.com/gchq/CyberChef/releases/tag/v8.11.0
[8.10.0]: https://github.com/gchq/CyberChef/releases/tag/v8.10.0
[8.9.0]: https://github.com/gchq/CyberChef/releases/tag/v8.9.0
[8.8.0]: https://github.com/gchq/CyberChef/releases/tag/v8.8.0
[8.7.0]: https://github.com/gchq/CyberChef/releases/tag/v8.7.0
[8.6.0]: https://github.com/gchq/CyberChef/releases/tag/v8.6.0
[8.5.0]: https://github.com/gchq/CyberChef/releases/tag/v8.5.0
[8.4.0]: https://github.com/gchq/CyberChef/releases/tag/v8.4.0
[8.3.0]: https://github.com/gchq/CyberChef/releases/tag/v8.3.0
[8.2.0]: https://github.com/gchq/CyberChef/releases/tag/v8.2.0
[8.1.0]: https://github.com/gchq/CyberChef/releases/tag/v8.1.0
[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
[@n1474335]: https://github.com/n1474335
[@d98762625]: https://github.com/d98762625
[@j433866]: https://github.com/j433866
[@n1073645]: https://github.com/n1073645
[@GCHQ77703]: https://github.com/GCHQ77703
[@h345983745]: https://github.com/h345983745
[@s2224834]: https://github.com/s2224834
[@artemisbot]: https://github.com/artemisbot
[@tlwr]: https://github.com/tlwr
[@picapi]: https://github.com/picapi
[@Dachande663]: https://github.com/Dachande663
[@JustAnotherMark]: https://github.com/JustAnotherMark
[@sevzero]: https://github.com/sevzero
[@PenguinGeorge]: https://github.com/PenguinGeorge
[@arnydo]: https://github.com/arnydo
[@klaxon1]: https://github.com/klaxon1
[@bwhitn]: https://github.com/bwhitn
[@jarmovanlenthe]: https://github.com/jarmovanlenthe
[@tcode2k16]: https://github.com/tcode2k16
[@Cynser]: https://github.com/Cynser
[@anthony-arnold]: https://github.com/anthony-arnold
[@masq]: https://github.com/masq
[@Ge0rg3]: https://github.com/Ge0rg3
[@MShwed]: https://github.com/MShwed
[@kassi]: https://github.com/kassi
[@jarrodconnolly]: https://github.com/jarrodconnolly
[@VirtualColossus]: https://github.com/VirtualColossus
[@cbeuw]: https://github.com/cbeuw
[@matthieuxyz]: https://github.com/matthieuxyz
[@Flavsditz]: https://github.com/Flavsditz
[@pointhi]: https://github.com/pointhi
[@MarvinJWendt]: https://github.com/MarvinJWendt
[@dmfj]: https://github.com/dmfj
[@mattnotmitt]: https://github.com/mattnotmitt
[@Danh4]: https://github.com/Danh4
[@john19696]: https://github.com/john19696
[@t-8ch]: https://github.com/t-8ch
[@hettysymes]: https://github.com/hettysymes
[@swesven]: https://github.com/swesven
[@mikecat]: https://github.com/mikecat
[@crespyl]: https://github.com/crespyl
[@thomasleplus]: https://github.com/thomasleplus
[@valdelaseras]: https://github.com/valdelaseras
[@brun0ne]: https://github.com/brun0ne
[@joostrijneveld]: https://github.com/joostrijneveld
[@Xenonym]: https://github.com/Xenonym
[@gchq77703]: https://github.com/gchq77703
[8ad18b]: https://github.com/gchq/CyberChef/commit/8ad18bc7db6d9ff184ba3518686293a7685bf7b7
[9a33498]: https://github.com/gchq/CyberChef/commit/9a33498fed26a8df9c9f35f39a78a174bf50a513
[289a417]: https://github.com/gchq/CyberChef/commit/289a417dfb5923de5e1694354ec42a08d9395bfe
[e9ca4dc]: https://github.com/gchq/CyberChef/commit/e9ca4dc9caf98f33fd986431cd400c88082a42b8
[dd18e52]: https://github.com/gchq/CyberChef/commit/dd18e529939078b89867297b181a584e8b2cc7da
[a895d1d]: https://github.com/gchq/CyberChef/commit/a895d1d82a2f92d440a0c5eca2bc7c898107b737
[31a7f83]: https://github.com/gchq/CyberChef/commit/31a7f83b82e78927f89689f323fcb9185144d6ff
[760eff4]: https://github.com/gchq/CyberChef/commit/760eff49b5307aaa3104c5e5b437ffe62299acd1
[#95]: https://github.com/gchq/CyberChef/pull/299
[#173]: https://github.com/gchq/CyberChef/pull/173
[#143]: https://github.com/gchq/CyberChef/pull/143
[#224]: https://github.com/gchq/CyberChef/pull/224
[#239]: https://github.com/gchq/CyberChef/pull/239
[#248]: https://github.com/gchq/CyberChef/pull/248
[#255]: https://github.com/gchq/CyberChef/issues/255
[#277]: https://github.com/gchq/CyberChef/issues/277
[#281]: https://github.com/gchq/CyberChef/pull/281
[#284]: https://github.com/gchq/CyberChef/pull/284
[#291]: https://github.com/gchq/CyberChef/pull/291
[#294]: https://github.com/gchq/CyberChef/pull/294
[#296]: https://github.com/gchq/CyberChef/pull/296
[#298]: https://github.com/gchq/CyberChef/pull/298
[#311]: https://github.com/gchq/CyberChef/pull/311
[#325]: https://github.com/gchq/CyberChef/pull/325
[#338]: https://github.com/gchq/CyberChef/pull/338
[#340]: https://github.com/gchq/CyberChef/pull/340
[#344]: https://github.com/gchq/CyberChef/pull/344
[#348]: https://github.com/gchq/CyberChef/pull/348
[#351]: https://github.com/gchq/CyberChef/pull/351
[#387]: https://github.com/gchq/CyberChef/pull/387
[#394]: https://github.com/gchq/CyberChef/pull/394
[#428]: https://github.com/gchq/CyberChef/pull/428
[#439]: https://github.com/gchq/CyberChef/pull/439
[#440]: https://github.com/gchq/CyberChef/pull/440
[#441]: https://github.com/gchq/CyberChef/pull/441
[#443]: https://github.com/gchq/CyberChef/pull/443
[#446]: https://github.com/gchq/CyberChef/pull/446
[#448]: https://github.com/gchq/CyberChef/pull/448
[#449]: https://github.com/gchq/CyberChef/pull/449
[#455]: https://github.com/gchq/CyberChef/pull/455
[#458]: https://github.com/gchq/CyberChef/pull/458
[#461]: https://github.com/gchq/CyberChef/pull/461
[#467]: https://github.com/gchq/CyberChef/pull/467
[#468]: https://github.com/gchq/CyberChef/pull/468
[#476]: https://github.com/gchq/CyberChef/pull/476
[#477]: https://github.com/gchq/CyberChef/pull/477
[#489]: https://github.com/gchq/CyberChef/pull/489
[#496]: https://github.com/gchq/CyberChef/pull/496
[#500]: https://github.com/gchq/CyberChef/pull/500
[#506]: https://github.com/gchq/CyberChef/pull/506
[#515]: https://github.com/gchq/CyberChef/pull/515
[#516]: https://github.com/gchq/CyberChef/pull/516
[#525]: https://github.com/gchq/CyberChef/pull/525
[#528]: https://github.com/gchq/CyberChef/pull/528
[#530]: https://github.com/gchq/CyberChef/pull/530
[#531]: https://github.com/gchq/CyberChef/pull/531
[#533]: https://github.com/gchq/CyberChef/pull/533
[#535]: https://github.com/gchq/CyberChef/pull/535
[#556]: https://github.com/gchq/CyberChef/pull/556
[#566]: https://github.com/gchq/CyberChef/pull/566
[#571]: https://github.com/gchq/CyberChef/pull/571
[#585]: https://github.com/gchq/CyberChef/pull/585
[#591]: https://github.com/gchq/CyberChef/pull/591
[#595]: https://github.com/gchq/CyberChef/pull/595
[#614]: https://github.com/gchq/CyberChef/pull/614
[#625]: https://github.com/gchq/CyberChef/pull/625
[#627]: https://github.com/gchq/CyberChef/pull/627
[#632]: https://github.com/gchq/CyberChef/pull/632
[#652]: https://github.com/gchq/CyberChef/pull/652
[#653]: https://github.com/gchq/CyberChef/pull/653
[#674]: https://github.com/gchq/CyberChef/pull/674
[#683]: https://github.com/gchq/CyberChef/pull/683
[#865]: https://github.com/gchq/CyberChef/pull/865
[#906]: https://github.com/gchq/CyberChef/pull/906
[#912]: https://github.com/gchq/CyberChef/pull/912
[#917]: https://github.com/gchq/CyberChef/pull/917
[#934]: https://github.com/gchq/CyberChef/pull/934
[#948]: https://github.com/gchq/CyberChef/pull/948
[#951]: https://github.com/gchq/CyberChef/pull/951
[#952]: https://github.com/gchq/CyberChef/pull/952
[#965]: https://github.com/gchq/CyberChef/pull/965
[#966]: https://github.com/gchq/CyberChef/pull/966
[#987]: https://github.com/gchq/CyberChef/pull/987
[#999]: https://github.com/gchq/CyberChef/pull/999
[#1006]: https://github.com/gchq/CyberChef/pull/1006
[#1022]: https://github.com/gchq/CyberChef/pull/1022
[#1037]: https://github.com/gchq/CyberChef/pull/1037
[#1045]: https://github.com/gchq/CyberChef/pull/1045
[#1049]: https://github.com/gchq/CyberChef/pull/1049
[#1065]: https://github.com/gchq/CyberChef/pull/1065
[#1066]: https://github.com/gchq/CyberChef/pull/1066
[#1083]: https://github.com/gchq/CyberChef/pull/1083
[#1189]: https://github.com/gchq/CyberChef/pull/1189
[#1242]: https://github.com/gchq/CyberChef/pull/1242
[#1244]: https://github.com/gchq/CyberChef/pull/1244
[#1313]: https://github.com/gchq/CyberChef/pull/1313
[#1326]: https://github.com/gchq/CyberChef/pull/1326
[#1364]: https://github.com/gchq/CyberChef/pull/1364
[#1264]: https://github.com/gchq/CyberChef/pull/1264
[#1266]: https://github.com/gchq/CyberChef/pull/1266
[#1250]: https://github.com/gchq/CyberChef/pull/1250
[#1308]: https://github.com/gchq/CyberChef/pull/1308
[#1405]: https://github.com/gchq/CyberChef/pull/1405
[#1421]: https://github.com/gchq/CyberChef/pull/1421
[#1427]: https://github.com/gchq/CyberChef/pull/1427
[#1472]: https://github.com/gchq/CyberChef/pull/1472
[#1457]: https://github.com/gchq/CyberChef/pull/1457
[#1466]: https://github.com/gchq/CyberChef/pull/1466
[#1456]: https://github.com/gchq/CyberChef/pull/1456
[#1450]: https://github.com/gchq/CyberChef/pull/1450
[#1498]: https://github.com/gchq/CyberChef/pull/1498
[#1499]: https://github.com/gchq/CyberChef/pull/1499
[#1528]: https://github.com/gchq/CyberChef/pull/1528
[#661]: https://github.com/gchq/CyberChef/pull/661
[#493]: https://github.com/gchq/CyberChef/pull/493
[#592]: https://github.com/gchq/CyberChef/issues/592
+303 -280
View File
@@ -2,9 +2,11 @@
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 BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const glob = require("glob");
const path = require("path");
const nodeFlags = "--experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-warnings --no-deprecation";
/**
* Grunt configuration for building the app in various formats.
@@ -21,50 +23,66 @@ 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"]);
grunt.registerTask("node",
"Compiles CyberChef into a single NodeJS module.",
["clean:node", "webpack:metaConf", "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"]);
grunt.registerTask("docs",
"Compiles documentation in the /docs directory.",
["clean:docs", "jsdoc", "chmod:docs"]);
["clean:dev", "clean:config", "exec:generateConfig", "concurrent:dev"]);
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", "clean:config", "exec:generateConfig", "findModules", "webpack:web",
"copy:standalone", "zip:standalone", "clean:standalone", "exec:calcDownloadHash", "chmod"
]);
grunt.registerTask("node",
"Compiles CyberChef into a single NodeJS module.",
[
"clean:node", "clean:config", "clean:nodeConfig", "exec:generateConfig", "exec:generateNodeIndex"
]);
grunt.registerTask("configTests",
"A task which configures config files in preparation for tests to be run. Use `npm test` to run tests.",
[
"clean:config", "clean:nodeConfig", "exec:generateConfig", "exec:generateNodeIndex"
]);
grunt.registerTask("testui",
"A task which runs all the UI tests in the tests directory. The prod task must already have been run.",
["connect:prod", "exec:browserTests"]);
grunt.registerTask("testnodeconsumer",
"A task which checks whether consuming CJS and ESM apps work with the CyberChef build",
["exec:setupNodeConsumers", "exec:testCJSNodeConsumer", "exec:testESMNodeConsumer", "exec:teardownNodeConsumers"]);
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"]);
grunt.registerTask("runInliner", runInliner);
grunt.registerTask("doc", "docs");
grunt.registerTask("tests", "test");
grunt.registerTask("lint", "eslint");
grunt.registerTask("findModules",
"Finds all generated modules and updates the entry point list for Webpack",
function(arg1, arg2) {
const moduleEntryPoints = listEntryModules();
grunt.log.writeln(`Found ${Object.keys(moduleEntryPoints).length} modules.`);
grunt.config.set("webpack.web.entry",
Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints));
});
// Load tasks provided by each plugin
grunt.loadNpmTasks("grunt-eslint");
grunt.loadNpmTasks("grunt-webpack");
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");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-zip");
// Project configuration
@@ -75,161 +93,30 @@ module.exports = function (grunt) {
COMPILE_TIME: JSON.stringify(compileTime),
COMPILE_MSG: JSON.stringify(grunt.option("compile-msg") || grunt.option("msg") || ""),
PKG_VERSION: JSON.stringify(pkg.version),
ENVIRONMENT_IS_WORKER: function() {
return typeof importScripts === "function";
},
ENVIRONMENT_IS_NODE: function() {
return typeof process === "object" && typeof require === "function";
},
ENVIRONMENT_IS_WEB: function() {
return typeof window === "object";
}
},
moduleEntryPoints = listEntryModules();
/**
* Compiles a production build of CyberChef into a single, portable web page.
*/
function runInliner() {
const done = this.async();
Inliner.html({
relativeTo: "build/prod/",
fileContent: grunt.file.read("build/prod/cyberchef.htm"),
images: true,
svgs: true,
scripts: true,
links: true,
strict: true
}, function(error, result) {
if (error) {
if (error instanceof Error) {
done(error);
} else {
done(new Error(error));
}
} else {
grunt.file.write("build/prod/cyberchef.htm", result);
done(true);
}
});
}
/**
* Generates an entry list for all the modules.
*/
function listEntryModules() {
const path = "./src/core/config/modules/";
let entryModules = {};
fs.readdirSync(path).forEach(file => {
if (file !== "Default.js" && file !== "OpModules.js")
entryModules[file.split(".js")[0]] = path + file;
});
return entryModules;
}
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"],
docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico", "!docs/*.png"],
inlineScripts: ["build/prod/scripts.js"],
},
eslint: {
options: {
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"],
},
jsdoc: {
options: {
destination: "docs",
template: "node_modules/ink-docstrap/template",
recurse: true,
readme: "./README.md",
configure: "docs/jsdoc.conf.json"
},
all: {
src: [
"src/**/*.js",
"!src/core/lib/**/*",
"!src/core/config/MetaConfig.js"
],
}
},
concurrent: {
options: {
logConcurrentOutput: true
},
dev: ["webpack:metaConfDev", "webpack-dev-server:start"]
},
accessibility: {
options: {
accessibilityLevel: "WCAG2A",
verbose: false,
ignore: [
"WCAG2A.Principle1.Guideline1_3.1_3_1.H42.2"
]
},
test: {
src: ["build/**/*.html"]
}
},
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: {
moduleEntryPoints = listEntryModules(),
nodeConsumerTestPath = "~/tmp-cyberchef",
/**
* Configuration for Webpack production build. Defined as a function so that it
* can be recalculated when new modules are generated.
*/
webpackProdConf = () => {
return {
mode: "production",
target: "web",
entry: Object.assign({
main: "./src/web/index.js",
sitemap: "./src/web/static/sitemap.js"
main: "./src/web/index.js"
}, moduleEntryPoints),
output: {
path: __dirname + "/build/prod"
path: __dirname + "/build/prod",
filename: chunkData => {
return chunkData.chunk.name === "main" ? "assets/[name].js": "[name].js";
},
globalObject: "this"
},
resolve: {
alias: {
"./config/modules/OpModules.js": "./config/modules/Default.js"
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
}
},
plugins: [
@@ -247,102 +134,121 @@ module.exports = function (grunt) {
minifyCSS: true
}
}),
]
},
webInline: {
mode: "production",
target: "web",
entry: "./src/web/index.js",
output: {
filename: "scripts.js",
path: __dirname + "/build/prod"
},
plugins: [
new webpack.DefinePlugin(Object.assign({}, BUILD_CONSTANTS, {
INLINE: "true"
})),
new HtmlWebpackPlugin({
filename: "cyberchef.htm",
template: "./src/web/html/index.html",
compileTime: compileTime,
version: pkg.version + "s",
inline: true,
minify: {
removeComments: true,
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true
}
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "BundleAnalyzerReport.html",
openAnalyzer: false
}),
]
},
tests: {
};
};
/**
* Generates an entry list for all the modules.
*/
function listEntryModules() {
const entryModules = {};
glob.sync("./src/core/config/modules/*.mjs").forEach(file => {
const basename = path.basename(file);
if (basename !== "Default.mjs" && basename !== "OpModules.mjs")
entryModules["modules/" + basename.split(".mjs")[0]] = path.resolve(file);
});
return entryModules;
}
/**
* Detects the correct delimiter to use to chain shell commands together
* based on the current OS.
*
* @param {string[]} cmds
* @returns {string}
*/
function chainCommands(cmds) {
const win = process.platform === "win32";
if (!win) {
return cmds.join(";");
}
return cmds
// && means that subsequent commands will not be executed if the
// previous one fails. & would coninue on a fail
.join("&&")
// Windows does not support \n properly
.replace(/\n/g, "\\n");
}
grunt.initConfig({
clean: {
dev: ["build/dev/*"],
prod: ["build/prod/*"],
node: ["build/node/*"],
config: ["src/core/config/OperationConfig.json", "src/core/config/modules/*", "src/code/operations/index.mjs"],
nodeConfig: ["src/node/index.mjs", "src/node/config/OperationConfig.json"],
standalone: ["build/prod/CyberChef*.html"]
},
eslint: {
configs: ["*.{js,mjs}"],
core: ["src/core/**/*.{js,mjs}", "!src/core/vendor/**/*", "!src/core/operations/legacy/**/*"],
web: ["src/web/**/*.{js,mjs}", "!src/web/static/**/*"],
node: ["src/node/**/*.{js,mjs}"],
tests: ["tests/**/*.{js,mjs}"],
},
webpack: {
options: webpackConfig,
myConfig: webpackConfig,
web: webpackProdConf(),
},
"webpack-dev-server": {
options: webpackConfig,
start: {
mode: "development",
target: "node",
entry: "./test/index.js",
externals: [NodeExternals()],
output: {
filename: "index.js",
path: __dirname + "/build/test"
target: "web",
entry: Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints),
resolve: {
alias: {
"./config/modules/OpModules.mjs": "./config/modules/Default.mjs"
}
},
devServer: {
port: grunt.option("port") || 8080,
client: {
logging: "error",
overlay: true
},
hot: "only"
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS)
]
},
node: {
mode: "production",
target: "node",
entry: "./src/node/index.js",
externals: [NodeExternals()],
output: {
filename: "CyberChef.js",
path: __dirname + "/build/node",
library: "CyberChef",
libraryTarget: "commonjs2"
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS)
new webpack.DefinePlugin(BUILD_CONSTANTS),
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileTime: compileTime,
version: pkg.version,
})
]
}
},
"webpack-dev-server": {
options: {
webpack: webpackConfig,
host: "0.0.0.0",
disableHostCheck: true,
overlay: true,
inline: false,
clientLogLevel: "error",
stats: {
children: false,
chunks: false,
modules: false,
entrypoints: false,
warningsFilter: [/source-map/, /dependency is an expression/],
}
},
start: {
webpack: {
mode: "development",
target: "web",
entry: Object.assign({
main: "./src/web/index.js"
}, moduleEntryPoints),
resolve: {
alias: {
"./config/modules/OpModules.js": "./config/modules/Default.js"
}
},
plugins: [
new webpack.DefinePlugin(BUILD_CONSTANTS),
new HtmlWebpackPlugin({
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileTime: compileTime,
version: pkg.version,
})
]
zip: {
standalone: {
cwd: "build/prod/",
src: [
"build/prod/**/*",
"!build/prod/index.html",
"!build/prod/BundleAnalyzerReport.html",
],
dest: `build/prod/CyberChef_v${pkg.version}.zip`
}
},
connect: {
prod: {
options: {
port: grunt.option("port") || 8000,
base: "build/prod/"
}
}
},
@@ -350,10 +256,16 @@ module.exports = function (grunt) {
ghPages: {
options: {
process: function (content, srcpath) {
// Add Google Analytics code to index.html
if (srcpath.indexOf("index.html") >= 0) {
// Add Google Analytics code to index.html
content = content.replace("</body></html>",
grunt.file.read("src/web/static/ga.html") + "</body></html>");
// Add Structured Data for SEO
content = content.replace("</head>",
"<script type='application/ld+json'>" +
JSON.stringify(JSON.parse(grunt.file.read("src/web/static/structuredData.json"))) +
"</script></head>");
return grunt.template.process(content, srcpath);
} else {
return content;
@@ -363,14 +275,31 @@ module.exports = function (grunt) {
},
files: [
{
src: "build/prod/index.html",
src: ["build/prod/index.html"],
dest: "build/prod/index.html"
}
]
},
standalone: {
options: {
process: function (content, srcpath) {
if (srcpath.indexOf("index.html") >= 0) {
// Replace download link with version number
content = content.replace(/<a [^>]+>Download CyberChef.+?<\/a>/,
`<span>Version ${pkg.version}</span>`);
return grunt.template.process(content, srcpath);
} else {
return content;
}
},
noProcess: ["**", "!**/*.html"]
},
files: [
{
expand: true,
src: "docs/**",
dest: "build/prod/"
},
src: ["build/prod/index.html"],
dest: `build/prod/CyberChef_v${pkg.version}.html`
}
]
}
},
@@ -380,31 +309,125 @@ module.exports = function (grunt) {
mode: "755",
},
src: ["build/**/*", "build/"]
},
docs: {
options: {
mode: "755",
},
src: ["docs/**/*", "docs/"]
}
},
watch: {
config: {
files: ["src/core/operations/**/*", "!src/core/operations/index.mjs"],
tasks: ["exec:generateNodeIndex", "exec:generateConfig"]
}
},
concurrent: {
dev: ["watch:config", "webpack-dev-server:start"],
options: {
logConcurrentOutput: true
}
},
exec: {
calcDownloadHash: {
command: function () {
switch (process.platform) {
case "darwin":
return chainCommands([
`shasum -a 256 build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`,
`sed -i '' -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
]);
default:
return chainCommands([
`sha256sum build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`,
`sed -i -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
]);
}
},
},
repoSize: {
command: [
command: chainCommands([
"git ls-files | wc -l | xargs printf '\n%b\ttracked files\n'",
"du -hs | egrep -o '^[^\t]*' | xargs printf '%b\trepository size\n'"
].join(";"),
]),
stderr: false
},
cleanGit: {
command: "git gc --prune=now --aggressive"
},
sitemap: {
command: "node build/prod/sitemap.js > build/prod/sitemap.xml"
command: `node ${nodeFlags} src/web/static/sitemap.mjs > build/prod/sitemap.xml`,
sync: true
},
generateConfig: {
command: chainCommands([
"echo '\n--- Regenerating config files. ---'",
"echo [] > src/core/config/OperationConfig.json",
`node ${nodeFlags} src/core/config/scripts/generateOpsIndex.mjs`,
`node ${nodeFlags} src/core/config/scripts/generateConfig.mjs`,
"echo '--- Config scripts finished. ---\n'"
]),
sync: true
},
generateNodeIndex: {
command: chainCommands([
"echo '\n--- Regenerating node index ---'",
`node ${nodeFlags} src/node/config/scripts/generateNodeIndex.mjs`,
"echo '--- Node index generated. ---\n'"
]),
sync: true
},
browserTests: {
command: "./node_modules/.bin/nightwatch --env prod"
},
setupNodeConsumers: {
command: chainCommands([
"echo '\n--- Testing node consumers ---'",
"npm link",
`mkdir ${nodeConsumerTestPath}`,
`cp tests/node/consumers/* ${nodeConsumerTestPath}`,
`cd ${nodeConsumerTestPath}`,
"npm link cyberchef"
]),
sync: true
},
teardownNodeConsumers: {
command: chainCommands([
`rm -rf ${nodeConsumerTestPath}`,
"echo '\n--- Node consumer tests complete ---'"
]),
},
testCJSNodeConsumer: {
command: chainCommands([
`cd ${nodeConsumerTestPath}`,
`node ${nodeFlags} cjs-consumer.js`,
]),
stdout: false,
},
testESMNodeConsumer: {
command: chainCommands([
`cd ${nodeConsumerTestPath}`,
`node ${nodeFlags} esm-consumer.mjs`,
]),
stdout: false,
},
fixCryptoApiImports: {
command: function () {
switch (process.platform) {
case "darwin":
return `find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i '' -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'`;
default:
return `find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'`;
}
},
stdout: false
},
fixSnackbarMarkup: {
command: function () {
switch (process.platform) {
case "darwin":
return `sed -i '' 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`;
default:
return `sed -i 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js`;
}
},
stdout: false
}
},
execute: {
test: "build/test/index.js"
},
});
};
+30 -14
View File
@@ -1,18 +1,16 @@
# CyberChef
[![Build Status](https://travis-ci.org/gchq/CyberChef.svg?branch=master)](https://travis-ci.org/gchq/CyberChef)
[![dependencies Status](https://david-dm.org/gchq/CyberChef/status.svg)](https://david-dm.org/gchq/CyberChef)
[![](https://github.com/gchq/CyberChef/workflows/Master%20Build,%20Test%20&%20Deploy/badge.svg)](https://github.com/gchq/CyberChef/actions?query=workflow%3A%22Master+Build%2C+Test+%26+Deploy%22)
[![npm](https://img.shields.io/npm/v/cyberchef.svg)](https://www.npmjs.com/package/cyberchef)
![](https://reposs.herokuapp.com/?path=gchq/CyberChef&color=blue)
[![](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/gchq/CyberChef/blob/master/LICENSE)
[![Gitter](https://badges.gitter.im/gchq/CyberChef.svg)](https://gitter.im/gchq/CyberChef?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
#### *The Cyber Swiss Army Knife*
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.
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 and 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
@@ -43,16 +41,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 2GB 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 that 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.
@@ -64,33 +65,47 @@ You can use as many operations as you like in simple or complex ways. Some examp
- Highlighting
- When you highlight text in the input or output, the offset and length values will be displayed and, if possible, the corresponding data will be highlighted in the output or input respectively (example: [highlight the word 'question' in the input to see where it appears in the output][11]).
- Save to file and load from file
- You can save the output to a file at any time or load a file by dragging and dropping it into the input field. Files up to around 500MB are supported (depending on your browser), however some operations may take a very long time to run over this much data.
- You can save the output to a file at any time or load a file by dragging and dropping it into the input field. Files up to around 2GB are supported (depending on your browser), however, some operations may take a very long time to run over this much data.
- CyberChef is entirely client-side
- It should be noted that none of your recipe configuration or input (either text or files) is ever sent to the CyberChef web server - all processing is carried out within your browser, on your own computer.
- Due to this feature, CyberChef can be compiled into a single HTML file. You can download this file and drop it into a virtual machine, share it with other people, or use it independently on your local machine.
- Due to this feature, CyberChef can be downloaded and run locally. You can use the link in the top left corner of the app to download a full copy of CyberChef and drop it into a virtual machine, share it with other people, or host it in a closed network.
## Deep linking
By manipulating CyberChef's URL hash, you can change the initial settings with which the page opens.
The format is `https://gchq.github.io/CyberChef/#recipe=Operation()&input=...`
Supported arguments are `recipe`, `input` (encoded in Base64), and `theme`.
## Browser support
CyberChef is built to support
- Google Chrome 40+
- Mozilla Firefox 35+
- Microsoft Edge 14+
- Google Chrome 50+
- Mozilla Firefox 38+
## Node.js support
CyberChef is built to fully support Node.js `v16`. For more information, see the Node API page in the project [wiki pages](https://github.com/gchq/CyberChef/wiki)
## Contributing
Contributing a new operation to CyberChef is super easy! The quickstart script 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)
- Push your changes to your fork.
- Submit a pull request.
- Submit a pull request. If you are doing this for the first time, you will be prompted to sign the [GCHQ Contributor Licence Agreement](https://cla-assistant.io/gchq/CyberChef) via the CLA assistant on the pull request. This will also ask whether you are happy for GCHQ to contact you about a token of thanks for your contribution, or about job opportunities at GCHQ.
## Force build
## Licencing
CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/licenses/LICENSE-2.0) and is covered by [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/).
CyberChef is released under the [Apache 2.0 Licence](https://www.apache.org/licenses/LICENSE-2.0) and is covered by [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/).
[1]: https://gchq.github.io/CyberChef
@@ -104,3 +119,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
+26
View File
@@ -0,0 +1,26 @@
# Security Policy
## Supported Versions
CyberChef is supported on a best endeavours basis. Patches will be applied to
the latest version rather than retroactively to older versions. To ensure you
are using the most secure version of CyberChef, please make sure you have the
[latest release](https://github.com/gchq/CyberChef/releases/latest). The
official [live demo](https://gchq.github.io/CyberChef/) is always up to date.
## Reporting a Vulnerability
In most scenarios, the most appropriate way to report a vulnerability is to
[raise a new issue](https://github.com/gchq/CyberChef/issues/new/choose)
describing the problem in as much detail as possible, ideally with examples.
This will obviously be public. If you feel that the vulnerability is
significant enough to warrant a private disclosure, please email
[oss@gchq.gov.uk](mailto:oss@gchq.gov.uk) and
[n1474335@gmail.com](mailto:n1474335@gmail.com).
Disclosures of vulnerabilities in CyberChef are always welcomed. Whilst we aim
to write clean and secure code free from bugs, we recognise that this is an open
source project written by analysts in their spare time, relying on dozens of
open source libraries that are modified and updated on a regular basis. We hope
that the community will continue to support us as we endeavour to maintain and
develop this tool together.
+27
View File
@@ -0,0 +1,27 @@
module.exports = function(api) {
api.cache.forever();
return {
"presets": [
["@babel/preset-env", {
"modules": false,
"useBuiltIns": "entry",
"corejs": 3
}]
],
"plugins": [
"dynamic-import-node",
"@babel/plugin-syntax-import-assertions",
[
"babel-plugin-transform-builtin-extend", {
"globals": ["Error"]
}
],
[
"@babel/plugin-transform-runtime", {
"regenerator": true
}
]
]
};
};
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

-32
View File
@@ -1,32 +0,0 @@
{
"tags": {
"allowUnknownTags": true
},
"plugins": [
"plugins/markdown",
"node_modules/jsdoc-babel"
],
"templates": {
"systemName": "CyberChef",
"footer": "",
"copyright": "&copy; Crown Copyright 2017",
"navType": "inline",
"theme": "cerulean",
"linenums": true,
"collapseSymbols": false,
"inverseNav": true,
"outputSourceFiles": true,
"outputSourcePath": true,
"dateFormat": "ddd MMM Do YYYY",
"sort": false,
"logoFile": "cyberchef-32x32.png",
"cleverLinks": false,
"monospaceLinks": false,
"protocol": "html://",
"methodHeadingReturns": false
},
"markdown": {
"parser": "gfm",
"hardwrap": true
}
}
+32
View File
@@ -0,0 +1,32 @@
{
"src_folders": ["tests/browser"],
"exclude": ["tests/browser/browserUtils.js"],
"output_folder": "tests/browser/output",
"test_settings": {
"default": {
"launch_url": "http://localhost:8080",
"webdriver": {
"start_process": true,
"server_path": "./node_modules/.bin/chromedriver",
"port": 9515,
"log_path": "tests/browser/output"
},
"desiredCapabilities": {
"browserName": "chrome"
},
"enable_fail_fast": true
},
"dev": {
"launch_url": "http://localhost:8080"
},
"prod": {
"launch_url": "http://localhost:8000/index.html"
}
}
}
+21022 -9753
View File
File diff suppressed because it is too large. Load diff
+147 -78
View File
@@ -1,6 +1,6 @@
{
"name": "cyberchef",
"version": "7.11.1",
"version": "10.5.2",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef",
@@ -27,101 +27,170 @@
"type": "git",
"url": "https://github.com/gchq/CyberChef/"
},
"main": "build/node/CyberChef.js",
"main": "src/node/wrapper.js",
"exports": {
"import": "./src/node/index.mjs",
"require": "./src/node/wrapper.js"
},
"bugs": "https://github.com/gchq/CyberChef/issues",
"browserslist": [
"Chrome >= 50",
"Firefox >= 38",
"node >= 16"
],
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"css-loader": "^0.28.11",
"eslint": "^4.19.1",
"exports-loader": "^0.7.0",
"extract-text-webpack-plugin": "^4.0.0-alpha0",
"file-loader": "^1.1.11",
"grunt": ">=1.0.2",
"grunt-accessibility": "~6.0.0",
"@babel/core": "^7.21.0",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-syntax-import-assertions": "^7.20.0",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"@babel/runtime": "^7.21.0",
"@codemirror/commands": "^6.2.1",
"@codemirror/language": "^6.6.0",
"@codemirror/search": "^6.2.3",
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.9.2",
"autoprefixer": "^10.4.13",
"babel-loader": "^9.1.2",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-transform-builtin-extend": "1.1.2",
"base64-loader": "^1.0.0",
"chromedriver": "^114.0.2",
"cli-progress": "^3.12.0",
"colors": "^1.4.0",
"copy-webpack-plugin": "^11.0.0",
"core-js": "^3.29.0",
"css-loader": "6.7.3",
"eslint": "^8.35.0",
"grunt": "^1.6.1",
"grunt-chmod": "~1.1.1",
"grunt-concurrent": "^2.3.1",
"grunt-contrib-clean": "~1.1.0",
"grunt-concurrent": "^3.0.0",
"grunt-contrib-clean": "~2.0.1",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-copy": "~1.0.0",
"grunt-eslint": "^20.1.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^24.0.1",
"grunt-exec": "~3.0.0",
"grunt-execute": "^0.2.2",
"grunt-jsdoc": "^2.2.1",
"grunt-webpack": "^3.1.1",
"html-webpack-plugin": "^3.2.0",
"imports-loader": "^0.8.0",
"ink-docstrap": "^1.3.2",
"jsdoc-babel": "^0.4.0",
"less": "^3.0.2",
"less-loader": "^4.1.0",
"postcss-css-variables": "^0.8.1",
"postcss-import": "^11.1.0",
"postcss-loader": "^2.1.4",
"sitemap": "^1.13.0",
"style-loader": "^0.21.0",
"url-loader": "^1.0.1",
"val-loader": "^1.1.0",
"web-resource-inliner": "^4.2.1",
"webpack": "^4.6.0",
"webpack-dev-server": "^3.1.3",
"webpack-node-externals": "^1.7.2",
"worker-loader": "^1.1.1"
"grunt-webpack": "^5.0.0",
"grunt-zip": "^0.20.0",
"html-webpack-plugin": "^5.5.0",
"imports-loader": "^4.0.1",
"mini-css-extract-plugin": "2.7.3",
"modify-source-webpack-plugin": "^3.0.0",
"nightwatch": "^2.6.16",
"postcss": "^8.4.21",
"postcss-css-variables": "^0.18.0",
"postcss-import": "^15.1.0",
"postcss-loader": "^7.0.2",
"prompt": "^1.3.0",
"sitemap": "^7.1.1",
"terser": "^5.16.6",
"webpack": "^5.76.0",
"webpack-bundle-analyzer": "^4.8.0",
"webpack-dev-server": "4.11.1",
"webpack-node-externals": "^3.0.0",
"worker-loader": "^3.0.8"
},
"dependencies": {
"babel-polyfill": "^6.26.0",
"@astronautlabs/amf": "^0.0.6",
"@babel/polyfill": "^7.12.1",
"@blu3r4y/lzma": "^2.3.3",
"@wavesenterprise/crypto-gost-js": "^2.1.0-RC1",
"argon2-browser": "^1.18.0",
"arrive": "^2.4.1",
"avsc": "^5.7.7",
"bcryptjs": "^2.4.3",
"bignumber.js": "^7.0.1",
"bootstrap": "^3.3.7",
"bootstrap-colorpicker": "^2.5.2",
"bootstrap-switch": "^3.3.4",
"bson": "^2.0.6",
"crypto-api": "^0.8.0",
"crypto-js": "^3.1.9-1",
"bignumber.js": "^9.1.1",
"blakejs": "^1.2.1",
"bootstrap": "4.6.2",
"bootstrap-colorpicker": "^3.4.0",
"bootstrap-material-design": "^4.1.3",
"browserify-zlib": "^0.2.0",
"bson": "^4.7.2",
"buffer": "^6.0.3",
"cbor": "8.1.0",
"chi-squared": "^1.1.0",
"codepage": "^1.15.0",
"crypto-api": "^0.8.5",
"crypto-browserify": "^3.12.0",
"crypto-js": "^4.1.1",
"ctph.js": "0.0.5",
"diff": "^3.5.0",
"escodegen": "^1.9.1",
"es6-promisify": "^6.0.0",
"esmangle": "^1.0.1",
"esprima": "^4.0.0",
"d3": "7.8.2",
"d3-hexbin": "^0.2.2",
"diff": "^5.1.0",
"es6-promisify": "^7.0.0",
"escodegen": "^2.0.0",
"esprima": "^4.0.1",
"exif-parser": "^0.1.12",
"file-saver": "^1.3.8",
"highlight.js": "^9.12.0",
"jquery": "^3.3.1",
"file-saver": "^2.0.5",
"flat": "^5.0.2",
"geodesy": "1.1.3",
"highlight.js": "^11.7.0",
"jimp": "^0.16.13",
"jquery": "3.6.4",
"js-crc": "^0.2.0",
"js-sha3": "^0.7.0",
"jsbn": "^1.1.0",
"jsesc": "^2.5.1",
"jsonpath": "^1.0.0",
"jsrsasign": "8.0.12",
"lodash": "^4.17.10",
"loglevel": "^1.6.1",
"kbpgp": "^2.0.77",
"js-sha3": "^0.8.0",
"jsesc": "^3.0.2",
"json5": "^2.2.3",
"jsonpath-plus": "^7.2.0",
"jsonwebtoken": "8.5.1",
"jsqr": "^1.4.0",
"jsrsasign": "^10.6.1",
"kbpgp": "2.1.15",
"libbzip2-wasm": "0.0.4",
"libyara-wasm": "^1.2.1",
"lodash": "^4.17.21",
"loglevel": "^1.8.1",
"loglevel-message-prefix": "^3.0.0",
"moment": "^2.22.1",
"moment-timezone": "^0.5.16",
"node-forge": "^0.7.5",
"lz-string": "^1.5.0",
"lz4js": "^0.2.0",
"markdown-it": "^13.0.1",
"moment": "^2.29.4",
"moment-timezone": "^0.5.41",
"ngeohash": "^0.6.3",
"node-forge": "^1.3.1",
"node-md6": "^0.1.0",
"nodom": "^2.4.0",
"notepack.io": "^3.0.1",
"ntlm": "^0.1.3",
"nwmatcher": "^1.4.4",
"otp": "^0.1.3",
"scryptsy": "^2.0.0",
"sladex-blowfish": "^0.8.1",
"sortablejs": "^1.7.0",
"split.js": "^1.3.5",
"ssdeep.js": "0.0.2",
"ua-parser-js": "^0.7.17",
"otp": "0.1.3",
"path": "^0.12.7",
"popper.js": "^1.16.1",
"process": "^0.11.10",
"protobufjs": "^7.2.2",
"qr-image": "^3.2.0",
"reflect-metadata": "^0.1.13",
"scryptsy": "^2.1.0",
"snackbarjs": "^1.1.0",
"sortablejs": "^1.15.0",
"split.js": "^1.6.5",
"ssdeep.js": "0.0.3",
"stream-browserify": "^3.0.0",
"tesseract.js": "3.0.3",
"ua-parser-js": "^1.0.34",
"unorm": "^1.6.0",
"utf8": "^3.0.0",
"vkbeautify": "^0.99.3",
"xmldom": "^0.1.27",
"xpath": "0.0.27",
"xregexp": "^4.1.1",
"xmldom": "^0.6.0",
"xpath": "0.0.32",
"xregexp": "^5.1.1",
"zlibjs": "^0.3.1"
},
"scripts": {
"start": "grunt dev",
"build": "grunt prod",
"test": "grunt test",
"docs": "grunt docs"
"start": "npx grunt dev",
"build": "npx grunt prod",
"node": "npx grunt node",
"repl": "node --experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-experimental-fetch --no-warnings src/node/repl.mjs",
"test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch --trace-uncaught tests/operations/index.mjs",
"testnodeconsumer": "npx grunt testnodeconsumer",
"testui": "npx grunt testui",
"testuidev": "npx nightwatch --env=dev",
"lint": "npx grunt lint",
"postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup",
"newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs",
"minor": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newMinorVersion.mjs",
"getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'",
"setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048"
}
}
+1 -7
View File
@@ -1,13 +1,7 @@
module.exports = {
plugins: [
require("postcss-import"),
require("autoprefixer")({
browsers: [
"Chrome >= 40",
"Firefox >= 35",
"Edge >= 14"
]
}),
require("autoprefixer"),
require("postcss-css-variables")({
preserve: true
}),
-165
View File
@@ -1,165 +0,0 @@
import Dish from "./Dish.js";
import Recipe from "./Recipe.js";
/**
* The main controller for CyberChef.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @class
*/
const Chef = function() {
this.dish = new Dish();
};
/**
* Runs the recipe over the input.
*
* @param {string|ArrayBuffer} input - The input data as a string or ArrayBuffer
* @param {Object[]} recipeConfig - The recipe configuration object
* @param {Object} options - The options object storing various user choices
* @param {boolean} options.attempHighlight - Whether or not to attempt highlighting
* @param {number} progress - The position in the recipe to start from
* @param {number} [step] - Whether to only execute one operation in the recipe
*
* @returns {Object} response
* @returns {string} response.result - The output of the recipe
* @returns {string} response.type - The data type of the result
* @returns {number} response.progress - The position that we have got to in the recipe
* @returns {number} response.duration - The number of ms it took to execute the recipe
* @returns {number} response.error - The error object thrown by a failed operation (false if no error)
*/
Chef.prototype.bake = async function(input, recipeConfig, options, progress, step) {
log.debug("Chef baking");
const startTime = new Date().getTime(),
recipe = new Recipe(recipeConfig),
containsFc = recipe.containsFlowControl(),
notUTF8 = options && options.hasOwnProperty("treatAsUtf8") && !options.treatAsUtf8;
let error = false;
if (containsFc && ENVIRONMENT_IS_WORKER()) self.setOption("attemptHighlight", false);
// Clean up progress
if (progress >= recipeConfig.length) {
progress = 0;
}
if (step) {
// Unset breakpoint on this step
recipe.setBreakpoint(progress, false);
// Set breakpoint on next step
recipe.setBreakpoint(progress + 1, true);
}
// If stepping with flow control, we have to start from the beginning
// but still want to skip all previous breakpoints
if (progress > 0 && containsFc) {
recipe.removeBreaksUpTo(progress);
progress = 0;
}
// If starting from scratch, load data
if (progress === 0) {
const type = input instanceof ArrayBuffer ? Dish.ARRAY_BUFFER : Dish.STRING;
this.dish.set(input, type);
}
try {
progress = await recipe.execute(this.dish, progress);
} catch (err) {
log.error(err);
error = {
displayStr: err.displayStr,
};
progress = err.progress;
}
// Depending on the size of the output, we may send it back as a string or an ArrayBuffer.
// This can prevent unnecessary casting as an ArrayBuffer can be easily downloaded as a file.
// The threshold is specified in KiB.
const threshold = (options.ioDisplayThreshold || 1024) * 1024;
const returnType = this.dish.size() > threshold ? Dish.ARRAY_BUFFER : Dish.STRING;
return {
result: this.dish.type === Dish.HTML ?
this.dish.get(Dish.HTML, notUTF8) :
this.dish.get(returnType, notUTF8),
type: Dish.enumLookup(this.dish.type),
progress: progress,
duration: new Date().getTime() - startTime,
error: error
};
};
/**
* When a browser tab is unfocused and the browser has to run lots of dynamic content in other tabs,
* it swaps out the memory for that tab. If the CyberChef tab has been unfocused for more than a
* minute, we run a silent bake which will force the browser to load and cache all the relevant
* JavaScript code needed to do a real bake.
*
* This will stop baking taking a long time when the CyberChef browser tab has been unfocused for a
* long time and the browser has swapped out all its memory.
*
* The output will not be modified (hence "silent" bake).
*
* This will only actually execute the recipe if auto-bake is enabled, otherwise it will just load
* the recipe, ingredients and dish.
*
* @param {Object[]} recipeConfig - The recipe configuration object
* @returns {number} The time it took to run the silent bake in milliseconds.
*/
Chef.prototype.silentBake = function(recipeConfig) {
log.debug("Running silent bake");
let startTime = new Date().getTime(),
recipe = new Recipe(recipeConfig),
dish = new Dish("", Dish.STRING);
try {
recipe.execute(dish);
} catch (err) {
// Suppress all errors
}
return new Date().getTime() - startTime;
};
/**
* Calculates highlight offsets if possible.
*
* @param {Object[]} recipeConfig
* @param {string} direction
* @param {Object} pos - The position object for the highlight.
* @param {number} pos.start - The start offset.
* @param {number} pos.end - The end offset.
* @returns {Object}
*/
Chef.prototype.calculateHighlights = function(recipeConfig, direction, pos) {
const recipe = new Recipe(recipeConfig);
const highlights = recipe.generateHighlightList();
if (!highlights) return false;
for (let i = 0; i < highlights.length; i++) {
// Remove multiple highlights before processing again
pos = [pos[0]];
const func = direction === "forward" ? highlights[i].f : highlights[i].b;
if (typeof func == "function") {
pos = func(pos, highlights[i].args);
}
}
return {
pos: pos,
direction: direction
};
};
export default Chef;
+183
View File
@@ -0,0 +1,183 @@
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import Dish from "./Dish.mjs";
import Recipe from "./Recipe.mjs";
import log from "loglevel";
import { isWorkerEnvironment } from "./Utils.mjs";
/**
* The main controller for CyberChef.
*/
class Chef {
/**
* Chef constructor
*/
constructor() {
this.dish = new Dish();
}
/**
* Runs the recipe over the input.
*
* @param {string|ArrayBuffer} input - The input data as a string or ArrayBuffer
* @param {Object[]} recipeConfig - The recipe configuration object
* @param {Object} [options={}] - The options object storing various user choices
* @param {string} [options.returnType] - What type to return the result as
*
* @returns {Object} response
* @returns {string} response.result - The output of the recipe
* @returns {string} response.type - The data type of the result
* @returns {number} response.progress - The position that we have got to in the recipe
* @returns {number} response.duration - The number of ms it took to execute the recipe
* @returns {number} response.error - The error object thrown by a failed operation (false if no error)
*/
async bake(input, recipeConfig, options={}) {
log.debug("Chef baking");
const startTime = Date.now(),
recipe = new Recipe(recipeConfig),
containsFc = recipe.containsFlowControl();
let error = false,
progress = 0;
if (containsFc && isWorkerEnvironment()) self.setOption("attemptHighlight", false);
// Load data
const type = input instanceof ArrayBuffer ? Dish.ARRAY_BUFFER : Dish.STRING;
this.dish.set(input, type);
try {
progress = await recipe.execute(this.dish, progress);
} catch (err) {
log.error(err);
error = {
displayStr: err.displayStr,
};
progress = err.progress;
}
// Create a raw version of the dish, unpresented
const rawDish = this.dish.clone();
// Present the raw result
await recipe.present(this.dish);
const returnType =
this.dish.type === Dish.HTML ? Dish.HTML :
options?.returnType ? options.returnType : Dish.ARRAY_BUFFER;
return {
dish: rawDish,
result: await this.dish.get(returnType),
type: Dish.enumLookup(this.dish.type),
progress: progress,
duration: Date.now() - startTime,
error: error
};
}
/**
* When a browser tab is unfocused and the browser has to run lots of dynamic content in other tabs,
* it swaps out the memory for that tab. If the CyberChef tab has been unfocused for more than a
* minute, we run a silent bake which will force the browser to load and cache all the relevant
* JavaScript code needed to do a real bake.
*
* This will stop baking taking a long time when the CyberChef browser tab has been unfocused for a
* long time and the browser has swapped out all its memory.
*
* The output will not be modified (hence "silent" bake).
*
* This will only actually execute the recipe if auto-bake is enabled, otherwise it will just load
* the recipe, ingredients and dish.
*
* @param {Object[]} recipeConfig - The recipe configuration object
* @returns {number} The time it took to run the silent bake in milliseconds.
*/
silentBake(recipeConfig) {
log.debug("Running silent bake");
const startTime = Date.now(),
recipe = new Recipe(recipeConfig),
dish = new Dish();
try {
recipe.execute(dish);
} catch (err) {
// Suppress all errors
}
return Date.now() - startTime;
}
/**
* Calculates highlight offsets if possible.
*
* @param {Object[]} recipeConfig
* @param {string} direction
* @param {Object} pos - The position object for the highlight.
* @param {number} pos.start - The start offset.
* @param {number} pos.end - The end offset.
* @returns {Object}
*/
async calculateHighlights(recipeConfig, direction, pos) {
const recipe = new Recipe(recipeConfig);
const highlights = await recipe.generateHighlightList();
if (!highlights) return false;
for (let i = 0; i < highlights.length; i++) {
// Remove multiple highlights before processing again
pos = [pos[0]];
const func = direction === "forward" ? highlights[i].f : highlights[i].b;
if (typeof func == "function") {
try {
pos = func(pos, highlights[i].args);
} catch (err) {
// Throw away highlighting errors
pos = [];
}
}
}
return {
pos: pos,
direction: direction
};
}
/**
* Translates the dish to a specified type and returns it.
*
* @param {Dish} dish
* @param {string} type
* @returns {Dish}
*/
async getDishAs(dish, type) {
const newDish = new Dish(dish);
return await newDish.get(type);
}
/**
* Gets the title of a dish and returns it
*
* @param {Dish} dish
* @param {number} [maxLength=100]
* @returns {string}
*/
async getDishTitle(dish, maxLength=100) {
const newDish = new Dish(dish);
return await newDish.getTitle(maxLength);
}
}
export default Chef;
+116 -38
View File
@@ -6,26 +6,19 @@
* @license Apache-2.0
*/
import "babel-polyfill";
import Chef from "./Chef.js";
import OperationConfig from "./config/MetaConfig.js";
import OpModules from "./config/modules/Default.js";
// Add ">" to the start of all log messages in the Chef Worker
import Chef from "./Chef.mjs";
import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
import OpModules from "./config/modules/OpModules.mjs";
import loglevelMessagePrefix from "loglevel-message-prefix";
loglevelMessagePrefix(log, {
prefixes: [],
staticPrefixes: [">"],
prefixFormat: "%p"
});
// Set up Chef instance
self.chef = new Chef();
self.OpModules = OpModules;
self.OperationConfig = OperationConfig;
self.inputNum = -1;
// Tell the app that the worker has loaded and is ready to operate
self.postMessage({
@@ -36,6 +29,9 @@ self.postMessage({
/**
* Respond to message from parent thread.
*
* inputNum is optional and only used for baking multiple inputs.
* Defaults to -1 when one isn't sent with the bake message.
*
* Messages should have the following format:
* {
* action: "bake" | "silentBake",
@@ -44,14 +40,15 @@ self.postMessage({
* recipeConfig: {[Object]},
* options: {Object},
* progress: {number},
* step: {boolean}
* } | undefined
* step: {boolean},
* [inputNum=-1]: {number}
* }
* }
*/
self.addEventListener("message", function(e) {
// Handle message
const r = e.data;
log.debug("ChefWorker receiving command '" + r.action + "'");
log.debug(`Receiving command '${r.action}'`);
switch (r.action) {
case "bake":
@@ -60,6 +57,12 @@ self.addEventListener("message", function(e) {
case "silentBake":
silentBake(r.data);
break;
case "getDishAs":
getDishAs(r.data);
break;
case "getDishTitle":
getDishTitle(r.data);
break;
case "docURL":
// Used to set the URL of the current document so that scripts can be
// imported into an inline worker.
@@ -75,6 +78,12 @@ self.addEventListener("message", function(e) {
case "setLogLevel":
log.setLevel(r.data, false);
break;
case "setLogPrefix":
loglevelMessagePrefix(log, {
prefixes: [],
staticPrefixes: [r.data]
});
break;
default:
break;
}
@@ -88,27 +97,39 @@ self.addEventListener("message", function(e) {
*/
async function bake(data) {
// Ensure the relevant modules are loaded
loadRequiredModules(data.recipeConfig);
self.loadRequiredModules(data.recipeConfig);
try {
self.inputNum = data.inputNum === undefined ? -1 : data.inputNum;
const response = await self.chef.bake(
data.input, // The user's input
data.recipeConfig, // The configuration of the recipe
data.options, // Options set by the user
data.progress, // The current position in the recipe
data.step // Whether or not to take one step or execute the whole recipe
data.options // Options set by the user
);
const transferable = (response.dish.value instanceof ArrayBuffer) ?
[response.dish.value] :
undefined;
self.postMessage({
action: "bakeComplete",
data: response
});
data: Object.assign(response, {
id: data.id,
inputNum: data.inputNum,
bakeId: data.bakeId
})
}, transferable);
} catch (err) {
self.postMessage({
action: "bakeError",
data: err
data: {
error: err.message || err,
id: data.id,
inputNum: data.inputNum
}
});
}
self.inputNum = -1;
}
@@ -126,19 +147,36 @@ function silentBake(data) {
/**
* Checks that all required modules are loaded and loads them if not.
*
* @param {Object} recipeConfig
* Translates the dish to a given type.
*/
function loadRequiredModules(recipeConfig) {
recipeConfig.forEach(op => {
let module = self.OperationConfig[op.op].module;
async function getDishAs(data) {
const value = await self.chef.getDishAs(data.dish, data.type);
const transferable = (data.type === "ArrayBuffer") ? [value] : undefined;
self.postMessage({
action: "dishReturned",
data: {
value: value,
id: data.id
}
}, transferable);
}
if (!OpModules.hasOwnProperty(module)) {
log.info("Loading module " + module);
self.sendStatusMessage("Loading module " + module);
self.importScripts(self.docURL + "/" + module + ".js");
self.sendStatusMessage("");
/**
* Gets the dish title
*
* @param {object} data
* @param {Dish} data.dish
* @param {number} data.maxLength
* @param {number} data.id
*/
async function getDishTitle(data) {
const title = await self.chef.getDishTitle(data.dish, data.maxLength);
self.postMessage({
action: "dishReturned",
data: {
value: title,
id: data.id
}
});
}
@@ -149,12 +187,12 @@ function loadRequiredModules(recipeConfig) {
*
* @param {Object[]} recipeConfig
* @param {string} direction
* @param {Object} pos - The position object for the highlight.
* @param {Object[]} pos - The position object for the highlight.
* @param {number} pos.start - The start offset.
* @param {number} pos.end - The end offset.
*/
function calculateHighlights(recipeConfig, direction, pos) {
pos = self.chef.calculateHighlights(recipeConfig, direction, pos);
async function calculateHighlights(recipeConfig, direction, pos) {
pos = await self.chef.calculateHighlights(recipeConfig, direction, pos);
self.postMessage({
action: "highlightsCalculated",
@@ -163,6 +201,25 @@ function calculateHighlights(recipeConfig, direction, pos) {
}
/**
* Checks that all required modules are loaded and loads them if not.
*
* @param {Object} recipeConfig
*/
self.loadRequiredModules = function(recipeConfig) {
recipeConfig.forEach(op => {
const module = self.OperationConfig[op.op].module;
if (!(module in OpModules)) {
log.info(`Loading ${module} module`);
self.sendStatusMessage(`Loading ${module} module`);
self.importScripts(`${self.docURL}/modules/${module}.js`); // lgtm [js/client-side-unvalidated-url-redirection]
self.sendStatusMessage("");
}
});
};
/**
* Send status update to the app.
*
@@ -171,7 +228,28 @@ function calculateHighlights(recipeConfig, direction, pos) {
self.sendStatusMessage = function(msg) {
self.postMessage({
action: "statusMessage",
data: msg
data: {
message: msg,
inputNum: self.inputNum
}
});
};
/**
* Send progress update to the app.
*
* @param {number} progress
* @param {number} total
*/
self.sendProgressMessage = function(progress, total) {
self.postMessage({
action: "progressMessage",
data: {
progress: progress,
total: total,
inputNum: self.inputNum
}
});
};
-274
View File
@@ -1,274 +0,0 @@
import Utils from "./Utils.js";
import BigNumber from "bignumber.js";
/**
* The data being operated on by each operation.
*
* @author n1474335 [n1474335@gmail.com]
* @author Matt C [matt@artemisbot.uk]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @class
* @param {byteArray|string|number|ArrayBuffer|BigNumber} value - The value of the input data.
* @param {number} type - The data type of value, see Dish enums.
*/
const Dish = function(value, type) {
this.value = value || typeof value === "string" ? value : null;
this.type = type || Dish.BYTE_ARRAY;
};
/**
* Dish data type enum for byte arrays.
* @readonly
* @enum
*/
Dish.BYTE_ARRAY = 0;
/**
* Dish data type enum for strings.
* @readonly
* @enum
*/
Dish.STRING = 1;
/**
* Dish data type enum for numbers.
* @readonly
* @enum
*/
Dish.NUMBER = 2;
/**
* Dish data type enum for HTML.
* @readonly
* @enum
*/
Dish.HTML = 3;
/**
* Dish data type enum for ArrayBuffers.
* @readonly
* @enum
*/
Dish.ARRAY_BUFFER = 4;
/**
* Dish data type enum for BigNumbers.
* @readonly
* @enum
*/
Dish.BIG_NUMBER = 5;
/**
* Returns the data type enum for the given type string.
*
* @static
* @param {string} typeStr - The name of the data type.
* @returns {number} The data type enum value.
*/
Dish.typeEnum = function(typeStr) {
switch (typeStr.toLowerCase()) {
case "bytearray":
case "byte array":
return Dish.BYTE_ARRAY;
case "string":
return Dish.STRING;
case "number":
return Dish.NUMBER;
case "html":
return Dish.HTML;
case "arraybuffer":
case "array buffer":
return Dish.ARRAY_BUFFER;
case "bignumber":
case "big number":
return Dish.BIG_NUMBER;
default:
throw "Invalid data type string. No matching enum.";
}
};
/**
* Returns the data type string for the given type enum.
*
* @static
* @param {number} typeEnum - The enum value of the data type.
* @returns {string} The data type as a string.
*/
Dish.enumLookup = function(typeEnum) {
switch (typeEnum) {
case Dish.BYTE_ARRAY:
return "byteArray";
case Dish.STRING:
return "string";
case Dish.NUMBER:
return "number";
case Dish.HTML:
return "html";
case Dish.ARRAY_BUFFER:
return "ArrayBuffer";
case Dish.BIG_NUMBER:
return "BigNumber";
default:
throw "Invalid data type enum. No matching type.";
}
};
/**
* Sets the data value and type and then validates them.
*
* @param {byteArray|string|number|ArrayBuffer|BigNumber} value - The value of the input data.
* @param {number} type - The data type of value, see Dish enums.
*/
Dish.prototype.set = function(value, type) {
log.debug("Dish type: " + Dish.enumLookup(type));
this.value = value;
this.type = type;
if (!this.valid()) {
const sample = Utils.truncate(JSON.stringify(this.value), 13);
throw "Data is not a valid " + Dish.enumLookup(type) + ": " + sample;
}
};
/**
* Returns the value of the data in the type format specified.
*
* @param {number} type - The data type of value, see Dish enums.
* @param {boolean} [notUTF8] - Do not treat strings as UTF8.
* @returns {byteArray|string|number|ArrayBuffer|BigNumber} The value of the output data.
*/
Dish.prototype.get = function(type, notUTF8) {
if (this.type !== type) {
this.translate(type, notUTF8);
}
return this.value;
};
/**
* Translates the data to the given type format.
*
* @param {number} toType - The data type of value, see Dish enums.
* @param {boolean} [notUTF8] - Do not treat strings as UTF8.
*/
Dish.prototype.translate = function(toType, notUTF8) {
log.debug(`Translating Dish from ${Dish.enumLookup(this.type)} to ${Dish.enumLookup(toType)}`);
const byteArrayToStr = notUTF8 ? Utils.byteArrayToChars : Utils.byteArrayToUtf8;
// Convert data to intermediate byteArray type
switch (this.type) {
case Dish.STRING:
this.value = this.value ? Utils.strToByteArray(this.value) : [];
break;
case Dish.NUMBER:
this.value = typeof this.value == "number" ? Utils.strToByteArray(this.value.toString()) : [];
break;
case Dish.HTML:
this.value = this.value ? Utils.strToByteArray(Utils.unescapeHtml(Utils.stripHtmlTags(this.value, true))) : [];
break;
case Dish.ARRAY_BUFFER:
// Array.from() would be nicer here, but it's slightly slower
this.value = Array.prototype.slice.call(new Uint8Array(this.value));
break;
case Dish.BIG_NUMBER:
this.value = this.value instanceof BigNumber ? Utils.strToByteArray(this.value.toFixed()) : [];
break;
default:
break;
}
this.type = Dish.BYTE_ARRAY;
// Convert from byteArray to toType
switch (toType) {
case Dish.STRING:
case Dish.HTML:
this.value = this.value ? byteArrayToStr(this.value) : "";
this.type = Dish.STRING;
break;
case Dish.NUMBER:
this.value = this.value ? parseFloat(byteArrayToStr(this.value)) : 0;
this.type = Dish.NUMBER;
break;
case Dish.ARRAY_BUFFER:
this.value = new Uint8Array(this.value).buffer;
this.type = Dish.ARRAY_BUFFER;
break;
case Dish.BIG_NUMBER:
try {
this.value = new BigNumber(byteArrayToStr(this.value));
} catch (err) {
this.value = new BigNumber(NaN);
}
this.type = Dish.BIG_NUMBER;
break;
default:
break;
}
};
/**
* Validates that the value is the type that has been specified.
* May have to disable parts of BYTE_ARRAY validation if it effects performance.
*
* @returns {boolean} Whether the data is valid or not.
*/
Dish.prototype.valid = function() {
switch (this.type) {
case Dish.BYTE_ARRAY:
if (!(this.value instanceof Array)) {
return false;
}
// Check that every value is a number between 0 - 255
for (let i = 0; i < this.value.length; i++) {
if (typeof this.value[i] !== "number" ||
this.value[i] < 0 ||
this.value[i] > 255) {
return false;
}
}
return true;
case Dish.STRING:
case Dish.HTML:
return typeof this.value === "string";
case Dish.NUMBER:
return typeof this.value === "number";
case Dish.ARRAY_BUFFER:
return this.value instanceof ArrayBuffer;
case Dish.BIG_NUMBER:
return this.value instanceof BigNumber;
default:
return false;
}
};
/**
* Determines how much space the Dish takes up.
* Numbers in JavaScript are 64-bit floating point, however for the purposes of the Dish,
* we measure how many bytes are taken up when the number is written as a string.
*
* @returns {number}
*/
Dish.prototype.size = function() {
switch (this.type) {
case Dish.BYTE_ARRAY:
case Dish.STRING:
case Dish.HTML:
return this.value.length;
case Dish.NUMBER:
case Dish.BIG_NUMBER:
return this.value.toString().length;
case Dish.ARRAY_BUFFER:
return this.value.byteLength;
default:
return -1;
}
};
export default Dish;
+569
View File
@@ -0,0 +1,569 @@
/**
* @author n1474335 [n1474335@gmail.com]
* @author Matt C [matt@artemisbot.uk]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import Utils, { isNodeEnvironment } from "./Utils.mjs";
import DishError from "./errors/DishError.mjs";
import BigNumber from "bignumber.js";
import { detectFileType } from "./lib/FileType.mjs";
import log from "loglevel";
import DishByteArray from "./dishTypes/DishByteArray.mjs";
import DishBigNumber from "./dishTypes/DishBigNumber.mjs";
import DishFile from "./dishTypes/DishFile.mjs";
import DishHTML from "./dishTypes/DishHTML.mjs";
import DishJSON from "./dishTypes/DishJSON.mjs";
import DishListFile from "./dishTypes/DishListFile.mjs";
import DishNumber from "./dishTypes/DishNumber.mjs";
import DishString from "./dishTypes/DishString.mjs";
/**
* The data being operated on by each operation.
*/
class Dish {
/**
* Dish constructor
*
* @param {Dish || *} [dishOrInput=null] - A dish to clone OR an object
* literal to make into a dish
* @param {Enum} [type=null] (optional) - A type to accompany object
* literal input
*/
constructor(dishOrInput=null, type = null) {
this.value = new ArrayBuffer(0);
this.type = Dish.ARRAY_BUFFER;
// Case: dishOrInput is dish object
if (dishOrInput &&
Object.prototype.hasOwnProperty.call(dishOrInput, "value") &&
Object.prototype.hasOwnProperty.call(dishOrInput, "type")) {
this.set(dishOrInput.value, dishOrInput.type);
// input and type defined separately
} else if (dishOrInput && type !== null) {
this.set(dishOrInput, type);
// No type declared, so infer it.
} else if (dishOrInput) {
const inferredType = Dish.typeEnum(dishOrInput.constructor.name);
this.set(dishOrInput, inferredType);
}
}
/**
* Returns the data type enum for the given type string.
*
* @param {string} typeStr - The name of the data type.
* @returns {number} The data type enum value.
*/
static typeEnum(typeStr) {
switch (typeStr.toLowerCase()) {
case "bytearray":
case "byte array":
return Dish.BYTE_ARRAY;
case "string":
return Dish.STRING;
case "number":
return Dish.NUMBER;
case "html":
return Dish.HTML;
case "arraybuffer":
case "array buffer":
return Dish.ARRAY_BUFFER;
case "bignumber":
case "big number":
return Dish.BIG_NUMBER;
case "json":
case "object": // object constructor name. To allow JSON input in node.
return Dish.JSON;
case "file":
return Dish.FILE;
case "list<file>":
return Dish.LIST_FILE;
default:
throw new DishError("Invalid data type string. No matching enum.");
}
}
/**
* Returns the data type string for the given type enum.
*
* @param {number} typeEnum - The enum value of the data type.
* @returns {string} The data type as a string.
*/
static enumLookup(typeEnum) {
switch (typeEnum) {
case Dish.BYTE_ARRAY:
return "byteArray";
case Dish.STRING:
return "string";
case Dish.NUMBER:
return "number";
case Dish.HTML:
return "html";
case Dish.ARRAY_BUFFER:
return "ArrayBuffer";
case Dish.BIG_NUMBER:
return "BigNumber";
case Dish.JSON:
return "JSON";
case Dish.FILE:
return "File";
case Dish.LIST_FILE:
return "List<File>";
default:
throw new DishError("Invalid data type enum. No matching type.");
}
}
/**
* Returns the value of the data in the type format specified.
*
* If running in a browser, get is asynchronous.
*
* @param {number} type - The data type of value, see Dish enums.
* @returns {* | Promise} - (Browser) A promise | (Node) value of dish in given type
*/
get(type) {
if (typeof type === "string") {
type = Dish.typeEnum(type);
}
if (this.type !== type) {
// Node environment => _translate is sync
if (isNodeEnvironment()) {
this._translate(type);
return this.value;
// Browser environment => _translate is async
} else {
return new Promise((resolve, reject) => {
this._translate(type)
.then(() => {
resolve(this.value);
})
.catch(reject);
});
}
}
return this.value;
}
/**
* Sets the data value and type and then validates them.
*
* @param {*} value
* - The value of the input data.
* @param {number} type
* - The data type of value, see Dish enums.
*/
set(value, type) {
if (typeof type === "string") {
type = Dish.typeEnum(type);
}
log.debug("Dish type: " + Dish.enumLookup(type));
this.value = value;
this.type = type;
if (!this.valid()) {
const sample = Utils.truncate(JSON.stringify(this.value), 25);
throw new DishError(`Data is not a valid ${Dish.enumLookup(type)}: ${sample}`);
}
}
/**
* Returns the Dish as the given type, without mutating the original dish.
*
* If running in a browser, get is asynchronous.
*
* @Node
*
* @param {number} type - The data type of value, see Dish enums.
* @returns {Dish | Promise} - (Browser) A promise | (Node) value of dish in given type
*/
presentAs(type) {
const clone = this.clone();
return clone.get(type);
}
/**
* Detects the MIME type of the current dish
* @returns {string}
*/
detectDishType() {
const data = new Uint8Array(this.value.slice(0, 2048)),
types = detectFileType(data);
if (!types.length || !types[0].mime || !(types[0].mime === "text/plain")) {
return null;
} else {
return types[0].mime;
}
}
/**
* Returns the title of the data up to the specified length
*
* @param {number} maxLength - The maximum title length
* @returns {string}
*/
async getTitle(maxLength) {
let title = "";
let cloned;
switch (this.type) {
case Dish.FILE:
title = this.value.name;
break;
case Dish.LIST_FILE:
title = `${this.value.length} file(s)`;
break;
case Dish.JSON:
title = "application/json";
break;
case Dish.NUMBER:
case Dish.BIG_NUMBER:
title = this.value.toString();
break;
case Dish.ARRAY_BUFFER:
case Dish.BYTE_ARRAY:
title = this.detectDishType();
if (title !== null) break;
// fall through if no mime type was detected
default:
try {
cloned = this.clone();
cloned.value = cloned.value.slice(0, 256);
title = await cloned.get(Dish.STRING);
} catch (err) {
log.error(`${Dish.enumLookup(this.type)} cannot be sliced. ${err}`);
}
}
return title.slice(0, maxLength);
}
/**
* Validates that the value is the type that has been specified.
* May have to disable parts of BYTE_ARRAY validation if it effects performance.
*
* @returns {boolean} Whether the data is valid or not.
*/
valid() {
switch (this.type) {
case Dish.BYTE_ARRAY:
if (!(this.value instanceof Uint8Array) && !(this.value instanceof Array)) {
return false;
}
// Check that every value is a number between 0 - 255
for (let i = 0; i < this.value.length; i++) {
if (typeof this.value[i] !== "number" ||
this.value[i] < 0 ||
this.value[i] > 255) {
return false;
}
}
return true;
case Dish.STRING:
case Dish.HTML:
return typeof this.value === "string";
case Dish.NUMBER:
return typeof this.value === "number";
case Dish.ARRAY_BUFFER:
return this.value instanceof ArrayBuffer;
case Dish.BIG_NUMBER:
if (BigNumber.isBigNumber(this.value)) return true;
/*
If a BigNumber is passed between WebWorkers it is serialised as a JSON
object with a coefficient (c), exponent (e) and sign (s). We detect this
and reinitialise it as a BigNumber object.
*/
if (Object.keys(this.value).sort().equals(["c", "e", "s"])) {
const temp = new BigNumber();
temp.c = this.value.c;
temp.e = this.value.e;
temp.s = this.value.s;
this.value = temp;
return true;
}
return false;
case Dish.JSON:
// All values can be serialised in some manner, so we return true in all cases
return true;
case Dish.FILE:
return this.value instanceof File;
case Dish.LIST_FILE:
return this.value instanceof Array &&
this.value.reduce((acc, curr) => acc && curr instanceof File, true);
default:
return false;
}
}
/**
* Determines how much space the Dish takes up.
* Numbers in JavaScript are 64-bit floating point, however for the purposes of the Dish,
* we measure how many bytes are taken up when the number is written as a string.
*
* @returns {number}
*/
get size() {
switch (this.type) {
case Dish.BYTE_ARRAY:
case Dish.STRING:
case Dish.HTML:
return this.value.length;
case Dish.NUMBER:
case Dish.BIG_NUMBER:
return this.value.toString().length;
case Dish.ARRAY_BUFFER:
return this.value.byteLength;
case Dish.JSON:
return JSON.stringify(this.value).length;
case Dish.FILE:
return this.value.size;
case Dish.LIST_FILE:
return this.value.reduce((acc, curr) => acc + curr.size, 0);
default:
return -1;
}
}
/**
* Returns a deep clone of the current Dish.
*
* @returns {Dish}
*/
clone() {
const newDish = new Dish();
switch (this.type) {
case Dish.STRING:
case Dish.HTML:
case Dish.NUMBER:
case Dish.BIG_NUMBER:
// These data types are immutable so it is acceptable to copy them by reference
newDish.set(
this.value,
this.type
);
break;
case Dish.BYTE_ARRAY:
case Dish.JSON:
// These data types are mutable so they need to be copied by value
newDish.set(
JSON.parse(JSON.stringify(this.value)),
this.type
);
break;
case Dish.ARRAY_BUFFER:
// Slicing an ArrayBuffer returns a new ArrayBuffer with a copy its contents
newDish.set(
this.value.slice(0),
this.type
);
break;
case Dish.FILE:
// A new file can be created by copying over all the values from the original
newDish.set(
new File([this.value], this.value.name, {
"type": this.value.type,
"lastModified": this.value.lastModified
}),
this.type
);
break;
case Dish.LIST_FILE:
newDish.set(
this.value.map(f =>
new File([f], f.name, {
"type": f.type,
"lastModified": f.lastModified
})
),
this.type
);
break;
default:
throw new DishError("Cannot clone Dish, unknown type");
}
return newDish;
}
/**
* Translates the data to the given type format.
*
* If running in the browser, _translate is asynchronous.
*
* @param {number} toType - The data type of value, see Dish enums.
* @returns {Promise || undefined}
*/
_translate(toType) {
log.debug(`Translating Dish from ${Dish.enumLookup(this.type)} to ${Dish.enumLookup(toType)}`);
// Node environment => translate is sync
if (isNodeEnvironment()) {
this._toArrayBuffer();
this.type = Dish.ARRAY_BUFFER;
this._fromArrayBuffer(toType);
// Browser environment => translate is async
} else {
return new Promise((resolve, reject) => {
this._toArrayBuffer()
.then(() => this.type = Dish.ARRAY_BUFFER)
.then(() => {
this._fromArrayBuffer(toType);
resolve();
})
.catch(reject);
});
}
}
/**
* Convert this.value to an ArrayBuffer
*
* If running in a browser, _toByteArray is asynchronous.
*
* @returns {Promise || undefined}
*/
_toArrayBuffer() {
// Using 'bind' here to allow this.value to be mutated within translation functions
const toByteArrayFuncs = {
browser: {
[Dish.STRING]: () => Promise.resolve(DishString.toArrayBuffer.bind(this)()),
[Dish.NUMBER]: () => Promise.resolve(DishNumber.toArrayBuffer.bind(this)()),
[Dish.HTML]: () => Promise.resolve(DishHTML.toArrayBuffer.bind(this)()),
[Dish.ARRAY_BUFFER]: () => Promise.resolve(),
[Dish.BIG_NUMBER]: () => Promise.resolve(DishBigNumber.toArrayBuffer.bind(this)()),
[Dish.JSON]: () => Promise.resolve(DishJSON.toArrayBuffer.bind(this)()),
[Dish.FILE]: () => DishFile.toArrayBuffer.bind(this)(),
[Dish.LIST_FILE]: () => Promise.resolve(DishListFile.toArrayBuffer.bind(this)()),
[Dish.BYTE_ARRAY]: () => Promise.resolve(DishByteArray.toArrayBuffer.bind(this)()),
},
node: {
[Dish.STRING]: () => DishString.toArrayBuffer.bind(this)(),
[Dish.NUMBER]: () => DishNumber.toArrayBuffer.bind(this)(),
[Dish.HTML]: () => DishHTML.toArrayBuffer.bind(this)(),
[Dish.ARRAY_BUFFER]: () => {},
[Dish.BIG_NUMBER]: () => DishBigNumber.toArrayBuffer.bind(this)(),
[Dish.JSON]: () => DishJSON.toArrayBuffer.bind(this)(),
[Dish.FILE]: () => DishFile.toArrayBuffer.bind(this)(),
[Dish.LIST_FILE]: () => DishListFile.toArrayBuffer.bind(this)(),
[Dish.BYTE_ARRAY]: () => DishByteArray.toArrayBuffer.bind(this)(),
}
};
try {
return toByteArrayFuncs[isNodeEnvironment() && "node" || "browser"][this.type]();
} catch (err) {
throw new DishError(`Error translating from ${Dish.enumLookup(this.type)} to ArrayBuffer: ${err}`);
}
}
/**
* Convert this.value to the given type from ArrayBuffer
*
* @param {number} toType - the Dish enum to convert to
*/
_fromArrayBuffer(toType) {
// Using 'bind' here to allow this.value to be mutated within translation functions
const toTypeFunctions = {
[Dish.STRING]: () => DishString.fromArrayBuffer.bind(this)(),
[Dish.NUMBER]: () => DishNumber.fromArrayBuffer.bind(this)(),
[Dish.HTML]: () => DishHTML.fromArrayBuffer.bind(this)(),
[Dish.ARRAY_BUFFER]: () => {},
[Dish.BIG_NUMBER]: () => DishBigNumber.fromArrayBuffer.bind(this)(),
[Dish.JSON]: () => DishJSON.fromArrayBuffer.bind(this)(),
[Dish.FILE]: () => DishFile.fromArrayBuffer.bind(this)(),
[Dish.LIST_FILE]: () => DishListFile.fromArrayBuffer.bind(this)(),
[Dish.BYTE_ARRAY]: () => DishByteArray.fromArrayBuffer.bind(this)(),
};
try {
toTypeFunctions[toType]();
this.type = toType;
} catch (err) {
throw new DishError(`Error translating from ArrayBuffer to ${Dish.enumLookup(toType)}: ${err}`);
}
}
}
/**
* Dish data type enum for byte arrays.
* @readonly
* @enum
*/
Dish.BYTE_ARRAY = 0;
/**
* Dish data type enum for strings.
* @readonly
* @enum
*/
Dish.STRING = 1;
/**
* Dish data type enum for numbers.
* @readonly
* @enum
*/
Dish.NUMBER = 2;
/**
* Dish data type enum for HTML.
* @readonly
* @enum
*/
Dish.HTML = 3;
/**
* Dish data type enum for ArrayBuffers.
* @readonly
* @enum
*/
Dish.ARRAY_BUFFER = 4;
/**
* Dish data type enum for BigNumbers.
* @readonly
* @enum
*/
Dish.BIG_NUMBER = 5;
/**
* Dish data type enum for JSON.
* @readonly
* @enum
*/
Dish.JSON = 6;
/**
* Dish data type enum for lists of files.
* @readonly
* @enum
*/
Dish.FILE = 7;
/**
* Dish data type enum for lists of files.
* @readonly
* @enum
*/
Dish.LIST_FILE = 8;
export default Dish;
-289
View File
@@ -1,289 +0,0 @@
import Recipe from "./Recipe.js";
import Dish from "./Dish.js";
/**
* Flow Control operations.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @namespace
*/
const FlowControl = {
/**
* Fork operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
* @param {Operation[]} state.opList - The list of operations in the recipe.
* @returns {Object} The updated state of the recipe.
*/
runFork: async function(state) {
let opList = state.opList,
inputType = opList[state.progress].inputType,
outputType = opList[state.progress].outputType,
input = state.dish.get(inputType),
ings = opList[state.progress].getIngValues(),
splitDelim = ings[0],
mergeDelim = ings[1],
ignoreErrors = ings[2],
subOpList = [],
inputs = [],
i;
if (input)
inputs = input.split(splitDelim);
// Create subOpList for each tranche to operate on
// (all remaining operations unless we encounter a Merge)
for (i = state.progress + 1; i < opList.length; i++) {
if (opList[i].name === "Merge" && !opList[i].isDisabled()) {
break;
} else {
subOpList.push(opList[i]);
}
}
let recipe = new Recipe(),
output = "",
progress = 0;
state.forkOffset += state.progress + 1;
recipe.addOperations(subOpList);
// Take a deep(ish) copy of the ingredient values
const ingValues = subOpList.map(op => JSON.parse(JSON.stringify(op.getIngValues())));
// Run recipe over each tranche
for (i = 0; i < inputs.length; i++) {
log.debug(`Entering tranche ${i + 1} of ${inputs.length}`);
// Baseline ing values for each tranche so that registers are reset
subOpList.forEach((op, i) => {
op.setIngValues(JSON.parse(JSON.stringify(ingValues[i])));
});
const dish = new Dish(inputs[i], inputType);
try {
progress = await recipe.execute(dish, 0, state);
} catch (err) {
if (!ignoreErrors) {
throw err;
}
progress = err.progress + 1;
}
output += dish.get(outputType) + mergeDelim;
}
state.dish.set(output, outputType);
state.progress += progress;
return state;
},
/**
* Merge operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
* @param {Operation[]} state.opList - The list of operations in the recipe.
* @returns {Object} The updated state of the recipe.
*/
runMerge: function(state) {
// No need to actually do anything here. The fork operation will
// merge when it sees this operation.
return state;
},
/**
* Register operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
* @param {Operation[]} state.opList - The list of operations in the recipe.
* @returns {Object} The updated state of the recipe.
*/
runRegister: function(state) {
const ings = state.opList[state.progress].getIngValues(),
extractorStr = ings[0],
i = ings[1],
m = ings[2];
let modifiers = "";
if (i) modifiers += "i";
if (m) modifiers += "m";
const extractor = new RegExp(extractorStr, modifiers),
input = state.dish.get(Dish.STRING),
registers = input.match(extractor);
if (!registers) return state;
if (ENVIRONMENT_IS_WORKER()) {
self.setRegisters(state.forkOffset + state.progress, state.numRegisters, registers.slice(1));
}
/**
* Replaces references to registers (e.g. $R0) with the contents of those registers.
*
* @param {string} str
* @returns {string}
*/
function replaceRegister(str) {
// Replace references to registers ($Rn) with contents of registers
return str.replace(/(\\*)\$R(\d{1,2})/g, (match, slashes, regNum) => {
const index = parseInt(regNum, 10) + 1;
if (index <= state.numRegisters || index >= state.numRegisters + registers.length)
return match;
if (slashes.length % 2 !== 0) return match.slice(1); // Remove escape
return slashes + registers[index - state.numRegisters];
});
}
// Step through all subsequent ops and replace registers in args with extracted content
for (let i = state.progress + 1; i < state.opList.length; i++) {
if (state.opList[i].isDisabled()) continue;
let args = state.opList[i].getIngValues();
args = args.map(arg => {
if (typeof arg !== "string" && typeof arg !== "object") return arg;
if (typeof arg === "object" && arg.hasOwnProperty("string")) {
arg.string = replaceRegister(arg.string);
return arg;
}
return replaceRegister(arg);
});
state.opList[i].setIngValues(args);
}
state.numRegisters += registers.length - 1;
return state;
},
/**
* Jump operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
* @param {Operation[]} state.opList - The list of operations in the recipe.
* @param {number} state.numJumps - The number of jumps taken so far.
* @returns {Object} The updated state of the recipe.
*/
runJump: function(state) {
const ings = state.opList[state.progress].getIngValues(),
label = ings[0],
maxJumps = ings[1],
jmpIndex = FlowControl._getLabelIndex(label, state);
if (state.numJumps >= maxJumps || jmpIndex === -1) {
log.debug("Maximum jumps reached or label cannot be found");
return state;
}
state.progress = jmpIndex;
state.numJumps++;
log.debug(`Jumping to label '${label}' at position ${jmpIndex} (jumps = ${state.numJumps})`);
return state;
},
/**
* Conditional Jump operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
* @param {Operation[]} state.opList - The list of operations in the recipe.
* @param {number} state.numJumps - The number of jumps taken so far.
* @returns {Object} The updated state of the recipe.
*/
runCondJump: function(state) {
const ings = state.opList[state.progress].getIngValues(),
dish = state.dish,
regexStr = ings[0],
invert = ings[1],
label = ings[2],
maxJumps = ings[3],
jmpIndex = FlowControl._getLabelIndex(label, state);
if (state.numJumps >= maxJumps || jmpIndex === -1) {
log.debug("Maximum jumps reached or label cannot be found");
return state;
}
if (regexStr !== "") {
let strMatch = dish.get(Dish.STRING).search(regexStr) > -1;
if (!invert && strMatch || invert && !strMatch) {
state.progress = jmpIndex;
state.numJumps++;
log.debug(`Jumping to label '${label}' at position ${jmpIndex} (jumps = ${state.numJumps})`);
}
}
return state;
},
/**
* Return operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
* @param {Operation[]} state.opList - The list of operations in the recipe.
* @returns {Object} The updated state of the recipe.
*/
runReturn: function(state) {
state.progress = state.opList.length;
return state;
},
/**
* Comment operation.
*
* @param {Object} state - The current state of the recipe.
* @param {number} state.progress - The current position in the recipe.
* @param {Dish} state.dish - The Dish being operated on.
* @param {Operation[]} state.opList - The list of operations in the recipe.
* @returns {Object} The updated state of the recipe.
*/
runComment: function(state) {
return state;
},
/**
* Returns the index of a label.
*
* @private
* @param {Object} state
* @param {string} name
* @returns {number}
*/
_getLabelIndex: function(name, state) {
for (let o = 0; o < state.opList.length; o++) {
let operation = state.opList[o];
if (operation.name === "Label"){
let ings = operation.getIngValues();
if (name === ings[0]) {
return o;
}
}
}
return -1;
},
};
export default FlowControl;
-92
View File
@@ -1,92 +0,0 @@
import Utils from "./Utils.js";
/**
* The arguments to operations.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @class
* @param {Object} ingredientConfig
*/
const Ingredient = function(ingredientConfig) {
this.name = "";
this.type = "";
this.value = null;
if (ingredientConfig) {
this._parseConfig(ingredientConfig);
}
};
/**
* Reads and parses the given config.
*
* @private
* @param {Object} ingredientConfig
*/
Ingredient.prototype._parseConfig = function(ingredientConfig) {
this.name = ingredientConfig.name;
this.type = ingredientConfig.type;
};
/**
* Returns the value of the Ingredient as it should be displayed in a recipe config.
*
* @returns {*}
*/
Ingredient.prototype.getConfig = function() {
return this.value;
};
/**
* Sets the value of the Ingredient.
*
* @param {*} value
*/
Ingredient.prototype.setValue = function(value) {
this.value = Ingredient.prepare(value, this.type);
};
/**
* Most values will be strings when they are entered. This function converts them to the correct
* type.
*
* @static
* @param {*} data
* @param {string} type - The name of the data type.
*/
Ingredient.prepare = function(data, type) {
let number;
switch (type) {
case "binaryString":
case "binaryShortString":
case "editableOption":
return Utils.parseEscapedChars(data);
case "byteArray":
if (typeof data == "string") {
data = data.replace(/\s+/g, "");
return Utils.fromHex(data);
} else {
return data;
}
case "number":
number = parseFloat(data);
if (isNaN(number)) {
const sample = Utils.truncate(data.toString(), 10);
throw "Invalid ingredient value. Not a number: " + sample;
}
return number;
default:
return data;
}
};
export default Ingredient;
+132
View File
@@ -0,0 +1,132 @@
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import Utils from "./Utils.mjs";
import {fromHex} from "./lib/Hex.mjs";
/**
* The arguments to operations.
*/
class Ingredient {
/**
* Ingredient constructor
*
* @param {Object} ingredientConfig
*/
constructor(ingredientConfig) {
this.name = "";
this.type = "";
this._value = null;
this.disabled = false;
this.hint = "";
this.rows = 0;
this.toggleValues = [];
this.target = null;
this.defaultIndex = 0;
this.maxLength = null;
this.min = null;
this.max = null;
this.step = 1;
if (ingredientConfig) {
this._parseConfig(ingredientConfig);
}
}
/**
* Reads and parses the given config.
*
* @private
* @param {Object} ingredientConfig
*/
_parseConfig(ingredientConfig) {
this.name = ingredientConfig.name;
this.type = ingredientConfig.type;
this.defaultValue = ingredientConfig.value;
this.disabled = !!ingredientConfig.disabled;
this.hint = ingredientConfig.hint || false;
this.rows = ingredientConfig.rows || false;
this.toggleValues = ingredientConfig.toggleValues;
this.target = typeof ingredientConfig.target !== "undefined" ? ingredientConfig.target : null;
this.defaultIndex = typeof ingredientConfig.defaultIndex !== "undefined" ? ingredientConfig.defaultIndex : 0;
this.maxLength = ingredientConfig.maxLength || null;
this.min = ingredientConfig.min;
this.max = ingredientConfig.max;
this.step = ingredientConfig.step;
}
/**
* Returns the value of the Ingredient as it should be displayed in a recipe config.
*
* @returns {*}
*/
get config() {
return this._value;
}
/**
* Sets the value of the Ingredient.
*
* @param {*} value
*/
set value(value) {
this._value = Ingredient.prepare(value, this.type);
}
/**
* Gets the value of the Ingredient.
*
* @returns {*}
*/
get value() {
return this._value;
}
/**
* Most values will be strings when they are entered. This function converts them to the correct
* type.
*
* @param {*} data
* @param {string} type - The name of the data type.
*/
static prepare(data, type) {
let number;
switch (type) {
case "binaryString":
case "binaryShortString":
case "editableOption":
case "editableOptionShort":
return Utils.parseEscapedChars(data);
case "byteArray":
if (typeof data == "string") {
data = data.replace(/\s+/g, "");
return fromHex(data);
} else {
return data;
}
case "number":
if (data === null) return data;
number = parseFloat(data);
if (isNaN(number)) {
const sample = Utils.truncate(data.toString(), 10);
throw "Invalid ingredient value. Not a number: " + sample;
}
return number;
default:
return data;
}
}
}
export default Ingredient;
-174
View File
@@ -1,174 +0,0 @@
import Dish from "./Dish.js";
import Ingredient from "./Ingredient.js";
import OperationConfig from "./config/MetaConfig.js";
import OpModules from "./config/modules/OpModules.js";
/**
* The Operation specified by the user to be run.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @class
* @param {string} operationName
*/
const Operation = function(operationName) {
this.name = operationName;
this.module = "";
this.description = "";
this.inputType = -1;
this.outputType = -1;
this.run = null;
this.highlight = null;
this.highlightReverse = null;
this.breakpoint = false;
this.disabled = false;
this.ingList = [];
if (OperationConfig.hasOwnProperty(this.name)) {
this._parseConfig(OperationConfig[this.name]);
}
};
/**
* Reads and parses the given config.
*
* @private
* @param {Object} operationConfig
*/
Operation.prototype._parseConfig = function(operationConfig) {
this.module = operationConfig.module;
this.description = operationConfig.description;
this.inputType = Dish.typeEnum(operationConfig.inputType);
this.outputType = Dish.typeEnum(operationConfig.outputType);
this.highlight = operationConfig.highlight;
this.highlightReverse = operationConfig.highlightReverse;
this.flowControl = operationConfig.flowControl;
this.run = OpModules[this.module][this.name];
for (let a = 0; a < operationConfig.args.length; a++) {
const ingredientConfig = operationConfig.args[a];
const ingredient = new Ingredient(ingredientConfig);
this.addIngredient(ingredient);
}
if (this.highlight === "func") {
this.highlight = OpModules[this.module][`${this.name}-highlight`];
}
if (this.highlightReverse === "func") {
this.highlightReverse = OpModules[this.module][`${this.name}-highlightReverse`];
}
};
/**
* Returns the value of the Operation as it should be displayed in a recipe config.
*
* @returns {Object}
*/
Operation.prototype.getConfig = function() {
const ingredientConfig = [];
for (let o = 0; o < this.ingList.length; o++) {
ingredientConfig.push(this.ingList[o].getConfig());
}
const operationConfig = {
"op": this.name,
"args": ingredientConfig
};
return operationConfig;
};
/**
* Adds a new Ingredient to this Operation.
*
* @param {Ingredient} ingredient
*/
Operation.prototype.addIngredient = function(ingredient) {
this.ingList.push(ingredient);
};
/**
* Set the Ingredient values for this Operation.
*
* @param {Object[]} ingValues
*/
Operation.prototype.setIngValues = function(ingValues) {
for (let i = 0; i < ingValues.length; i++) {
this.ingList[i].setValue(ingValues[i]);
}
};
/**
* Get the Ingredient values for this Operation.
*
* @returns {Object[]}
*/
Operation.prototype.getIngValues = function() {
const ingValues = [];
for (let i = 0; i < this.ingList.length; i++) {
ingValues.push(this.ingList[i].value);
}
return ingValues;
};
/**
* Set whether this Operation has a breakpoint.
*
* @param {boolean} value
*/
Operation.prototype.setBreakpoint = function(value) {
this.breakpoint = !!value;
};
/**
* Returns true if this Operation has a breakpoint set.
*
* @returns {boolean}
*/
Operation.prototype.isBreakpoint = function() {
return this.breakpoint;
};
/**
* Set whether this Operation is disabled.
*
* @param {boolean} value
*/
Operation.prototype.setDisabled = function(value) {
this.disabled = !!value;
};
/**
* Returns true if this Operation is disabled.
*
* @returns {boolean}
*/
Operation.prototype.isDisabled = function() {
return this.disabled;
};
/**
* Returns true if this Operation is a flow control.
*
* @returns {boolean}
*/
Operation.prototype.isFlowControl = function() {
return this.flowControl;
};
export default Operation;
+322
View File
@@ -0,0 +1,322 @@
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import Dish from "./Dish.mjs";
import Ingredient from "./Ingredient.mjs";
/**
* The Operation specified by the user to be run.
*/
class Operation {
/**
* Operation constructor
*/
constructor() {
// Private fields
this._inputType = -1;
this._outputType = -1;
this._presentType = -1;
this._breakpoint = false;
this._disabled = false;
this._flowControl = false;
this._manualBake = false;
this._ingList = [];
// Public fields
this.name = "";
this.module = "";
this.description = "";
this.infoURL = null;
}
/**
* Interface for operation runner
*
* @param {*} input
* @param {Object[]} args
* @returns {*}
*/
run(input, args) {
return input;
}
/**
* Interface for forward highlighter
*
* @param {Object[]} pos
* @param {number} pos[].start
* @param {number} pos[].end
* @param {Object[]} args
* @returns {Object[]} pos
*/
highlight(pos, args) {
return false;
}
/**
* Interface for reverse highlighter
*
* @param {Object[]} pos
* @param {number} pos[].start
* @param {number} pos[].end
* @param {Object[]} args
* @returns {Object[]} pos
*/
highlightReverse(pos, args) {
return false;
}
/**
* Method to be called when displaying the result of an operation in a human-readable
* format. This allows operations to return usable data from their run() method and
* only format them when this method is called.
*
* The default action is to return the data unchanged, but child classes can override
* this behaviour.
*
* @param {*} data - The result of the run() function
* @param {Object[]} args - The operation's arguments
* @returns {*} - A human-readable version of the data
*/
present(data, args) {
return data;
}
/**
* Sets the input type as a Dish enum.
*
* @param {string} typeStr
*/
set inputType(typeStr) {
this._inputType = Dish.typeEnum(typeStr);
}
/**
* Gets the input type as a readable string.
*
* @returns {string}
*/
get inputType() {
return Dish.enumLookup(this._inputType);
}
/**
* Sets the output type as a Dish enum.
*
* @param {string} typeStr
*/
set outputType(typeStr) {
this._outputType = Dish.typeEnum(typeStr);
if (this._presentType < 0) this._presentType = this._outputType;
}
/**
* Gets the output type as a readable string.
*
* @returns {string}
*/
get outputType() {
return Dish.enumLookup(this._outputType);
}
/**
* Sets the presentation type as a Dish enum.
*
* @param {string} typeStr
*/
set presentType(typeStr) {
this._presentType = Dish.typeEnum(typeStr);
}
/**
* Gets the presentation type as a readable string.
*
* @returns {string}
*/
get presentType() {
return Dish.enumLookup(this._presentType);
}
/**
* Sets the args for the current operation.
*
* @param {Object[]} conf
*/
set args(conf) {
conf.forEach(arg => {
const ingredient = new Ingredient(arg);
this.addIngredient(ingredient);
});
}
/**
* Gets the args for the current operation.
*
* @param {Object[]} conf
*/
get args() {
return this._ingList.map(ing => {
const conf = {
name: ing.name,
type: ing.type,
value: ing.defaultValue
};
if (ing.toggleValues) conf.toggleValues = ing.toggleValues;
if (ing.hint) conf.hint = ing.hint;
if (ing.rows) conf.rows = ing.rows;
if (ing.disabled) conf.disabled = ing.disabled;
if (ing.target) conf.target = ing.target;
if (ing.defaultIndex) conf.defaultIndex = ing.defaultIndex;
if (ing.maxLength) conf.maxLength = ing.maxLength;
if (typeof ing.min === "number") conf.min = ing.min;
if (typeof ing.max === "number") conf.max = ing.max;
if (ing.step) conf.step = ing.step;
return conf;
});
}
/**
* Returns the value of the Operation as it should be displayed in a recipe config.
*
* @returns {Object}
*/
get config() {
return {
"op": this.name,
"args": this._ingList.map(ing => ing.config)
};
}
/**
* Adds a new Ingredient to this Operation.
*
* @param {Ingredient} ingredient
*/
addIngredient(ingredient) {
this._ingList.push(ingredient);
}
/**
* Set the Ingredient values for this Operation.
*
* @param {Object[]} ingValues
*/
set ingValues(ingValues) {
ingValues.forEach((val, i) => {
this._ingList[i].value = val;
});
}
/**
* Get the Ingredient values for this Operation.
*
* @returns {Object[]}
*/
get ingValues() {
return this._ingList.map(ing => ing.value);
}
/**
* Set whether this Operation has a breakpoint.
*
* @param {boolean} value
*/
set breakpoint(value) {
this._breakpoint = !!value;
}
/**
* Returns true if this Operation has a breakpoint set.
*
* @returns {boolean}
*/
get breakpoint() {
return this._breakpoint;
}
/**
* Set whether this Operation is disabled.
*
* @param {boolean} value
*/
set disabled(value) {
this._disabled = !!value;
}
/**
* Returns true if this Operation is disabled.
*
* @returns {boolean}
*/
get disabled() {
return this._disabled;
}
/**
* Returns true if this Operation is a flow control.
*
* @returns {boolean}
*/
get flowControl() {
return this._flowControl;
}
/**
* Set whether this Operation is a flowcontrol op.
*
* @param {boolean} value
*/
set flowControl(value) {
this._flowControl = !!value;
}
/**
* Returns true if this Operation should not trigger AutoBake.
*
* @returns {boolean}
*/
get manualBake() {
return this._manualBake;
}
/**
* Set whether this Operation should trigger AutoBake.
*
* @param {boolean} value
*/
set manualBake(value) {
this._manualBake = !!value;
}
}
export default Operation;
-264
View File
@@ -1,264 +0,0 @@
import Operation from "./Operation.js";
/**
* The Recipe controls a list of Operations and the Dish they operate on.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @class
* @param {Object} recipeConfig
*/
const Recipe = function(recipeConfig) {
this.opList = [];
if (recipeConfig) {
this._parseConfig(recipeConfig);
}
};
/**
* Reads and parses the given config.
*
* @private
* @param {Object} recipeConfig
*/
Recipe.prototype._parseConfig = function(recipeConfig) {
for (let c = 0; c < recipeConfig.length; c++) {
const operationName = recipeConfig[c].op;
const operation = new Operation(operationName);
operation.setIngValues(recipeConfig[c].args);
operation.setBreakpoint(recipeConfig[c].breakpoint);
operation.setDisabled(recipeConfig[c].disabled);
this.addOperation(operation);
}
};
/**
* Returns the value of the Recipe as it should be displayed in a recipe config.
*
* @returns {*}
*/
Recipe.prototype.getConfig = function() {
const recipeConfig = [];
for (let o = 0; o < this.opList.length; o++) {
recipeConfig.push(this.opList[o].getConfig());
}
return recipeConfig;
};
/**
* Adds a new Operation to this Recipe.
*
* @param {Operation} operation
*/
Recipe.prototype.addOperation = function(operation) {
this.opList.push(operation);
};
/**
* Adds a list of Operations to this Recipe.
*
* @param {Operation[]} operations
*/
Recipe.prototype.addOperations = function(operations) {
this.opList = this.opList.concat(operations);
};
/**
* Set a breakpoint on a specified Operation.
*
* @param {number} position - The index of the Operation
* @param {boolean} value
*/
Recipe.prototype.setBreakpoint = function(position, value) {
try {
this.opList[position].setBreakpoint(value);
} catch (err) {
// Ignore index error
}
};
/**
* Remove breakpoints on all Operations in the Recipe up to the specified position. Used by Flow
* Control Fork operation.
*
* @param {number} pos
*/
Recipe.prototype.removeBreaksUpTo = function(pos) {
for (let i = 0; i < pos; i++) {
this.opList[i].setBreakpoint(false);
}
};
/**
* Returns true if there is an Flow Control Operation in this Recipe.
*
* @returns {boolean}
*/
Recipe.prototype.containsFlowControl = function() {
for (let i = 0; i < this.opList.length; i++) {
if (this.opList[i].isFlowControl()) return true;
}
return false;
};
/**
* Returns the index of the last Operation index that will be executed, taking into account disabled
* Operations and breakpoints.
*
* @param {number} [startIndex=0] - The index to start searching from
* @returns (number}
*/
Recipe.prototype.lastOpIndex = function(startIndex) {
let i = startIndex + 1 || 0,
op;
for (; i < this.opList.length; i++) {
op = this.opList[i];
if (op.isDisabled()) return i-1;
if (op.isBreakpoint()) return i-1;
}
return i-1;
};
/**
* Executes each operation in the recipe over the given Dish.
*
* @param {Dish} dish
* @param {number} [startFrom=0] - The index of the Operation to start executing from
* @param {number} [forkState={}] - If this is a forked recipe, the state of the recipe up to this point
* @returns {number} - The final progress through the recipe
*/
Recipe.prototype.execute = async function(dish, startFrom = 0, forkState = {}) {
let op, input, output,
numJumps = 0,
numRegisters = forkState.numRegisters || 0;
log.debug(`[*] Executing recipe of ${this.opList.length} operations, starting at ${startFrom}`);
for (let i = startFrom; i < this.opList.length; i++) {
op = this.opList[i];
log.debug(`[${i}] ${op.name} ${JSON.stringify(op.getIngValues())}`);
if (op.isDisabled()) {
log.debug("Operation is disabled, skipping");
continue;
}
if (op.isBreakpoint()) {
log.debug("Pausing at breakpoint");
return i;
}
try {
input = dish.get(op.inputType);
log.debug("Executing operation");
if (op.isFlowControl()) {
// Package up the current state
let state = {
"progress": i,
"dish": dish,
"opList": this.opList,
"numJumps": numJumps,
"numRegisters": numRegisters,
"forkOffset": forkState.forkOffset || 0
};
state = await op.run(state);
i = state.progress;
numJumps = state.numJumps;
numRegisters = state.numRegisters;
} else {
output = await op.run(input, op.getIngValues());
dish.set(output, op.outputType);
}
} catch (err) {
const e = typeof err == "string" ? { message: err } : err;
e.progress = i;
if (e.fileName) {
e.displayStr = op.name + " - " + e.name + " in " +
e.fileName + " on line " + e.lineNumber +
".<br><br>Message: " + (e.displayStr || e.message);
} else {
e.displayStr = op.name + " - " + (e.displayStr || e.message);
}
throw e;
}
}
log.debug("Recipe complete");
return this.opList.length;
};
/**
* Returns the recipe configuration in string format.
*
* @returns {string}
*/
Recipe.prototype.toString = function() {
return JSON.stringify(this.getConfig());
};
/**
* Creates a Recipe from a given configuration string.
*
* @param {string} recipeStr
*/
Recipe.prototype.fromString = function(recipeStr) {
const recipeConfig = JSON.parse(recipeStr);
this._parseConfig(recipeConfig);
};
/**
* Generates a list of all the highlight functions assigned to operations in the recipe, if the
* entire recipe supports highlighting.
*
* @returns {Object[]} highlights
* @returns {function} highlights[].f
* @returns {function} highlights[].b
* @returns {Object[]} highlights[].args
*/
Recipe.prototype.generateHighlightList = function() {
const highlights = [];
for (let i = 0; i < this.opList.length; i++) {
let op = this.opList[i];
if (op.isDisabled()) continue;
// If any breakpoints are set, do not attempt to highlight
if (op.isBreakpoint()) return false;
// If any of the operations do not support highlighting, fail immediately.
if (op.highlight === false || op.highlight === undefined) return false;
highlights.push({
f: op.highlight,
b: op.highlightReverse,
args: op.getIngValues()
});
}
return highlights;
};
export default Recipe;
+346
View File
@@ -0,0 +1,346 @@
/**
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import OperationConfig from "./config/OperationConfig.json" assert {type: "json"};
import OperationError from "./errors/OperationError.mjs";
import Operation from "./Operation.mjs";
import DishError from "./errors/DishError.mjs";
import log from "loglevel";
import { isWorkerEnvironment } from "./Utils.mjs";
// Cache container for modules
let modules = null;
/**
* The Recipe controls a list of Operations and the Dish they operate on.
*/
class Recipe {
/**
* Recipe constructor
*
* @param {Object} recipeConfig
*/
constructor(recipeConfig) {
this.opList = [];
if (recipeConfig) {
this._parseConfig(recipeConfig);
}
}
/**
* Reads and parses the given config.
*
* @private
* @param {Object} recipeConfig
*/
_parseConfig(recipeConfig) {
recipeConfig.forEach(c => {
this.opList.push({
name: c.op,
module: OperationConfig[c.op].module,
ingValues: c.args,
breakpoint: c.breakpoint,
disabled: c.disabled || c.op === "Comment",
});
});
}
/**
* Populate elements of opList with operation instances.
* Dynamic import here removes top-level cyclic dependency issue.
*
* @private
*/
async _hydrateOpList() {
if (!modules) {
// Using Webpack Magic Comments to force the dynamic import to be included in the main chunk
// https://webpack.js.org/api/module-methods/
modules = await import(/* webpackMode: "eager" */ "./config/modules/OpModules.mjs");
modules = modules.default;
}
this.opList = this.opList.map(o => {
if (o instanceof Operation) {
return o;
} else {
const op = new modules[o.module][o.name]();
op.ingValues = o.ingValues;
op.breakpoint = o.breakpoint;
op.disabled = o.disabled;
return op;
}
});
}
/**
* Returns the value of the Recipe as it should be displayed in a recipe config.
*
* @returns {Object[]}
*/
get config() {
return this.opList.map(op => ({
op: op.name,
args: op.ingValues,
}));
}
/**
* Adds a new Operation to this Recipe.
*
* @param {Operation} operation
*/
addOperation(operation) {
this.opList.push(operation);
}
/**
* Adds a list of Operations to this Recipe.
*
* @param {Operation[]} operations
*/
addOperations(operations) {
operations.forEach(o => {
if (o instanceof Operation) {
this.opList.push(o);
} else {
this.opList.push({
name: o.name,
module: o.module,
ingValues: o.args,
breakpoint: o.breakpoint,
disabled: o.disabled,
});
}
});
}
/**
* Set a breakpoint on a specified Operation.
*
* @param {number} position - The index of the Operation
* @param {boolean} value
*/
setBreakpoint(position, value) {
try {
this.opList[position].breakpoint = value;
} catch (err) {
// Ignore index error
}
}
/**
* Remove breakpoints on all Operations in the Recipe up to the specified position. Used by Flow
* Control Fork operation.
*
* @param {number} pos
*/
removeBreaksUpTo(pos) {
for (let i = 0; i < pos; i++) {
this.opList[i].breakpoint = false;
}
}
/**
* Returns true if there is a Flow Control Operation in this Recipe.
*
* @returns {boolean}
*/
containsFlowControl() {
return this.opList.reduce((acc, curr) => {
return acc || curr.flowControl;
}, false);
}
/**
* Executes each operation in the recipe over the given Dish.
*
* @param {Dish} dish
* @param {number} [startFrom=0]
* - The index of the Operation to start executing from
* @param {number} [forkState={}]
* - If this is a forked recipe, the state of the recipe up to this point
* @returns {number}
* - The final progress through the recipe
*/
async execute(dish, startFrom=0, forkState={}) {
let op, input, output,
numJumps = 0,
numRegisters = forkState.numRegisters || 0;
if (startFrom === 0) this.lastRunOp = null;
await this._hydrateOpList();
log.debug(`[*] Executing recipe of ${this.opList.length} operations, starting at ${startFrom}`);
for (let i = startFrom; i < this.opList.length; i++) {
op = this.opList[i];
log.debug(`[${i}] ${op.name} ${JSON.stringify(op.ingValues)}`);
if (op.disabled) {
log.debug("Operation is disabled, skipping");
continue;
}
if (op.breakpoint) {
log.debug("Pausing at breakpoint");
return i;
}
try {
input = await dish.get(op.inputType);
log.debug(`Executing operation '${op.name}'`);
if (isWorkerEnvironment()) {
self.sendStatusMessage(`Baking... (${i+1}/${this.opList.length})`);
self.sendProgressMessage(i + 1, this.opList.length);
}
if (op.flowControl) {
// Package up the current state
let state = {
"progress": i,
"dish": dish,
"opList": this.opList,
"numJumps": numJumps,
"numRegisters": numRegisters,
"forkOffset": forkState.forkOffset || 0
};
state = await op.run(state);
i = state.progress;
numJumps = state.numJumps;
numRegisters = state.numRegisters;
} else {
output = await op.run(input, op.ingValues);
dish.set(output, op.outputType);
}
this.lastRunOp = op;
} catch (err) {
// Return expected errors as output
if (err instanceof OperationError || err?.type === "OperationError") {
// Cannot rely on `err instanceof OperationError` here as extending
// native types is not fully supported yet.
dish.set(err.message, "string");
return i;
} else if (err instanceof DishError || err?.type === "DishError") {
dish.set(err.message, "string");
return i;
} else {
const e = typeof err == "string" ? { message: err } : err;
e.progress = i;
if (e.fileName) {
e.displayStr = `${op.name} - ${e.name} in ${e.fileName} on line ` +
`${e.lineNumber}.<br><br>Message: ${e.displayStr || e.message}`;
} else {
e.displayStr = `${op.name} - ${e.displayStr || e.message}`;
}
throw e;
}
}
}
log.debug("Recipe complete");
return this.opList.length;
}
/**
* Present the results of the final operation.
*
* @param {Dish} dish
*/
async present(dish) {
if (!this.lastRunOp) return;
const output = await this.lastRunOp.present(
await dish.get(this.lastRunOp.outputType),
this.lastRunOp.ingValues
);
dish.set(output, this.lastRunOp.presentType);
}
/**
* Returns the recipe configuration in string format.
*
* @returns {string}
*/
toString() {
return JSON.stringify(this.config);
}
/**
* Creates a Recipe from a given configuration string.
*
* @param {string} recipeStr
*/
fromString(recipeStr) {
const recipeConfig = JSON.parse(recipeStr);
this._parseConfig(recipeConfig);
}
/**
* Generates a list of all the highlight functions assigned to operations in the recipe, if the
* entire recipe supports highlighting.
*
* @returns {Object[]} highlights
* @returns {function} highlights[].f
* @returns {function} highlights[].b
* @returns {Object[]} highlights[].args
*/
async generateHighlightList() {
await this._hydrateOpList();
const highlights = [];
for (let i = 0; i < this.opList.length; i++) {
const op = this.opList[i];
if (op.disabled) continue;
// If any breakpoints are set, do not attempt to highlight
if (op.breakpoint) return false;
// If any of the operations do not support highlighting, fail immediately.
if (op.highlight === false || op.highlight === undefined) return false;
highlights.push({
f: op.highlight,
b: op.highlightReverse,
args: op.ingValues
});
}
return highlights;
}
/**
* Determines whether the previous operation has a different presentation type to its normal output.
*
* @param {number} progress
* @returns {boolean}
*/
lastOpPresented(progress) {
if (progress < 1) return false;
return this.opList[progress-1].presentType !== this.opList[progress-1].outputType;
}
}
export default Recipe;
File diff suppressed because it is too large. Load diff
+229 -68
View File
@@ -1,30 +1,11 @@
/**
* Type definition for a CatConf.
*
* @typedef {Object} CatConf
* @property {string} name - The display name for the category
* @property {string[]} ops - A list of the operations to be included in this category
*/
/**
* Categories of operations.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*
* @constant
* @type {CatConf[]}
*/
const Categories = [
[
{
name: "Favourites",
ops: []
"name": "Favourites",
"ops": []
},
{
name: "Data format",
ops: [
"name": "Data format",
"ops": [
"To Hexdump",
"From Hexdump",
"To Hex",
@@ -37,13 +18,19 @@ const Categories = [
"From Binary",
"To Octal",
"From Octal",
"To Base32",
"From Base32",
"To Base45",
"From Base45",
"To Base58",
"From Base58",
"To Base62",
"From Base62",
"To Base64",
"From Base64",
"Show Base64 offsets",
"To Base32",
"From Base32",
"To Base58",
"From Base58",
"To Base85",
"From Base85",
"To Base",
"From Base",
"To BCD",
@@ -54,10 +41,13 @@ const Categories = [
"URL Decode",
"Escape Unicode Characters",
"Unescape Unicode Characters",
"Normalise Unicode",
"To Quoted Printable",
"From Quoted Printable",
"To Punycode",
"From Punycode",
"AMF Encode",
"AMF Decode",
"To Hex Content",
"From Hex Content",
"PEM to Hex",
@@ -66,12 +56,23 @@ const Categories = [
"Change IP format",
"Encode text",
"Decode text",
"Text Encoding Brute Force",
"Swap endianness",
"To MessagePack",
"From MessagePack",
"To Braille",
"From Braille",
"Parse TLV",
"CSV to JSON",
"JSON to CSV",
"Avro to JSON",
"CBOR Encode",
"CBOR Decode"
]
},
{
name: "Encryption / Encoding",
ops: [
"name": "Encryption / Encoding",
"ops": [
"AES Encrypt",
"AES Decrypt",
"Blowfish Encrypt",
@@ -80,34 +81,75 @@ const Categories = [
"DES Decrypt",
"Triple DES Encrypt",
"Triple DES Decrypt",
"LS47 Encrypt",
"LS47 Decrypt",
"RC2 Encrypt",
"RC2 Decrypt",
"RC4",
"RC4 Drop",
"ChaCha",
"Rabbit",
"SM4 Encrypt",
"SM4 Decrypt",
"GOST Encrypt",
"GOST Decrypt",
"GOST Sign",
"GOST Verify",
"GOST Key Wrap",
"GOST Key Unwrap",
"ROT13",
"ROT13 Brute Force",
"ROT47",
"ROT47 Brute Force",
"ROT8000",
"XOR",
"XOR Brute Force",
"Vigenère Encode",
"Vigenère Decode",
"To Morse Code",
"From Morse Code",
"Bacon Cipher Encode",
"Bacon Cipher Decode",
"Bifid Cipher Encode",
"Bifid Cipher Decode",
"Caesar Box Cipher",
"Affine Cipher Encode",
"Affine Cipher Decode",
"A1Z26 Cipher Encode",
"A1Z26 Cipher Decode",
"Rail Fence Cipher Encode",
"Rail Fence Cipher Decode",
"Atbash Cipher",
"CipherSaber2 Encrypt",
"CipherSaber2 Decrypt",
"Cetacean Cipher Encode",
"Cetacean Cipher Decode",
"Substitute",
"Derive PBKDF2 key",
"Derive EVP key",
"Derive HKDF key",
"Bcrypt",
"Scrypt",
"JWT Sign",
"JWT Verify",
"JWT Decode",
"Citrix CTX1 Encode",
"Citrix CTX1 Decode",
"AES Key Wrap",
"AES Key Unwrap",
"Pseudo-Random Number Generator",
"Enigma",
"Bombe",
"Multiple Bombe",
"Typex",
"Lorenz",
"Colossus",
"SIGABA"
]
},
{
name: "Public Key",
ops: [
"name": "Public Key",
"ops": [
"Parse X.509 certificate",
"Parse ASN.1 hex string",
"PEM to Hex",
@@ -117,13 +159,26 @@ const Categories = [
"Generate PGP Key Pair",
"PGP Encrypt",
"PGP Decrypt",
"PGP Verify",
"PGP Encrypt and Sign",
"PGP Decrypt and Verify",
"Generate RSA Key Pair",
"RSA Sign",
"RSA Verify",
"RSA Encrypt",
"RSA Decrypt",
"Parse SSH Host Key"
]
},
{
name: "Arithmetic / Logic",
ops: [
"name": "Arithmetic / Logic",
"ops": [
"Set Union",
"Set Intersection",
"Set Difference",
"Symmetric Difference",
"Cartesian Product",
"Power Set",
"XOR",
"XOR Brute Force",
"OR",
@@ -143,48 +198,72 @@ const Categories = [
"Rotate left",
"Rotate right",
"ROT13",
"ROT8000"
]
},
{
name: "Networking",
ops: [
"name": "Networking",
"ops": [
"HTTP request",
"DNS over HTTPS",
"Strip HTTP headers",
"Dechunk HTTP response",
"Parse User Agent",
"Parse IP range",
"Parse IPv6 address",
"Parse IPv4 header",
"Parse TCP",
"Parse UDP",
"Parse SSH Host Key",
"Parse URI",
"URL Encode",
"URL Decode",
"Protobuf Decode",
"Protobuf Encode",
"VarInt Encode",
"VarInt Decode",
"JA3 Fingerprint",
"JA3S Fingerprint",
"HASSH Client Fingerprint",
"HASSH Server Fingerprint",
"Format MAC addresses",
"Change IP format",
"Group IP addresses",
"Encode NetBIOS Name",
"Decode NetBIOS Name",
"Defang URL",
"Defang IP Addresses"
]
},
{
name: "Language",
ops: [
"name": "Language",
"ops": [
"Encode text",
"Decode text",
"Unicode Text Format",
"Remove Diacritics",
"Unescape Unicode Characters",
"Convert to NATO alphabet"
]
},
{
name: "Utils",
ops: [
"name": "Utils",
"ops": [
"Diff",
"Remove whitespace",
"Remove null bytes",
"To Upper case",
"To Lower case",
"Swap case",
"To Case Insensitive Regex",
"From Case Insensitive Regex",
"Add line numbers",
"Remove line numbers",
"Get All Casings",
"To Table",
"Reverse",
"Sort",
"Shuffle",
"Unique",
"Split",
"Filter",
@@ -197,25 +276,30 @@ const Categories = [
"Pad lines",
"Find / Replace",
"Regular expression",
"Fuzzy Match",
"Offset checker",
"Hamming Distance",
"Levenshtein Distance",
"Convert distance",
"Convert area",
"Convert mass",
"Convert speed",
"Convert data units",
"Convert co-ordinate format",
"Show on map",
"Parse UNIX file permissions",
"Parse ObjectID timestamp",
"Swap endianness",
"Parse colour code",
"Escape string",
"Unescape string",
"Pseudo-Random Number Generator",
"Sleep",
"Sleep"
]
},
{
name: "Date / Time",
ops: [
"name": "Date / Time",
"ops": [
"Parse DateTime",
"Translate DateTime Format",
"From UNIX Timestamp",
@@ -223,12 +307,13 @@ const Categories = [
"Windows Filetime to UNIX Timestamp",
"UNIX Timestamp to Windows Filetime",
"Extract dates",
"Sleep",
"Get Time",
"Sleep"
]
},
{
name: "Extractors",
ops: [
"name": "Extractors",
"ops": [
"Strings",
"Extract IP addresses",
"Extract email addresses",
@@ -242,11 +327,13 @@ const Categories = [
"JPath expression",
"CSS selector",
"Extract EXIF",
"Extract ID3",
"Extract Files"
]
},
{
name: "Compression",
ops: [
"name": "Compression",
"ops": [
"Raw Deflate",
"Raw Inflate",
"Zlib Deflate",
@@ -256,13 +343,20 @@ const Categories = [
"Zip",
"Unzip",
"Bzip2 Decompress",
"Bzip2 Compress",
"Tar",
"Untar",
"LZString Decompress",
"LZString Compress",
"LZMA Decompress",
"LZMA Compress",
"LZ4 Decompress",
"LZ4 Compress"
]
},
{
name: "Hashing",
ops: [
"name": "Hashing",
"ops": [
"Analyse hash",
"Generate all hashes",
"MD2",
@@ -273,34 +367,46 @@ const Categories = [
"SHA1",
"SHA2",
"SHA3",
"SM3",
"Keccak",
"Shake",
"RIPEMD",
"HAS-160",
"Whirlpool",
"Snefru",
"BLAKE2b",
"BLAKE2s",
"GOST Hash",
"Streebog",
"SSDEEP",
"CTPH",
"Compare SSDEEP hashes",
"Compare CTPH hashes",
"HMAC",
"CMAC",
"Bcrypt",
"Bcrypt compare",
"Bcrypt parse",
"Argon2",
"Argon2 compare",
"Scrypt",
"NT Hash",
"LM Hash",
"Fletcher-8 Checksum",
"Fletcher-16 Checksum",
"Fletcher-32 Checksum",
"Fletcher-64 Checksum",
"Adler-32 Checksum",
"Luhn Checksum",
"CRC-8 Checksum",
"CRC-16 Checksum",
"CRC-32 Checksum",
"TCP/IP Checksum",
"TCP/IP Checksum"
]
},
{
name: "Code tidy",
ops: [
"name": "Code tidy",
"ops": [
"Syntax highlighter",
"Generic Code Beautify",
"JavaScript Parser",
@@ -326,32 +432,89 @@ const Categories = [
"To Kebab case",
"BSON serialise",
"BSON deserialise",
"To MessagePack",
"From MessagePack",
"Render Markdown"
]
},
{
name: "Other",
ops: [
"Entropy",
"Frequency distribution",
"Chi Square",
"name": "Forensics",
"ops": [
"Detect File Type",
"Scan for Embedded Files",
"Extract Files",
"YARA Rules",
"Remove EXIF",
"Extract EXIF",
"Extract RGBA",
"View Bit Plane",
"Randomize Colour Palette",
"Extract LSB",
"ELF Info"
]
},
{
"name": "Multimedia",
"ops": [
"Render Image",
"Play Media",
"Generate Image",
"Optical Character Recognition",
"Remove EXIF",
"Extract EXIF",
"Split Colour Channels",
"Rotate Image",
"Resize Image",
"Blur Image",
"Dither Image",
"Invert Image",
"Flip Image",
"Crop Image",
"Image Brightness / Contrast",
"Image Opacity",
"Image Filter",
"Contain Image",
"Cover Image",
"Image Hue/Saturation/Lightness",
"Sharpen Image",
"Normalise Image",
"Convert Image Format",
"Add Text To Image",
"Hex Density chart",
"Scatter chart",
"Series chart",
"Heatmap chart"
]
},
{
"name": "Other",
"ops": [
"Entropy",
"Frequency distribution",
"Index of Coincidence",
"Chi Square",
"P-list Viewer",
"Disassemble x86",
"Pseudo-Random Number Generator",
"Generate De Bruijn Sequence",
"Generate UUID",
"Generate TOTP",
"Generate HOTP",
"Render Image",
"Remove EXIF",
"Extract EXIF",
"Generate QR Code",
"Parse QR Code",
"Haversine distance",
"HTML To Text",
"Generate Lorem Ipsum",
"Numberwang",
"XKCD Random Number",
"XKCD Random Number"
]
},
{
name: "Flow control",
ops: [
"name": "Flow control",
"ops": [
"Magic",
"Fork",
"Subsection",
"Merge",
"Register",
"Label",
@@ -360,7 +523,5 @@ const Categories = [
"Return",
"Comment"
]
},
];
export default Categories;
}
]
File diff suppressed because it is too large. Load diff
-22
View File
@@ -1,22 +0,0 @@
import BSON from "../../operations/BSON.js";
/**
* BSON module.
*
* Libraries:
* - bson
* - buffer
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.BSON = {
"BSON serialise": BSON.runBSONSerialise,
"BSON deserialise": BSON.runBSONDeserialise,
};
export default OpModules;
-21
View File
@@ -1,21 +0,0 @@
import CharEnc from "../../operations/CharEnc.js";
/**
* CharEnc module.
*
* Libraries:
* - cptable
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.CharEnc = {
"Encode text": CharEnc.runEncode,
"Decode text": CharEnc.runDecode,
};
export default OpModules;
-44
View File
@@ -1,44 +0,0 @@
import Cipher from "../../operations/Cipher.js";
/**
* Ciphers module.
*
* Libraries:
* - CryptoJS
* - Blowfish
* - Forge
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Ciphers = {
"AES Encrypt": Cipher.runAesEnc,
"AES Decrypt": Cipher.runAesDec,
"Blowfish Encrypt": Cipher.runBlowfishEnc,
"Blowfish Decrypt": Cipher.runBlowfishDec,
"DES Encrypt": Cipher.runDesEnc,
"DES Decrypt": Cipher.runDesDec,
"Triple DES Encrypt": Cipher.runTripleDesEnc,
"Triple DES Decrypt": Cipher.runTripleDesDec,
"Derive PBKDF2 key": Cipher.runPbkdf2,
"Derive EVP key": Cipher.runEvpkdf,
"RC4": Cipher.runRc4,
"RC4 Drop": Cipher.runRc4drop,
"RC2 Encrypt": Cipher.runRc2Enc,
"RC2 Decrypt": Cipher.runRc2Dec,
"Vigenère Encode": Cipher.runVigenereEnc,
"Vigenère Decode": Cipher.runVigenereDec,
"Bifid Cipher Encode": Cipher.runBifidEnc,
"Bifid Cipher Decode": Cipher.runBifidDec,
"Affine Cipher Encode": Cipher.runAffineEnc,
"Affine Cipher Decode": Cipher.runAffineDec,
"Atbash Cipher": Cipher.runAtbash,
"Substitute": Cipher.runSubstitute,
"Pseudo-Random Number Generator": Cipher.runPRNG,
};
export default OpModules;
-44
View File
@@ -1,44 +0,0 @@
import JS from "../../operations/JS.js";
import Code from "../../operations/Code.js";
/**
* Code module.
*
* Libraries:
* - lodash
* - vkbeautify
* - xmldom
* - xpath
* - jpath
* - highlight.js
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Code = {
"JavaScript Parser": JS.runParse,
"JavaScript Beautify": JS.runBeautify,
"JavaScript Minify": JS.runMinify,
"Syntax highlighter": Code.runSyntaxHighlight,
"Generic Code Beautify": Code.runGenericBeautify,
"JSON Beautify": Code.runJsonBeautify,
"JSON Minify": Code.runJsonMinify,
"XML Beautify": Code.runXmlBeautify,
"XML Minify": Code.runXmlMinify,
"SQL Beautify": Code.runSqlBeautify,
"SQL Minify": Code.runSqlMinify,
"CSS Beautify": Code.runCssBeautify,
"CSS Minify": Code.runCssMinify,
"XPath expression": Code.runXpath,
"CSS selector": Code.runCSSQuery,
"To Snake case": Code.runToSnakeCase,
"To Camel case": Code.runToCamelCase,
"To Kebab case": Code.runToKebabCase,
"JPath expression": Code.runJpath,
};
export default OpModules;
-32
View File
@@ -1,32 +0,0 @@
import Compress from "../../operations/Compress.js";
/**
* Compression module.
*
* Libraries:
* - zlib.js
* - bzip2.js
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Compression = {
"Raw Deflate": Compress.runRawDeflate,
"Raw Inflate": Compress.runRawInflate,
"Zlib Deflate": Compress.runZlibDeflate,
"Zlib Inflate": Compress.runZlibInflate,
"Gzip": Compress.runGzip,
"Gunzip": Compress.runGunzip,
"Zip": Compress.runPkzip,
"Unzip": Compress.runPkunzip,
"Bzip2 Decompress": Compress.runBzip2Decompress,
"Tar": Compress.runTar,
"Untar": Compress.runUntar,
};
export default OpModules;
-201
View File
@@ -1,201 +0,0 @@
import FlowControl from "../../FlowControl.js";
import Arithmetic from "../../operations/Arithmetic.js";
import Base from "../../operations/Base.js";
import Base58 from "../../operations/Base58.js";
import Base64 from "../../operations/Base64.js";
import BCD from "../../operations/BCD.js";
import BitwiseOp from "../../operations/BitwiseOp.js";
import ByteRepr from "../../operations/ByteRepr.js";
import Convert from "../../operations/Convert.js";
import DateTime from "../../operations/DateTime.js";
import Endian from "../../operations/Endian.js";
import Entropy from "../../operations/Entropy.js";
import Filetime from "../../operations/Filetime.js";
import FileType from "../../operations/FileType.js";
import Hexdump from "../../operations/Hexdump.js";
import HTML from "../../operations/HTML.js";
import MAC from "../../operations/MAC.js";
import MorseCode from "../../operations/MorseCode.js";
import MS from "../../operations/MS.js";
import NetBIOS from "../../operations/NetBIOS.js";
import Numberwang from "../../operations/Numberwang.js";
import OS from "../../operations/OS.js";
import OTP from "../../operations/OTP.js";
import PHP from "../../operations/PHP.js";
import QuotedPrintable from "../../operations/QuotedPrintable.js";
import Rotate from "../../operations/Rotate.js";
import SeqUtils from "../../operations/SeqUtils.js";
import StrUtils from "../../operations/StrUtils.js";
import Tidy from "../../operations/Tidy.js";
import ToTable from "../../operations/ToTable.js";
import Unicode from "../../operations/Unicode.js";
import UUID from "../../operations/UUID.js";
import XKCD from "../../operations/XKCD.js";
/**
* Default module.
*
* The Default module is for operations that are expected to be very commonly used or
* do not require any libraries. This module is loaded into the app at compile time.
*
* Libraries:
* - Utils.js
* - otp
* - crypto
* - bignumber.js
* - jsesc
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Default = {
"To Hexdump": Hexdump.runTo,
"From Hexdump": Hexdump.runFrom,
"To Hex": ByteRepr.runToHex,
"From Hex": ByteRepr.runFromHex,
"To Octal": ByteRepr.runToOct,
"From Octal": ByteRepr.runFromOct,
"To Charcode": ByteRepr.runToCharcode,
"From Charcode": ByteRepr.runFromCharcode,
"To Decimal": ByteRepr.runToDecimal,
"From Decimal": ByteRepr.runFromDecimal,
"To Binary": ByteRepr.runToBinary,
"From Binary": ByteRepr.runFromBinary,
"To Hex Content": ByteRepr.runToHexContent,
"From Hex Content": ByteRepr.runFromHexContent,
"To Base64": Base64.runTo,
"From Base64": Base64.runFrom,
"Show Base64 offsets": Base64.runOffsets,
"To Base32": Base64.runTo32,
"From Base32": Base64.runFrom32,
"To Base58": Base58.runTo,
"From Base58": Base58.runFrom,
"To Base": Base.runTo,
"From Base": Base.runFrom,
"To BCD": BCD.runToBCD,
"From BCD": BCD.runFromBCD,
"To HTML Entity": HTML.runToEntity,
"From HTML Entity": HTML.runFromEntity,
"Strip HTML tags": HTML.runStripTags,
"Parse colour code": HTML.runParseColourCode,
"Unescape Unicode Characters": Unicode.runUnescape,
"Escape Unicode Characters": Unicode.runEscape,
"To Quoted Printable": QuotedPrintable.runTo,
"From Quoted Printable": QuotedPrintable.runFrom,
"Swap endianness": Endian.runSwapEndianness,
"ROT13": Rotate.runRot13,
"ROT47": Rotate.runRot47,
"Rotate left": Rotate.runRotl,
"Rotate right": Rotate.runRotr,
"Bit shift left": BitwiseOp.runBitShiftLeft,
"Bit shift right": BitwiseOp.runBitShiftRight,
"XOR": BitwiseOp.runXor,
"XOR Brute Force": BitwiseOp.runXorBrute,
"OR": BitwiseOp.runOr,
"NOT": BitwiseOp.runNot,
"AND": BitwiseOp.runAnd,
"ADD": BitwiseOp.runAdd,
"SUB": BitwiseOp.runSub,
"To Morse Code": MorseCode.runTo,
"From Morse Code": MorseCode.runFrom,
"Format MAC addresses": MAC.runFormat,
"Encode NetBIOS Name": NetBIOS.runEncodeName,
"Decode NetBIOS Name": NetBIOS.runDecodeName,
"Offset checker": StrUtils.runOffsetChecker,
"To Upper case": StrUtils.runUpper,
"To Lower case": StrUtils.runLower,
"Split": StrUtils.runSplit,
"Filter": StrUtils.runFilter,
"Escape string": StrUtils.runEscape,
"Unescape string": StrUtils.runUnescape,
"Head": StrUtils.runHead,
"Tail": StrUtils.runTail,
"Hamming Distance": StrUtils.runHamming,
"Remove whitespace": Tidy.runRemoveWhitespace,
"Remove null bytes": Tidy.runRemoveNulls,
"Drop bytes": Tidy.runDropBytes,
"Take bytes": Tidy.runTakeBytes,
"Pad lines": Tidy.runPad,
"Reverse": SeqUtils.runReverse,
"Sort": SeqUtils.runSort,
"Unique": SeqUtils.runUnique,
"Count occurrences": SeqUtils.runCount,
"Add line numbers": SeqUtils.runAddLineNumbers,
"Remove line numbers": SeqUtils.runRemoveLineNumbers,
"Expand alphabet range": SeqUtils.runExpandAlphRange,
"Convert distance": Convert.runDistance,
"Convert area": Convert.runArea,
"Convert mass": Convert.runMass,
"Convert speed": Convert.runSpeed,
"Convert data units": Convert.runDataSize,
"Parse UNIX file permissions": OS.runParseUnixPerms,
"Parse DateTime": DateTime.runParse,
"Translate DateTime Format": DateTime.runTranslateFormat,
"From UNIX Timestamp": DateTime.runFromUnixTimestamp,
"To UNIX Timestamp": DateTime.runToUnixTimestamp,
"Sleep": DateTime.runSleep,
"Microsoft Script Decoder": MS.runDecodeScript,
"Entropy": Entropy.runEntropy,
"Frequency distribution": Entropy.runFreqDistrib,
"Chi Square": Entropy.runChiSq,
"Detect File Type": FileType.runDetect,
"Scan for Embedded Files": FileType.runScanForEmbeddedFiles,
"Generate UUID": UUID.runGenerateV4,
"Numberwang": Numberwang.run,
"Generate TOTP": OTP.runTOTP,
"Generate HOTP": OTP.runHOTP,
"Fork": FlowControl.runFork,
"Merge": FlowControl.runMerge,
"Register": FlowControl.runRegister,
"Label": FlowControl.runComment,
"Jump": FlowControl.runJump,
"Conditional Jump": FlowControl.runCondJump,
"Return": FlowControl.runReturn,
"Comment": FlowControl.runComment,
"PHP Deserialize": PHP.runDeserialize,
"Sum": Arithmetic.runSum,
"Subtract": Arithmetic.runSub,
"Multiply": Arithmetic.runMulti,
"Divide": Arithmetic.runDiv,
"Mean": Arithmetic.runMean,
"Median": Arithmetic.runMedian,
"Standard Deviation": Arithmetic.runStdDev,
"To Table": ToTable.runToTable,
"Windows Filetime to UNIX Timestamp": Filetime.runFromFiletimeToUnix,
"UNIX Timestamp to Windows Filetime": Filetime.runToFiletimeFromUnix,
"XKCD Random Number": XKCD.runRandomNumber,
/*
Highlighting functions.
This is a temporary solution as highlighting should be entirely
overhauled at some point.
*/
"From Base64-highlight": Base64.highlightFrom,
"From Base64-highlightReverse": Base64.highlightTo,
"To Base64-highlight": Base64.highlightTo,
"To Base64-highlightReverse": Base64.highlightFrom,
"From Hex-highlight": ByteRepr.highlightFrom,
"From Hex-highlightReverse": ByteRepr.highlightTo,
"To Hex-highlight": ByteRepr.highlightTo,
"To Hex-highlightReverse": ByteRepr.highlightFrom,
"From Charcode-highlight": ByteRepr.highlightFrom,
"From Charcode-highlightReverse": ByteRepr.highlightTo,
"To Charcode-highlight": ByteRepr.highlightTo,
"To Charcode-highlightReverse": ByteRepr.highlightFrom,
"From Binary-highlight": ByteRepr.highlightFromBinary,
"From Binary-highlightReverse": ByteRepr.highlightToBinary,
"To Binary-highlight": ByteRepr.highlightToBinary,
"To Binary-highlightReverse": ByteRepr.highlightFromBinary,
"From Hexdump-highlight": Hexdump.highlightFrom,
"From Hexdump-highlightReverse": Hexdump.highlightTo,
"To Hexdump-highlight": Hexdump.highlightTo,
"To Hexdump-highlightReverse": Hexdump.highlightFrom,
};
export default OpModules;
-20
View File
@@ -1,20 +0,0 @@
import Diff from "../../operations/Diff.js";
/**
* Diff module.
*
* Libraries:
* - JsDIff
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Diff = {
"Diff": Diff.runDiff,
};
export default OpModules;
-21
View File
@@ -1,21 +0,0 @@
import Punycode from "../../operations/Punycode.js";
/**
* Encodings module.
*
* Libraries:
* - punycode
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Encodings = {
"To Punycode": Punycode.runToAscii,
"From Punycode": Punycode.runToUnicode,
};
export default OpModules;
-22
View File
@@ -1,22 +0,0 @@
import HTTP from "../../operations/HTTP.js";
/**
* HTTP module.
*
* Libraries:
* - UAS_parser
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.HTTP = {
"HTTP request": HTTP.runHTTPRequest,
"Strip HTTP headers": HTTP.runStripHeaders,
"Parse User Agent": HTTP.runParseUserAgent,
};
export default OpModules;
-56
View File
@@ -1,56 +0,0 @@
import Checksum from "../../operations/Checksum.js";
import Hash from "../../operations/Hash.js";
/**
* Hashing module.
*
* Libraries:
* - CryptoApi
* - node-md6
* - js-sha3
* - ./Checksum.js
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Hashing = {
"Analyse hash": Hash.runAnalyse,
"Generate all hashes": Hash.runAll,
"MD2": Hash.runMD2,
"MD4": Hash.runMD4,
"MD5": Hash.runMD5,
"MD6": Hash.runMD6,
"SHA0": Hash.runSHA0,
"SHA1": Hash.runSHA1,
"SHA2": Hash.runSHA2,
"SHA3": Hash.runSHA3,
"Keccak": Hash.runKeccak,
"Shake": Hash.runShake,
"RIPEMD": Hash.runRIPEMD,
"HAS-160": Hash.runHAS,
"Whirlpool": Hash.runWhirlpool,
"Snefru": Hash.runSnefru,
"CTPH": Hash.runCTPH,
"SSDEEP": Hash.runSSDEEP,
"Compare CTPH hashes": Hash.runCompareCTPH,
"Compare SSDEEP hashes": Hash.runCompareSSDEEP,
"HMAC": Hash.runHMAC,
"Bcrypt": Hash.runBcrypt,
"Bcrypt compare": Hash.runBcryptCompare,
"Bcrypt parse": Hash.runBcryptParse,
"Scrypt": Hash.runScrypt,
"Fletcher-8 Checksum": Checksum.runFletcher8,
"Fletcher-16 Checksum": Checksum.runFletcher16,
"Fletcher-32 Checksum": Checksum.runFletcher32,
"Fletcher-64 Checksum": Checksum.runFletcher64,
"Adler-32 Checksum": Checksum.runAdler32,
"CRC-16 Checksum": Checksum.runCRC16,
"CRC-32 Checksum": Checksum.runCRC32,
"TCP/IP Checksum": Checksum.runTCPIP,
};
export default OpModules;
-25
View File
@@ -1,25 +0,0 @@
import Image from "../../operations/Image.js";
/**
* Image module.
*
* Libraries:
* - exif-parser
* - remove-exif
* - ./FileType.js
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Image = {
"Extract EXIF": Image.runExtractEXIF,
"Remove EXIF": Image.runRemoveEXIF,
"Render Image": Image.runRenderImage,
};
export default OpModules;
-25
View File
@@ -1,25 +0,0 @@
import IP from "../../operations/IP.js";
/**
* JSBN module.
*
* Libraries:
* - jsbn
* - ./Checksum.js
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.JSBN = {
"Parse IP range": IP.runParseIpRange,
"Parse IPv6 address": IP.runParseIPv6,
"Parse IPv4 header": IP.runParseIPv4Header,
"Change IP format": IP.runChangeIpFormat,
"Group IP addresses": IP.runGroupIps,
};
export default OpModules;
-45
View File
@@ -1,45 +0,0 @@
/**
* Imports all modules for builds which do not load modules separately.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
import OpModules from "./Default.js";
import BSONModule from "./BSON.js";
import CharEncModule from "./CharEnc.js";
import CipherModule from "./Ciphers.js";
import CodeModule from "./Code.js";
import CompressionModule from "./Compression.js";
import DiffModule from "./Diff.js";
import EncodingModule from "./Encodings.js";
import HashingModule from "./Hashing.js";
import HTTPModule from "./HTTP.js";
import ImageModule from "./Image.js";
import JSBNModule from "./JSBN.js";
import PublicKeyModule from "./PublicKey.js";
import RegexModule from "./Regex.js";
import ShellcodeModule from "./Shellcode.js";
import URLModule from "./URL.js";
Object.assign(
OpModules,
BSONModule,
CharEncModule,
CipherModule,
CodeModule,
CompressionModule,
DiffModule,
EncodingModule,
HashingModule,
HTTPModule,
ImageModule,
JSBNModule,
PublicKeyModule,
RegexModule,
ShellcodeModule,
URLModule
);
export default OpModules;
-25
View File
@@ -1,25 +0,0 @@
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 Encrypt and Sign": PGP.runSign,
"PGP Decrypt and Verify": PGP.runVerify,
};
export default OpModules;
-25
View File
@@ -1,25 +0,0 @@
import PublicKey from "../../operations/PublicKey.js";
/**
* PublicKey module.
*
* Libraries:
* - jsrsasign
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.PublicKey = {
"Parse X.509 certificate": PublicKey.runParseX509,
"Parse ASN.1 hex string": PublicKey.runParseAsn1HexString,
"PEM to Hex": PublicKey.runPemToHex,
"Hex to PEM": PublicKey.runHexToPem,
"Hex to Object Identifier": PublicKey.runHexToObjectIdentifier,
"Object Identifier to Hex": PublicKey.runObjectIdentifierToHex,
};
export default OpModules;
-30
View File
@@ -1,30 +0,0 @@
import Extract from "../../operations/Extract.js";
import Regex from "../../operations/Regex.js";
/**
* Regex module.
*
* Libraries:
* - XRegExp
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Regex = {
"Regular expression": Regex.runRegex,
"Find / Replace": Regex.runFindReplace,
"Strings": Extract.runStrings,
"Extract IP addresses": Extract.runIp,
"Extract email addresses": Extract.runEmail,
"Extract MAC addresses": Extract.runMac,
"Extract URLs": Extract.runUrls,
"Extract domains": Extract.runDomains,
"Extract file paths": Extract.runFilePaths,
"Extract dates": Extract.runDates,
};
export default OpModules;
-20
View File
@@ -1,20 +0,0 @@
import Shellcode from "../../operations/Shellcode.js";
/**
* Shellcode module.
*
* Libraries:
* - DisassembleX86-64.js
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.Shellcode = {
"Disassemble x86": Shellcode.runDisassemble,
};
export default OpModules;
-23
View File
@@ -1,23 +0,0 @@
import URL_ from "../../operations/URL.js";
/**
* URL module.
*
* Libraries:
* - Utils.js
* - url
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.URL = {
"URL Encode": URL_.runTo,
"URL Decode": URL_.runFrom,
"Parse URI": URL_.runParse,
};
export default OpModules;
+147
View File
@@ -0,0 +1,147 @@
/**
* This script automatically generates OperationConfig.json, containing metadata
* for each operation in the src/core/operations directory.
* It also generates modules in the src/core/config/modules directory to separate
* out operations into logical collections.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/* eslint no-console: ["off"] */
import path from "path";
import fs from "fs";
import process from "process";
import * as Ops from "../../operations/index.mjs";
const dir = path.join(process.cwd() + "/src/core/config/");
if (!fs.existsSync(dir)) {
console.log("\nCWD: " + process.cwd());
console.log("Error: generateConfig.mjs should be run from the project root");
console.log("Example> node --experimental-modules src/core/config/scripts/generateConfig.mjs");
process.exit(1);
}
const operationConfig = {},
modules = {};
/**
* Generate operation config and module lists.
*/
for (const opObj in Ops) {
const op = new Ops[opObj]();
operationConfig[op.name] = {
module: op.module,
description: op.description,
infoURL: op.infoURL,
inputType: op.inputType,
outputType: op.presentType,
flowControl: op.flowControl,
manualBake: op.manualBake,
args: op.args,
checks: op.checks
};
if (!(op.module in modules))
modules[op.module] = {};
modules[op.module][op.name] = opObj;
}
/**
* Write OperationConfig.
*/
fs.writeFileSync(
path.join(dir, "OperationConfig.json"),
JSON.stringify(operationConfig, null, 4)
);
console.log("Written OperationConfig.json");
/**
* Write modules.
*/
if (!fs.existsSync(path.join(dir, "modules/"))) {
fs.mkdirSync(path.join(dir, "modules/"));
}
for (const module in modules) {
let code = `/**
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
* @license Apache-2.0
*/
`;
for (const opName in modules[module]) {
const objName = modules[module][opName];
code += `import ${objName} from "../../operations/${objName}.mjs";\n`;
}
code += `
const OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
OpModules.${module} = {
`;
for (const opName in modules[module]) {
const objName = modules[module][opName];
code += ` "${opName}": ${objName},\n`;
}
code += `};
export default OpModules;
`;
fs.writeFileSync(
path.join(dir, `modules/${module}.mjs`),
code
);
console.log(`Written ${module} module`);
}
/**
* Write OpModules wrapper.
*/
let opModulesCode = `/**
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
*
* Imports all modules for builds which do not load modules separately.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
* @license Apache-2.0
*/
`;
for (const module in modules) {
opModulesCode += `import ${module}Module from "./${module}.mjs";\n`;
}
opModulesCode += `
const OpModules = {};
Object.assign(
OpModules,
`;
for (const module in modules) {
opModulesCode += ` ${module}Module,\n`;
}
opModulesCode += `);
export default OpModules;
`;
fs.writeFileSync(
path.join(dir, "modules/OpModules.mjs"),
opModulesCode
);
console.log("Written OpModules.mjs");
@@ -0,0 +1,60 @@
/**
* This script automatically generates src/core/operations/index.mjs, containing
* imports for all operations in src/core/operations.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/* eslint no-console: ["off"] */
import path from "path";
import fs from "fs";
import process from "process";
const dir = path.join(process.cwd() + "/src/core/config/");
if (!fs.existsSync(dir)) {
console.log("\nCWD: " + process.cwd());
console.log("Error: generateOpsIndex.mjs should be run from the project root");
console.log("Example> node --experimental-modules src/core/config/scripts/generateOpsIndex.mjs");
process.exit(1);
}
// Find all operation files
const opObjs = [];
fs.readdirSync(path.join(dir, "../operations")).forEach(file => {
if (!file.endsWith(".mjs") || file === "index.mjs") return;
opObjs.push(file.split(".mjs")[0]);
});
// Construct index file
let code = `/**
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateOpsIndex.mjs
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
* @license Apache-2.0
*/
`;
opObjs.forEach(obj => {
code += `import ${obj} from "./${obj}.mjs";\n`;
});
code += `
export {
`;
opObjs.forEach(obj => {
code += ` ${obj},\n`;
});
code += "};\n";
// Write file
fs.writeFileSync(
path.join(dir, "../operations/index.mjs"),
code
);
console.log("Written operation index.");
+144
View File
@@ -0,0 +1,144 @@
/**
* This script updates the CHANGELOG when a new minor version is created.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2022
* @license Apache-2.0
*/
/* eslint no-console: ["off"] */
import prompt from "prompt";
import colors from "colors";
import path from "path";
import fs from "fs";
import process from "process";
const dir = path.join(process.cwd() + "/src/core/config/");
if (!fs.existsSync(dir)) {
console.log("\nCWD: " + process.cwd());
console.log("Error: newMinorVersion.mjs should be run from the project root");
console.log("Example> node --experimental-modules src/core/config/scripts/newMinorVersion.mjs");
process.exit(1);
}
let changelogData = fs.readFileSync(path.join(process.cwd(), "CHANGELOG.md"), "utf8");
const lastVersion = changelogData.match(/## Details\s+### \[(\d+)\.(\d+)\.(\d+)\]/);
const newVersion = [
parseInt(lastVersion[1], 10),
parseInt(lastVersion[2], 10) + 1,
0
];
let knownContributors = changelogData.match(/^\[@([^\]]+)\]/gm);
knownContributors = knownContributors.map(c => c.slice(2, -1));
const date = (new Date()).toISOString().split("T")[0];
const schema = {
properties: {
message: {
description: "A short but descriptive summary of a feature in this version",
example: "Added 'Op name' operation",
prompt: "Feature description",
type: "string",
required: true,
},
author: {
description: "The author of the feature (only one supported, edit manually to add more)",
example: "n1474335",
prompt: "Author",
type: "string",
default: "n1474335"
},
id: {
description: "The PR number or full commit hash for this feature.",
example: "1200",
prompt: "Pull request or commit ID",
type: "string"
},
another: {
description: "y/n",
example: "y",
prompt: "Add another feature?",
type: "string",
pattern: /^[yn]$/,
}
}
};
// Build schema
for (const prop in schema.properties) {
const p = schema.properties[prop];
p.description = "\n" + colors.white(p.description) + colors.cyan("\nExample: " + p.example) + "\n" + colors.green(p.prompt);
}
prompt.message = "";
prompt.delimiter = ":".green;
const features = [];
const authors = [];
const prIDs = [];
const commitIDs = [];
prompt.start();
const getFeature = function() {
prompt.get(schema, (err, result) => {
if (err) {
console.log("\nExiting script.");
process.exit(0);
}
features.push(result);
if (result.another === "y") {
getFeature();
} else {
let message = `### [${newVersion[0]}.${newVersion[1]}.${newVersion[2]}] - ${date}\n`;
features.forEach(feature => {
const id = feature.id.length > 10 ? feature.id.slice(0, 7) : "#" + feature.id;
message += `- ${feature.message} [@${feature.author}] | [${id}]\n`;
if (!knownContributors.includes(feature.author)) {
authors.push(`[@${feature.author}]: https://github.com/${feature.author}`);
}
if (feature.id.length > 10) {
commitIDs.push(`[${id}]: https://github.com/gchq/CyberChef/commit/${feature.id}`);
} else {
prIDs.push(`[#${feature.id}]: https://github.com/gchq/CyberChef/pull/${feature.id}`);
}
});
// Message
changelogData = changelogData.replace(/## Details\n\n/, "## Details\n\n" + message + "\n");
// Tag
const newTag = `[${newVersion[0]}.${newVersion[1]}.${newVersion[2]}]: https://github.com/gchq/CyberChef/releases/tag/v${newVersion[0]}.${newVersion[1]}.${newVersion[2]}\n`;
changelogData = changelogData.replace(/\n\n(\[\d+\.\d+\.\d+\]: https)/, "\n\n" + newTag + "$1");
// Author
authors.forEach(author => {
changelogData = changelogData.replace(/(\n\[@[^\]]+\]: https:\/\/github\.com\/[^\n]+\n)\n/, "$1" + author + "\n\n");
});
// Commit IDs
commitIDs.forEach(commitID => {
changelogData = changelogData.replace(/(\n\[[^\].]+\]: https:\/\/github.com\/gchq\/CyberChef\/commit\/[^\n]+\n)\n/, "$1" + commitID + "\n\n");
});
// PR IDs
prIDs.forEach(prID => {
changelogData = changelogData.replace(/(\n\[#[^\]]+\]: https:\/\/github.com\/gchq\/CyberChef\/pull\/[^\n]+\n)\n*$/, "$1" + prID + "\n\n");
});
fs.writeFileSync(path.join(process.cwd(), "CHANGELOG.md"), changelogData);
console.log("Written CHANGELOG.md\nCommit changes and then run `npm version minor`.");
}
});
};
getFeature();
+230
View File
@@ -0,0 +1,230 @@
/**
* Interactive script for generating a new operation template.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/* eslint no-console: ["off"] */
import prompt from "prompt";
import colors from "colors";
import process from "process";
import fs from "fs";
import path from "path";
import EscapeString from "../../operations/EscapeString.mjs";
const dir = path.join(process.cwd() + "/src/core/operations/");
if (!fs.existsSync(dir)) {
console.log("\nCWD: " + process.cwd());
console.log("Error: newOperation.mjs should be run from the project root");
console.log("Example> node --experimental-modules src/core/config/scripts/newOperation.mjs");
process.exit(1);
}
const ioTypes = ["string", "byteArray", "number", "html", "ArrayBuffer", "BigNumber", "JSON", "File", "List<File>"];
const schema = {
properties: {
opName: {
description: "The operation name should be short but descriptive.",
example: "URL Decode",
prompt: "Operation name",
type: "string",
pattern: /^[\w\s-/().]+$/,
required: true,
message: "Operation names should consist of letters, numbers or the following symbols: _-/()."
},
module: {
description: `Modules are used to group operations that rely on large libraries. Any operation that is not in the Default module will be loaded in dynamically when it is first called. All operations in the same module will also be loaded at this time. This system prevents the CyberChef web app from getting too bloated and taking a long time to load initially.
If your operation does not rely on a library, just leave this blank and it will be added to the Default module. If it relies on the same library as other operations, enter the name of the module those operations are in. If it relies on a new large library, enter a new module name (capitalise the first letter).`,
example: "Crypto",
prompt: "Module",
type: "string",
pattern: /^[A-Z][A-Za-z\d]+$/,
message: "Module names should start with a capital letter and not contain any spaces or symbols.",
default: "Default"
},
description: {
description: "The description should explain what the operation is and how it works. It can describe how the arguments should be entered and give examples of expected input and output. HTML markup is supported. Use <code> tags for examples. The description is scanned during searches, so include terms that are likely to be searched for when someone is looking for your operation.",
example: "Converts URI/URL percent-encoded characters back to their raw values.<br><br>e.g. <code>%3d</code> becomes <code>=</code>",
prompt: "Description",
type: "string"
},
infoURL: {
description: "An optional URL for an external site can be added to give more information about the operation. Wikipedia links are often suitable. If linking to Wikipedia, use an international link (e.g. https://wikipedia.org/...) rather than a localised link (e.g. https://en.wikipedia.org/...).",
example: "https://wikipedia.org/wiki/Percent-encoding",
prompt: "Information URL",
type: "string",
},
inputType: {
description: `The input type defines how the input data will be presented to your operation. Check the project wiki for a full description of each type. The options are: ${ioTypes.join(", ")}.`,
example: "string",
prompt: "Input type",
type: "string",
pattern: new RegExp(`^(${ioTypes.join("|")})$`),
required: true,
message: `The input type should be one of: ${ioTypes.join(", ")}.`
},
outputType: {
description: `The output type tells CyberChef what sort of data you are returning from your operation. Check the project wiki for a full description of each type. The options are: ${ioTypes.join(", ")}.`,
example: "string",
prompt: "Output type",
type: "string",
pattern: new RegExp(`^(${ioTypes.join("|")})$`),
required: true,
message: `The output type should be one of: ${ioTypes.join(", ")}.`
},
highlight: {
description: "If your operation does not change the length of the input in any way, we can enable highlighting. If it does change the length in a predictable way, we may still be able to enable highlighting and calculate the correct offsets. If this is not possible, we will disable highlighting for this operation.",
example: "true/false",
prompt: "Enable highlighting",
type: "boolean",
default: "false",
message: "Enter true or false to specify if highlighting should be enabled."
},
authorName: {
description: "Your name or username will be added to the @author tag for this operation.",
example: "n1474335",
prompt: "Username",
type: "string"
},
authorEmail: {
description: "Your email address will also be added to the @author tag for this operation.",
example: "n1474335@gmail.com",
prompt: "Email",
type: "string"
}
}
};
// Build schema
for (const prop in schema.properties) {
const p = schema.properties[prop];
p.description = "\n" + colors.white(p.description) + colors.cyan("\nExample: " + p.example) + "\n" + colors.green(p.prompt);
}
console.log("\n\nThis script will generate a new operation template based on the information you provide. These values can be changed manually later.".yellow);
prompt.message = "";
prompt.delimiter = ":".green;
prompt.start();
prompt.get(schema, (err, result) => {
if (err) {
console.log("\nExiting build script.");
process.exit(0);
}
const moduleName = result.opName.replace(/\w\S*/g, txt => {
return txt.charAt(0).toUpperCase() + txt.substr(1);
}).replace(/[\s-()./]/g, "");
const template = `/**
* @author ${result.authorName} [${result.authorEmail}]
* @copyright Crown Copyright ${(new Date()).getFullYear()}
* @license Apache-2.0
*/
import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs";
/**
* ${result.opName} operation
*/
class ${moduleName} extends Operation {
/**
* ${moduleName} constructor
*/
constructor() {
super();
this.name = "${result.opName}";
this.module = "${result.module}";
this.description = "${(new EscapeString).run(result.description, ["Special chars", "Double"])}";
this.infoURL = "${result.infoURL}";
this.inputType = "${result.inputType}";
this.outputType = "${result.outputType}";
this.args = [
/* Example arguments. See the project wiki for full details.
{
name: "First arg",
type: "string",
value: "Don't Panic"
},
{
name: "Second arg",
type: "number",
value: 42
}
*/
];
}
/**
* @param {${result.inputType}} input
* @param {Object[]} args
* @returns {${result.outputType}}
*/
run(input, args) {
// const [firstArg, secondArg] = args;
throw new OperationError("Test");
}
${result.highlight ? `
/**
* Highlight ${result.opName}
*
* @param {Object[]} pos
* @param {number} pos[].start
* @param {number} pos[].end
* @param {Object[]} args
* @returns {Object[]} pos
*/
highlight(pos, args) {
return pos;
}
/**
* Highlight ${result.opName} in reverse
*
* @param {Object[]} pos
* @param {number} pos[].start
* @param {number} pos[].end
* @param {Object[]} args
* @returns {Object[]} pos
*/
highlightReverse(pos, args) {
return pos;
}
` : ""}
}
export default ${moduleName};
`;
// console.log(template);
const filename = path.join(dir, `./${moduleName}.mjs`);
if (fs.existsSync(filename)) {
console.log(`${filename} already exists. It has NOT been overwritten.`.red);
console.log("Choose a different operation name to avoid conflicts.");
process.exit(0);
}
fs.writeFileSync(filename, template);
console.log(`\nOperation template written to ${colors.green(filename)}`);
console.log(`\nNext steps:
1. Add your operation to ${colors.green("src/core/config/Categories.json")}
2. Write your operation code.
3. Write tests in ${colors.green("tests/operations/tests/")}
4. Run ${colors.cyan("npm run lint")} and ${colors.cyan("npm run test")}
5. Submit a Pull Request to get your operation added to the official CyberChef repository.`);
});
+38
View File
@@ -0,0 +1,38 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishType from "./DishType.mjs";
import Utils from "../Utils.mjs";
import BigNumber from "bignumber.js";
/**
* translation methods for BigNumber Dishes
*/
class DishBigNumber extends DishType {
/**
* convert the given value to a ArrayBuffer
* @param {BigNumber} value
*/
static toArrayBuffer() {
DishBigNumber.checkForValue(this.value);
this.value = BigNumber.isBigNumber(this.value) ? Utils.strToArrayBuffer(this.value.toFixed()) : new ArrayBuffer;
}
/**
* convert the given value from a ArrayBuffer
*/
static fromArrayBuffer() {
DishBigNumber.checkForValue(this.value);
try {
this.value = new BigNumber(Utils.arrayBufferToStr(this.value));
} catch (err) {
this.value = new BigNumber(NaN);
}
}
}
export default DishBigNumber;
+31
View File
@@ -0,0 +1,31 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishType from "./DishType.mjs";
/**
* Translation methods for ArrayBuffer Dishes
*/
class DishByteArray extends DishType {
/**
* convert the given value to a ArrayBuffer
*/
static toArrayBuffer() {
DishByteArray.checkForValue(this.value);
this.value = new Uint8Array(this.value).buffer;
}
/**
* convert the given value from a ArrayBuffer
*/
static fromArrayBuffer() {
DishByteArray.checkForValue(this.value);
this.value = Array.prototype.slice.call(new Uint8Array(this.value));
}
}
export default DishByteArray;
+42
View File
@@ -0,0 +1,42 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishType from "./DishType.mjs";
import Utils, { isNodeEnvironment } from "../Utils.mjs";
/**
* Translation methods for file Dishes
*/
class DishFile extends DishType {
/**
* convert the given value to an ArrayBuffer
* @param {File} value
*/
static toArrayBuffer() {
DishFile.checkForValue(this.value);
if (isNodeEnvironment()) {
this.value = Utils.readFileSync(this.value);
} else {
return new Promise((resolve, reject) => {
Utils.readFile(this.value)
.then(v => this.value = v.buffer)
.then(resolve)
.catch(reject);
});
}
}
/**
* convert the given value from an ArrayBuffer
*/
static fromArrayBuffer() {
DishFile.checkForValue(this.value);
this.value = new File(this.value, "unknown");
}
}
export default DishFile;
+26
View File
@@ -0,0 +1,26 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishString from "./DishString.mjs";
import Utils from "../Utils.mjs";
/**
* Translation methods for HTML Dishes
*/
class DishHTML extends DishString {
/**
* convert the given value to a ArrayBuffer
* @param {String} value
*/
static toArrayBuffer() {
DishHTML.checkForValue(this.value);
this.value = this.value ? Utils.strToArrayBuffer(Utils.unescapeHtml(Utils.stripHtmlTags(this.value, true))) : new ArrayBuffer;
}
}
export default DishHTML;
+32
View File
@@ -0,0 +1,32 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishType from "./DishType.mjs";
import Utils from "../Utils.mjs";
/**
* Translation methods for JSON dishes
*/
class DishJSON extends DishType {
/**
* convert the given value to a ArrayBuffer
*/
static toArrayBuffer() {
DishJSON.checkForValue(this.value);
this.value = this.value !== undefined ? Utils.strToArrayBuffer(JSON.stringify(this.value, null, 4)) : new ArrayBuffer;
}
/**
* convert the given value from a ArrayBuffer
*/
static fromArrayBuffer() {
DishJSON.checkForValue(this.value);
this.value = JSON.parse(Utils.arrayBufferToStr(this.value));
}
}
export default DishJSON;
+80
View File
@@ -0,0 +1,80 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishType from "./DishType.mjs";
import Utils, { isNodeEnvironment } from "../Utils.mjs";
/**
* Translation methods for ListFile Dishes
*/
class DishListFile extends DishType {
/**
* convert the given value to a ArrayBuffer
*/
static async toArrayBuffer() {
DishListFile.checkForValue(this.value);
if (isNodeEnvironment()) {
this.value = this.value.map(file => Uint8Array.from(file.data));
} else {
this.value = await DishListFile.concatenateTypedArraysWithTypedElements(...this.value);
}
}
/**
* convert the given value from a ArrayBuffer
*/
static fromArrayBuffer() {
DishListFile.checkForValue(this.value);
this.value = [new File(this.value, "unknown")];
}
/**
* Concatenates a list of typed elements together.
*
* @param {Uint8Array[]} arrays
* @returns {Uint8Array}
*/
static async concatenateTypedArraysWithTypedElements(...arrays) {
let totalLength = 0;
for (const arr of arrays) {
totalLength += arr.size;
}
const myArray = new Uint8Array(totalLength);
let offset = 0;
for (const arr of arrays) {
const data = await Utils.readFile(arr);
myArray.set(data, offset);
offset += data.length;
}
return myArray;
}
/**
* Concatenates a list of Uint8Arrays together
*
* @param {Uint8Array[]} arrays
* @returns {Uint8Array}
*/
static concatenateTypedArrays(...arrays) {
let totalLength = 0;
for (const arr of arrays) {
totalLength += arr.length;
}
const result = new Uint8Array(totalLength);
let offset = 0;
for (const arr of arrays) {
result.set(arr, offset);
offset += arr.length;
}
return result;
}
}
export default DishListFile;
+33
View File
@@ -0,0 +1,33 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishType from "./DishType.mjs";
import Utils from "../Utils.mjs";
/**
* Translation methods for number dishes
*/
class DishNumber extends DishType {
/**
* convert the given value to a ArrayBuffer
*/
static toArrayBuffer() {
DishNumber.checkForValue(this.value);
this.value = typeof this.value === "number" ? Utils.strToArrayBuffer(this.value.toString()) : new ArrayBuffer;
}
/**
* convert the given value from a ArrayBuffer
*/
static fromArrayBuffer() {
DishNumber.checkForValue(this.value);
this.value = this.value ? parseFloat(Utils.arrayBufferToStr(this.value)) : 0;
}
}
export default DishNumber;
+33
View File
@@ -0,0 +1,33 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishType from "./DishType.mjs";
import Utils from "../Utils.mjs";
/**
* Translation methods for string dishes
*/
class DishString extends DishType {
/**
* convert the given value to a ArrayBuffer
*/
static toArrayBuffer() {
DishString.checkForValue(this.value);
this.value = this.value ? Utils.strToArrayBuffer(this.value) : new ArrayBuffer;
}
/**
* convert the given value from a ArrayBuffer
*/
static fromArrayBuffer() {
DishString.checkForValue(this.value);
this.value = this.value ? Utils.arrayBufferToStr(this.value) : "";
}
}
export default DishString;
+38
View File
@@ -0,0 +1,38 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
/**
* Abstract class for dish translation methods
*/
class DishType {
/**
* Warn translations dont work without value from bind
*/
static checkForValue(value) {
if (value === undefined) {
throw new Error("only use translation methods with .bind");
}
}
/**
* convert the given value to a ArrayBuffer
* @param {*} value
*/
static toArrayBuffer() {
throw new Error("toArrayBuffer has not been implemented");
}
/**
* convert the given value from a ArrayBuffer
*/
static fromArrayBuffer() {
throw new Error("fromArrayBuffer has not been implemented");
}
}
export default DishType;
+26
View File
@@ -0,0 +1,26 @@
/**
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import DishByteArray from "./DishByteArray.mjs";
import DishBigNumber from "./DishBigNumber.mjs";
import DishFile from "./DishFile.mjs";
import DishHTML from "./DishHTML.mjs";
import DishJSON from "./DishJSON.mjs";
import DishListFile from "./DishListFile.mjs";
import DishNumber from "./DishNumber.mjs";
import DishString from "./DishString.mjs";
export {
DishByteArray,
DishBigNumber,
DishFile,
DishHTML,
DishJSON,
DishListFile,
DishNumber,
DishString,
};
+26
View File
@@ -0,0 +1,26 @@
/**
* Custom error type for handling Dish type errors.
* i.e. where the Dish cannot be successfully translated between types
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
class DishError extends Error {
/**
* Standard error constructor. Adds no new behaviour.
*
* @param args - Standard error args
*/
constructor(...args) {
super(...args);
this.type = "DishError";
if (Error.captureStackTrace) {
Error.captureStackTrace(this, DishError);
}
}
}
export default DishError;
@@ -0,0 +1,25 @@
/**
* Custom error type for handling operation that isnt included in node.js API
*
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
class ExcludedOperationError extends Error {
/**
* Standard error constructor. Adds no new behaviour.
*
* @param args - Standard error args
*/
constructor(...args) {
super(...args);
this.type = "ExcludedOperationError";
if (Error.captureStackTrace) {
Error.captureStackTrace(this, ExcludedOperationError);
}
}
}
export default ExcludedOperationError;
+26
View File
@@ -0,0 +1,26 @@
/**
* Custom error type for handling operation input errors.
* i.e. where the operation can handle the error and print a message to the screen.
*
* @author d98762625 [d98762625@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
class OperationError extends Error {
/**
* Standard error constructor. Adds no new behaviour.
*
* @param args - Standard error args
*/
constructor(...args) {
super(...args);
this.type = "OperationError";
if (Error.captureStackTrace) {
Error.captureStackTrace(this, OperationError);
}
}
}
export default OperationError;
+9
View File
@@ -0,0 +1,9 @@
import OperationError from "./OperationError.mjs";
import DishError from "./DishError.mjs";
import ExcludedOperationError from "./ExcludedOperationError.mjs";
export {
OperationError,
DishError,
ExcludedOperationError,
};
+139
View File
@@ -0,0 +1,139 @@
/**
* @author bwhitn [brian.m.whitney@outlook.com]
* @author d98762625 [d98762625@gmailcom]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
import Utils from "../Utils.mjs";
import BigNumber from "bignumber.js";
/**
* Converts a string array to a number array.
*
* @param {string[]} input
* @param {string} delim
* @returns {BigNumber[]}
*/
export function createNumArray(input, delim) {
delim = Utils.charRep(delim || "Space");
const splitNumbers = input.split(delim);
const numbers = [];
let num;
splitNumbers.map((number) => {
try {
num = BigNumber(number.trim());
if (!num.isNaN()) {
numbers.push(num);
}
} catch (err) {
// This line is not a valid number
}
});
return numbers;
}
/**
* Adds an array of numbers and returns the value.
*
* @param {BigNumber[]} data
* @returns {BigNumber}
*/
export function sum(data) {
if (data.length > 0) {
return data.reduce((acc, curr) => acc.plus(curr));
}
}
/**
* Subtracts an array of numbers and returns the value.
*
* @param {BigNumber[]} data
* @returns {BigNumber}
*/
export function sub(data) {
if (data.length > 0) {
return data.reduce((acc, curr) => acc.minus(curr));
}
}
/**
* Multiplies an array of numbers and returns the value.
*
* @param {BigNumber[]} data
* @returns {BigNumber}
*/
export function multi(data) {
if (data.length > 0) {
return data.reduce((acc, curr) => acc.times(curr));
}
}
/**
* Divides an array of numbers and returns the value.
*
* @param {BigNumber[]} data
* @returns {BigNumber}
*/
export function div(data) {
if (data.length > 0) {
return data.reduce((acc, curr) => acc.div(curr));
}
}
/**
* Computes mean of a number array and returns the value.
*
* @param {BigNumber[]} data
* @returns {BigNumber}
*/
export function mean(data) {
if (data.length > 0) {
return sum(data).div(data.length);
}
}
/**
* Computes median of a number array and returns the value.
*
* @param {BigNumber[]} data
* @returns {BigNumber}
*/
export function median(data) {
if ((data.length % 2) === 0 && data.length > 0) {
data.sort(function(a, b) {
return a.minus(b);
});
const first = data[Math.floor(data.length / 2)];
const second = data[Math.floor(data.length / 2) - 1];
return mean([first, second]);
} else {
return data[Math.floor(data.length / 2)];
}
}
/**
* Computes standard deviation of a number array and returns the value.
*
* @param {BigNumber[]} data
* @returns {BigNumber}
*/
export function stdDev(data) {
if (data.length > 0) {
const avg = mean(data);
let devSum = new BigNumber(0);
data.map((datum) => {
devSum = devSum.plus(datum.minus(avg).pow(2));
});
return devSum.div(data.length).sqrt();
}
}
+48
View File
@@ -0,0 +1,48 @@
/**
* Binary Code Decimal resources.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
/**
* BCD encoding schemes.
*/
export const ENCODING_SCHEME = [
"8 4 2 1",
"7 4 2 1",
"4 2 2 1",
"2 4 2 1",
"8 4 -2 -1",
"Excess-3",
"IBM 8 4 2 1",
];
/**
* Lookup table for the binary value of each digit representation.
*
* I wrote a very nice algorithm to generate 8 4 2 1 encoding programmatically,
* but unfortunately it's much easier (if less elegant) to use lookup tables
* when supporting multiple encoding schemes.
*
* "Practicality beats purity" - PEP 20
*
* In some schemes it is possible to represent the same value in multiple ways.
* For instance, in 4 2 2 1 encoding, 0100 and 0010 both represent 2. Support
* has not yet been added for this.
*/
export const ENCODING_LOOKUP = {
"8 4 2 1": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
"7 4 2 1": [0, 1, 2, 3, 4, 5, 6, 8, 9, 10],
"4 2 2 1": [0, 1, 4, 5, 8, 9, 12, 13, 14, 15],
"2 4 2 1": [0, 1, 2, 3, 4, 11, 12, 13, 14, 15],
"8 4 -2 -1": [0, 7, 6, 5, 4, 11, 10, 9, 8, 15],
"Excess-3": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
"IBM 8 4 2 1": [10, 1, 2, 3, 4, 5, 6, 7, 8, 9],
};
/**
* BCD formats.
*/
export const FORMAT = ["Nibbles", "Bytes", "Raw"];
+66
View File
@@ -0,0 +1,66 @@
/**
* Bacon Cipher resources.
*
* @author Karsten Silkenbäumer [github.com/kassi]
* @copyright Karsten Silkenbäumer 2019
* @license Apache-2.0
*/
/**
* Bacon definitions.
*/
export const BACON_ALPHABETS = {
"Standard (I=J and U=V)": {
alphabet: "ABCDEFGHIKLMNOPQRSTUWXYZ",
codes: [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23]
},
"Complete": {
alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}
};
export const BACON_TRANSLATION_01 = "0/1";
export const BACON_TRANSLATION_AB = "A/B";
export const BACON_TRANSLATION_CASE = "Case";
export const BACON_TRANSLATION_AMNZ = "A-M/N-Z first letter";
export const BACON_TRANSLATIONS = [
BACON_TRANSLATION_01,
BACON_TRANSLATION_AB,
BACON_TRANSLATION_CASE,
BACON_TRANSLATION_AMNZ,
];
export const BACON_TRANSLATIONS_FOR_ENCODING = [
BACON_TRANSLATION_01,
BACON_TRANSLATION_AB
];
export const BACON_CLEARER_MAP = {
[BACON_TRANSLATION_01]: /[^01]/g,
[BACON_TRANSLATION_AB]: /[^ABab]/g,
[BACON_TRANSLATION_CASE]: /[^A-Za-z]/g,
};
export const BACON_NORMALIZE_MAP = {
[BACON_TRANSLATION_AB]: {
"A": "0",
"B": "1",
"a": "0",
"b": "1"
},
};
/**
* Swaps zeros to ones and ones to zeros.
*
* @param {string} data
* @returns {string}
*
* @example
* // returns "11001 01010"
* swapZeroAndOne("00110 10101");
*/
export function swapZeroAndOne(string) {
return string.replace(/[01]/g, function (c) {
return {
"0": "1",
"1": "0"
}[c];
});
}
+27
View File
@@ -0,0 +1,27 @@
/**
* Base45 resources.
*
* @author Thomas Weißschuh [thomas@t-8ch.de]
* @copyright Crown Copyright 2021
* @license Apache-2.0
*/
/**
* Highlight to Base45
*/
export function highlightToBase45(pos, args) {
pos[0].start = Math.floor(pos[0].start / 2) * 3;
pos[0].end = Math.ceil(pos[0].end / 2) * 3;
return pos;
}
/**
* Highlight from Base45
*/
export function highlightFromBase45(pos, args) {
pos[0].start = Math.floor(pos[0].start / 3) * 2;
pos[0].end = Math.ceil(pos[0].end / 3) * 2;
return pos;
}
export const ALPHABET = "0-9A-Z $%*+\\-./:";
+22
View File
@@ -0,0 +1,22 @@
/**
* Base58 resources.
*
* @author tlwr [toby@toby.codes]
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2017
* @license Apache-2.0
*/
/**
* Base58 alphabet options.
*/
export const ALPHABET_OPTIONS = [
{
name: "Bitcoin",
value: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",
},
{
name: "Ripple",
value: "rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz",
},
];
+183
View File
@@ -0,0 +1,183 @@
/**
* Base64 functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import Utils from "../Utils.mjs";
import OperationError from "../errors/OperationError.mjs";
/**
* Base64's the input byte array using the given alphabet, returning a string.
*
* @param {byteArray|Uint8Array|ArrayBuffer|string} data
* @param {string} [alphabet="A-Za-z0-9+/="]
* @returns {string}
*
* @example
* // returns "SGVsbG8="
* toBase64([72, 101, 108, 108, 111]);
*
* // returns "SGVsbG8="
* toBase64("Hello");
*/
export function toBase64(data, alphabet="A-Za-z0-9+/=") {
if (!data) return "";
if (typeof data == "string") {
data = Utils.strToArrayBuffer(data);
}
if (data instanceof ArrayBuffer) {
data = new Uint8Array(data);
}
alphabet = Utils.expandAlphRange(alphabet).join("");
if (alphabet.length !== 64 && alphabet.length !== 65) { // Allow for padding
throw new OperationError(`Invalid Base64 alphabet length (${alphabet.length}): ${alphabet}`);
}
let output = "",
chr1, chr2, chr3,
enc1, enc2, enc3, enc4,
i = 0;
while (i < data.length) {
chr1 = data[i++];
chr2 = data[i++];
chr3 = data[i++];
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output += alphabet.charAt(enc1) + alphabet.charAt(enc2) +
alphabet.charAt(enc3) + alphabet.charAt(enc4);
}
return output;
}
/**
* UnBase64's the input string using the given alphabet, returning a byte array.
*
* @param {string} data
* @param {string} [alphabet="A-Za-z0-9+/="]
* @param {string} [returnType="string"] - Either "string" or "byteArray"
* @param {boolean} [removeNonAlphChars=true]
* @returns {byteArray}
*
* @example
* // returns "Hello"
* fromBase64("SGVsbG8=");
*
* // returns [72, 101, 108, 108, 111]
* fromBase64("SGVsbG8=", null, "byteArray");
*/
export function fromBase64(data, alphabet="A-Za-z0-9+/=", returnType="string", removeNonAlphChars=true, strictMode=false) {
if (!data) {
return returnType === "string" ? "" : [];
}
alphabet = alphabet || "A-Za-z0-9+/=";
alphabet = Utils.expandAlphRange(alphabet).join("");
// Confirm alphabet is a valid length
if (alphabet.length !== 64 && alphabet.length !== 65) { // Allow for padding
throw new OperationError(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${alphabet.length}: ${alphabet}`);
}
// Remove non-alphabet characters
if (removeNonAlphChars) {
const re = new RegExp("[^" + alphabet.replace(/[[\]\\\-^$]/g, "\\$&") + "]", "g");
data = data.replace(re, "");
}
if (strictMode) {
// Check for incorrect lengths (even without padding)
if (data.length % 4 === 1) {
throw new OperationError(`Error: Invalid Base64 input length (${data.length}). Cannot be 4n+1, even without padding chars.`);
}
if (alphabet.length === 65) { // Padding character included
const pad = alphabet.charAt(64);
const padPos = data.indexOf(pad);
if (padPos >= 0) {
// Check that the padding character is only used at the end and maximum of twice
if (padPos < data.length - 2 || data.charAt(data.length - 1) !== pad) {
throw new OperationError(`Error: Base64 padding character (${pad}) not used in the correct place.`);
}
// Check that input is padded to the correct length
if (data.length % 4 !== 0) {
throw new OperationError("Error: Base64 not padded to a multiple of 4.");
}
}
}
}
const output = [];
let chr1, chr2, chr3,
enc1, enc2, enc3, enc4,
i = 0;
while (i < data.length) {
// Including `|| null` forces empty strings to null so that indexOf returns -1 instead of 0
enc1 = alphabet.indexOf(data.charAt(i++) || null);
enc2 = alphabet.indexOf(data.charAt(i++) || null);
enc3 = alphabet.indexOf(data.charAt(i++) || null);
enc4 = alphabet.indexOf(data.charAt(i++) || null);
if (strictMode && (enc1 < 0 || enc2 < 0 || enc3 < 0 || enc4 < 0)) {
throw new OperationError("Error: Base64 input contains non-alphabet char(s)");
}
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
if (chr1 >= 0 && chr1 < 256) {
output.push(chr1);
}
if (chr2 >= 0 && chr2 < 256 && enc3 !== 64) {
output.push(chr2);
}
if (chr3 >= 0 && chr3 < 256 && enc4 !== 64) {
output.push(chr3);
}
}
return returnType === "string" ? Utils.byteArrayToUtf8(output) : output;
}
/**
* Base64 alphabets.
*/
export const ALPHABET_OPTIONS = [
{name: "Standard (RFC 4648): A-Za-z0-9+/=", value: "A-Za-z0-9+/="},
{name: "URL safe (RFC 4648 \u00A75): A-Za-z0-9-_", value: "A-Za-z0-9-_"},
{name: "Filename safe: A-Za-z0-9+-=", value: "A-Za-z0-9+\\-="},
{name: "itoa64: ./0-9A-Za-z=", value: "./0-9A-Za-z="},
{name: "XML: A-Za-z0-9_.", value: "A-Za-z0-9_."},
{name: "y64: A-Za-z0-9._-", value: "A-Za-z0-9._-"},
{name: "z64: 0-9a-zA-Z+/=", value: "0-9a-zA-Z+/="},
{name: "Radix-64 (RFC 4880): 0-9A-Za-z+/=", value: "0-9A-Za-z+/="},
{name: "Uuencoding: [space]-_", value: " -_"},
{name: "Xxencoding: +-0-9A-Za-z", value: "+\\-0-9A-Za-z"},
{name: "BinHex: !-,-0-689@A-NP-VX-Z[`a-fh-mp-r", value: "!-,-0-689@A-NP-VX-Z[`a-fh-mp-r"},
{name: "ROT13: N-ZA-Mn-za-m0-9+/=", value: "N-ZA-Mn-za-m0-9+/="},
{name: "UNIX crypt: ./0-9A-Za-z", value: "./0-9A-Za-z"},
{name: "Atom128: /128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC", value: "/128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC"},
{name: "Megan35: 3GHIJKLMNOPQRSTUb=cdefghijklmnopWXYZ/12+406789VaqrstuvwxyzABCDEF5", value: "3GHIJKLMNOPQRSTUb=cdefghijklmnopWXYZ/12+406789VaqrstuvwxyzABCDEF5"},
{name: "Zong22: ZKj9n+yf0wDVX1s/5YbdxSo=ILaUpPBCHg8uvNO4klm6iJGhQ7eFrWczAMEq3RTt2", value: "ZKj9n+yf0wDVX1s/5YbdxSo=ILaUpPBCHg8uvNO4klm6iJGhQ7eFrWczAMEq3RTt2"},
{name: "Hazz15: HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5", value: "HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5"}
];
+46
View File
@@ -0,0 +1,46 @@
import Utils from "../Utils.mjs";
/**
* Base85 resources.
*
* @author PenguinGeorge [george@penguingeorge.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/**
* Base85 alphabet options.
*/
export const ALPHABET_OPTIONS = [
{
name: "Standard",
value: "!-u",
},
{
name: "Z85 (ZeroMQ)",
value: "0-9a-zA-Z.\\-:+=^!/*?&<>()[]{}@%$#",
},
{
name: "IPv6",
value: "0-9A-Za-z!#$%&()*+\\-;<=>?@^_`{|}~",
}
];
/**
* Returns the name of the alphabet, when given the alphabet.
*
* @param {string} alphabet
* @returns {string}
*/
export function alphabetName(alphabet) {
alphabet = escape(alphabet);
let name;
ALPHABET_OPTIONS.forEach(function(a) {
const expanded = Utils.expandAlphRange(a.value).join("");
if (alphabet === escape(expanded)) name = a.name;
});
return name;
}
+80
View File
@@ -0,0 +1,80 @@
/**
* Binary functions.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
import Utils from "../Utils.mjs";
import OperationError from "../errors/OperationError.mjs";
/**
* Convert a byte array into a binary string.
*
* @param {Uint8Array|byteArray|number} data
* @param {string} [delim="Space"]
* @param {number} [padding=8]
* @returns {string}
*
* @example
* // returns "00001010 00010100 00011110"
* toBinary([10,20,30]);
*
* // returns "00001010:00010100:00011110"
* toBinary([10,20,30], "Colon");
*
* // returns "1010:10100:11110"
* toBinary([10,20,30], "Colon", 0);
*/
export function toBinary(data, delim="Space", padding=8) {
if (data === undefined || data === null)
throw new OperationError("Unable to convert to binary: Empty input data enocuntered");
delim = Utils.charRep(delim);
let output = "";
if (data.length) { // array
for (let i = 0; i < data.length; i++) {
output += data[i].toString(2).padStart(padding, "0");
if (i !== data.length - 1) output += delim;
}
} else if (typeof data === "number") { // Single value
return data.toString(2).padStart(padding, "0");
} else {
return "";
}
return output;
}
/**
* Convert a binary string into a byte array.
*
* @param {string} data
* @param {string} [delim]
* @param {number} [byteLen=8]
* @returns {byteArray}
*
* @example
* // returns [10,20,30]
* fromBinary("00001010 00010100 00011110");
*
* // returns [10,20,30]
* fromBinary("00001010:00010100:00011110", "Colon");
*/
export function fromBinary(data, delim="Space", byteLen=8) {
if (byteLen < 1 || Math.round(byteLen) !== byteLen)
throw new OperationError("Byte length must be a positive integer");
const delimRegex = Utils.regexRep(delim);
data = data.replace(delimRegex, "");
const output = [];
for (let i = 0; i < data.length; i += byteLen) {
output.push(parseInt(data.substr(i, byteLen), 2));
}
return output;
}
+124
View File
@@ -0,0 +1,124 @@
/**
* Bitwise operation resources.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/**
* Runs bitwise operations across the input data.
*
* @param {byteArray|Uint8Array} input
* @param {byteArray} key
* @param {function} func - The bitwise calculation to carry out
* @param {boolean} nullPreserving
* @param {string} scheme
* @returns {byteArray}
*/
export function bitOp (input, key, func, nullPreserving, scheme) {
if (!key || !key.length) key = [0];
const result = [];
let x = null,
k = null,
o = null;
for (let i = 0; i < input.length; i++) {
k = key[i % key.length];
if (scheme === "Cascade") k = input[i + 1] || 0;
o = input[i];
x = nullPreserving && (o === 0 || o === k) ? o : func(o, k);
result.push(x);
if (scheme &&
scheme !== "Standard" &&
!(nullPreserving && (o === 0 || o === k))) {
switch (scheme) {
case "Input differential":
key[i % key.length] = o;
break;
case "Output differential":
key[i % key.length] = x;
break;
}
}
}
return result;
}
/**
* XOR bitwise calculation.
*
* @param {number} operand
* @param {number} key
* @returns {number}
*/
export function xor(operand, key) {
return operand ^ key;
}
/**
* NOT bitwise calculation.
*
* @param {number} operand
* @returns {number}
*/
export function not(operand, _) {
return ~operand & 0xff;
}
/**
* AND bitwise calculation.
*
* @param {number} operand
* @param {number} key
* @returns {number}
*/
export function and(operand, key) {
return operand & key;
}
/**
* OR bitwise calculation.
*
* @param {number} operand
* @param {number} key
* @returns {number}
*/
export function or(operand, key) {
return operand | key;
}
/**
* ADD bitwise calculation.
*
* @param {number} operand
* @param {number} key
* @returns {number}
*/
export function add(operand, key) {
return (operand + key) % 256;
}
/**
* SUB bitwise calculation.
*
* @param {number} operand
* @param {number} key
* @returns {number}
*/
export function sub(operand, key) {
const result = operand - key;
return (result < 0) ? 256 + result : result;
}
/**
* Delimiter options for bitwise operations
*/
export const BITWISE_OP_DELIMS = ["Hex", "Decimal", "Binary", "Base64", "UTF8", "Latin1"];
+436
View File
@@ -0,0 +1,436 @@
/**
Blowfish.js from Dojo Toolkit 1.8.1 (https://github.com/dojo/dojox/tree/1.8/encoding)
Extracted by Sladex (xslade@gmail.com)
Shoehorned into working with mjs for CyberChef by Matt C (matt@artemisbot.uk)
Refactored and implemented modes support by cbeuw (cbeuw.andy@gmail.com)
@license BSD
========================================================================
The "New" BSD License:
**********************
Copyright (c) 2005-2016, The Dojo Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Dojo Foundation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
const crypto = {};
import forge from "node-forge";
/* dojo-release-1.8.1/dojo/_base/lang.js.uncompressed.js */
const lang = {};
lang.isString = function(it) {
// summary:
// Return true if it is a String
// it: anything
// Item to test.
return (typeof it == "string" || it instanceof String); // Boolean
};
/* dojo-release-1.8.1/dojo/_base/array.js.uncompressed.js */
const arrayUtil = {};
arrayUtil.map = function(arr, callback, thisObject, Ctr) {
// summary:
// applies callback to each element of arr and returns
// an Array with the results
// arr: Array|String
// the array to iterate on. If a string, operates on
// individual characters.
// callback: Function
// a function is invoked with three arguments, (item, index,
// array), and returns a value
// thisObject: Object?
// may be used to scope the call to callback
// returns: Array
// description:
// This function corresponds to the JavaScript 1.6 Array.map() method, with one difference: when
// run over sparse arrays, this implementation passes the "holes" in the sparse array to
// the callback function with a value of undefined. JavaScript 1.6's map skips the holes in the sparse array.
// For more details, see:
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
// example:
// | // returns [2, 3, 4, 5]
// | array.map([1, 2, 3, 4], function(item){ return item+1 });
// TODO: why do we have a non-standard signature here? do we need "Ctr"?
let i = 0;
const l = arr && arr.length || 0, out = new (Ctr || Array)(l);
if (l && typeof arr == "string") arr = arr.split("");
if (thisObject) {
for (; i < l; ++i) {
out[i] = callback.call(thisObject, arr[i], i, arr);
}
} else {
for (; i < l; ++i) {
out[i] = callback(arr[i], i, arr);
}
}
return out; // Array
};
/* dojo-release-1.8.1/dojox/encoding/crypto/Blowfish.js.uncompressed.js */
/* Blowfish
* Created based on the C# implementation by Marcus Hahn (http://www.hotpixel.net/)
* Unsigned math based on Paul Johnstone and Peter Wood patches.
* 2005-12-08
*/
const boxes={
p: [
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b
],
s0: [
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a
],
s1: [
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7
],
s2: [
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0
],
s3: [
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
]
};
////////////////////////////////////////////////////////////////////////////
// fixes based on patch submitted by Peter Wood (#5791)
const xor = function(x, y) {
return (((x>>0x10)^(y>>0x10))<<0x10)|(((x&0xffff)^(y&0xffff))&0xffff);
};
const f = function(v, box) {
const d=box.s3[v&0xff]; v>>=8;
const c=box.s2[v&0xff]; v>>=8;
const b=box.s1[v&0xff]; v>>=8;
const a=box.s0[v&0xff];
let r = (((a>>0x10)+(b>>0x10)+(((a&0xffff)+(b&0xffff))>>0x10))<<0x10)|(((a&0xffff)+(b&0xffff))&0xffff);
r = (((r>>0x10)^(c>>0x10))<<0x10)|(((r&0xffff)^(c&0xffff))&0xffff);
return (((r>>0x10)+(d>>0x10)+(((r&0xffff)+(d&0xffff))>>0x10))<<0x10)|(((r&0xffff)+(d&0xffff))&0xffff);
};
const eb = function(o, box) {
// TODO: see if this can't be made more efficient
let l=o.left;
let r=o.right;
l=xor(l, box.p[0]);
r=xor(r, xor(f(l, box), box.p[1]));
l=xor(l, xor(f(r, box), box.p[2]));
r=xor(r, xor(f(l, box), box.p[3]));
l=xor(l, xor(f(r, box), box.p[4]));
r=xor(r, xor(f(l, box), box.p[5]));
l=xor(l, xor(f(r, box), box.p[6]));
r=xor(r, xor(f(l, box), box.p[7]));
l=xor(l, xor(f(r, box), box.p[8]));
r=xor(r, xor(f(l, box), box.p[9]));
l=xor(l, xor(f(r, box), box.p[10]));
r=xor(r, xor(f(l, box), box.p[11]));
l=xor(l, xor(f(r, box), box.p[12]));
r=xor(r, xor(f(l, box), box.p[13]));
l=xor(l, xor(f(r, box), box.p[14]));
r=xor(r, xor(f(l, box), box.p[15]));
l=xor(l, xor(f(r, box), box.p[16]));
o.right=l;
o.left=xor(r, box.p[17]);
};
const db = function(o, box) {
let l=o.left;
let r=o.right;
l=xor(l, box.p[17]);
r=xor(r, xor(f(l, box), box.p[16]));
l=xor(l, xor(f(r, box), box.p[15]));
r=xor(r, xor(f(l, box), box.p[14]));
l=xor(l, xor(f(r, box), box.p[13]));
r=xor(r, xor(f(l, box), box.p[12]));
l=xor(l, xor(f(r, box), box.p[11]));
r=xor(r, xor(f(l, box), box.p[10]));
l=xor(l, xor(f(r, box), box.p[9]));
r=xor(r, xor(f(l, box), box.p[8]));
l=xor(l, xor(f(r, box), box.p[7]));
r=xor(r, xor(f(l, box), box.p[6]));
l=xor(l, xor(f(r, box), box.p[5]));
r=xor(r, xor(f(l, box), box.p[4]));
l=xor(l, xor(f(r, box), box.p[3]));
r=xor(r, xor(f(l, box), box.p[2]));
l=xor(l, xor(f(r, box), box.p[1]));
o.right=l;
o.left=xor(r, box.p[0]);
};
const encryptBlock=function(inblock, outblock, box) {
const o = {};
o.left=inblock[0];
o.right=inblock[1];
eb(o, box);
outblock[0] = o.left;
outblock[1] = o.right;
};
const decryptBlock=function(inblock, outblock, box) {
const o= {};
o.left=inblock[0];
o.right=inblock[1];
db(o, box);
outblock[0] = o.left;
outblock[1] = o.right;
};
crypto.Blowfish = new function() {
this.createCipher=function(key, modeName) {
return new forge.cipher.BlockCipher({
algorithm: new Blowfish.Algorithm(key, modeName),
key: key,
decrypt: false
});
};
this.createDecipher=function(key, modeName) {
return new forge.cipher.BlockCipher({
algorithm: new Blowfish.Algorithm(key, modeName),
key: key,
decrypt: true
});
};
}();
crypto.Blowfish.Algorithm=function(key, modeName) {
this.initialize({key: key});
const _box = this.box;
const modeOption = {
blockSize: 8,
cipher: {
encrypt: function(inblock, outblock) {
encryptBlock(inblock, outblock, _box);
},
decrypt: function(inblock, outblock) {
decryptBlock(inblock, outblock, _box);
},
}
};
switch (modeName.toLowerCase()) {
case "ecb":
this.mode=new forge.cipher.modes.ecb(modeOption);
break;
case "cbc":
this.mode=new forge.cipher.modes.cbc(modeOption);
break;
case "cfb":
this.mode=new forge.cipher.modes.cfb(modeOption);
break;
case "ofb":
this.mode=new forge.cipher.modes.ofb(modeOption);
break;
case "ctr":
this.mode=new forge.cipher.modes.ctr(modeOption);
break;
default:
this.mode=new forge.cipher.modes.ecb(modeOption);
break;
}
};
crypto.Blowfish.Algorithm.prototype.initialize=function(options) {
const POW8=Math.pow(2, 8);
let k=options.key;
if (lang.isString(k)) {
k = arrayUtil.map(k.split(""), function(item) {
return item.charCodeAt(0) & 0xff;
});
}
// init the boxes
let pos=0, data=0;
const res={ left: 0, right: 0 };
const box = {
p: arrayUtil.map(boxes.p.slice(0), function(item) {
const l=k.length;
for (let j=0; j<4; j++) {
data=(data*POW8)|k[pos++ % l];
}
return (((item>>0x10)^(data>>0x10))<<0x10)|(((item&0xffff)^(data&0xffff))&0xffff);
}),
s0: boxes.s0.slice(0),
s1: boxes.s1.slice(0),
s2: boxes.s2.slice(0),
s3: boxes.s3.slice(0)
};
// encrypt p and the s boxes
for (let i=0, l=box.p.length; i<l;) {
eb(res, box);
box.p[i++]=res.left;
box.p[i++]=res.right;
}
for (let i=0; i<4; i++) {
for (let j=0, l=box["s"+i].length; j<l;) {
eb(res, box);
box["s"+i][j++]=res.left;
box["s"+i][j++]=res.right;
}
}
this.box = box;
};
export const Blowfish = crypto.Blowfish;
+756
View File
@@ -0,0 +1,756 @@
/**
* Emulation of the Bombe machine.
*
* @author s2224834
* @author The National Museum of Computing - Bombe Rebuild Project
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import OperationError from "../errors/OperationError.mjs";
import Utils from "../Utils.mjs";
import {Rotor, Plugboard, a2i, i2a} from "./Enigma.mjs";
/**
* Convenience/optimisation subclass of Rotor
*
* This allows creating multiple Rotors which share backing maps, to avoid repeatedly parsing the
* rotor spec strings and duplicating the maps in memory.
*/
class CopyRotor extends Rotor {
/**
* Return a copy of this Rotor.
* @returns {Object}
*/
copy() {
const clone = {
map: this.map,
revMap: this.revMap,
pos: this.pos,
step: this.step,
transform: this.transform,
revTransform: this.revTransform,
};
return clone;
}
}
/**
* Node in the menu graph
*
* A node represents a cipher/plaintext letter.
*/
class Node {
/**
* Node constructor.
* @param {number} letter - The plain/ciphertext letter this node represents (as a number).
*/
constructor(letter) {
this.letter = letter;
this.edges = new Set();
this.visited = false;
}
}
/**
* Edge in the menu graph
*
* An edge represents an Enigma machine transformation between two letters.
*/
class Edge {
/**
* Edge constructor - an Enigma machine mapping between letters
* @param {number} pos - The rotor position, relative to the beginning of the crib, at this edge
* @param {number} node1 - Letter at one end (as a number)
* @param {number} node2 - Letter at the other end
*/
constructor(pos, node1, node2) {
this.pos = pos;
this.node1 = node1;
this.node2 = node2;
node1.edges.add(this);
node2.edges.add(this);
this.visited = false;
}
/**
* Given the node at one end of this edge, return the other end.
* @param node {number} - The node we have
* @returns {number}
*/
getOther(node) {
return this.node1 === node ? this.node2 : this.node1;
}
}
/**
* As all the Bombe's rotors move in step, at any given point the vast majority of the scramblers
* in the machine share the majority of their state, which is hosted in this class.
*/
class SharedScrambler {
/**
* SharedScrambler constructor.
* @param {Object[]} rotors - List of rotors in the shared state _only_.
* @param {Object} reflector - The reflector in use.
*/
constructor(rotors, reflector) {
this.lowerCache = new Array(26);
this.higherCache = new Array(26);
for (let i=0; i<26; i++) {
this.higherCache[i] = new Array(26);
}
this.changeRotors(rotors, reflector);
}
/**
* Replace the rotors and reflector in this SharedScrambler.
* This takes care of flushing caches as well.
* @param {Object[]} rotors - List of rotors in the shared state _only_.
* @param {Object} reflector - The reflector in use.
*/
changeRotors(rotors, reflector) {
this.reflector = reflector;
this.rotors = rotors;
this.rotorsRev = [].concat(rotors).reverse();
this.cacheGen();
}
/**
* Step the rotors forward.
* @param {number} n - How many rotors to step. This includes the rotors which are not part of
* the shared state, so should be 2 or more.
*/
step(n) {
for (let i=0; i<n-1; i++) {
this.rotors[i].step();
}
this.cacheGen();
}
/**
* Optimisation: We pregenerate all routes through the machine with the top rotor removed,
* as these rarely change. This saves a lot of lookups. This function generates this route
* table.
* We also just-in-time cache the full routes through the scramblers, because after stepping
* the fast rotor some scramblers will be in states occupied by other scrambles on previous
* iterations.
*/
cacheGen() {
for (let i=0; i<26; i++) {
this.lowerCache[i] = undefined;
for (let j=0; j<26; j++) {
this.higherCache[i][j] = undefined;
}
}
for (let i=0; i<26; i++) {
if (this.lowerCache[i] !== undefined) {
continue;
}
let letter = i;
for (const rotor of this.rotors) {
letter = rotor.transform(letter);
}
letter = this.reflector.transform(letter);
for (const rotor of this.rotorsRev) {
letter = rotor.revTransform(letter);
}
// By symmetry
this.lowerCache[i] = letter;
this.lowerCache[letter] = i;
}
}
/**
* Map a letter through this (partial) scrambler.
* @param {number} i - The letter
* @returns {number}
*/
transform(i) {
return this.lowerCache[i];
}
}
/**
* Scrambler.
*
* This is effectively just an Enigma machine, but it only operates on one character at a time and
* the stepping mechanism is different.
*/
class Scrambler {
/** Scrambler constructor.
* @param {Object} base - The SharedScrambler whose state this scrambler uses
* @param {Object} rotor - The non-shared fast rotor in this scrambler
* @param {number} pos - Position offset from start of crib
* @param {number} end1 - Letter in menu this scrambler is attached to
* @param {number} end2 - Other letter in menu this scrambler is attached to
*/
constructor(base, rotor, pos, end1, end2) {
this.baseScrambler = base;
this.initialPos = pos;
this.changeRotor(rotor);
this.end1 = end1;
this.end2 = end2;
// For efficiency reasons, we pull the relevant shared cache from the baseScrambler into
// this object - this saves us a few pointer dereferences
this.cache = this.baseScrambler.higherCache[pos];
}
/**
* Replace the rotor in this scrambler.
* The position is reset automatically.
* @param {Object} rotor - New rotor
*/
changeRotor(rotor) {
this.rotor = rotor;
this.rotor.pos += this.initialPos;
}
/**
* Step the rotor forward.
*
* The base SharedScrambler needs to be instructed to step separately.
*/
step() {
// The Bombe steps the slowest rotor on an actual Enigma fastest, for reasons.
// ...but for optimisation reasons I'm going to cheat and not do that, as this vastly
// simplifies caching the state of the majority of the scramblers. The results are the
// same, just in a slightly different order.
this.rotor.step();
this.cache = this.baseScrambler.higherCache[this.rotor.pos];
}
/**
* Run a letter through the scrambler.
* @param {number} i - The letter to transform (as a number)
* @returns {number}
*/
transform(i) {
let letter = i;
const cached = this.cache[i];
if (cached !== undefined) {
return cached;
}
letter = this.rotor.transform(letter);
letter = this.baseScrambler.transform(letter);
letter = this.rotor.revTransform(letter);
this.cache[i] = letter;
this.cache[letter] = i;
return letter;
}
/**
* Given one letter in the menu this scrambler maps to, return the other.
* @param end {number} - The node we have
* @returns {number}
*/
getOtherEnd(end) {
return this.end1 === end ? this.end2 : this.end1;
}
/**
* Read the position this scrambler is set to.
* Note that because of Enigma's stepping, you need to set an actual Enigma to the previous
* position in order to get it to make a certain set of electrical connections when a button
* is pressed - this function *does* take this into account.
* However, as with the rest of the Bombe, it does not take stepping into account - the middle
* and slow rotors are treated as static.
* @return {string}
*/
getPos() {
let result = "";
// Roll back the fast rotor by one step
let pos = Utils.mod(this.rotor.pos - 1, 26);
result += i2a(pos);
for (let i=0; i<this.baseScrambler.rotors.length; i++) {
pos = this.baseScrambler.rotors[i].pos;
result += i2a(pos);
}
return result.split("").reverse().join("");
}
}
/**
* Bombe simulator class.
*/
export class BombeMachine {
/**
* Construct a Bombe.
*
* Note that there is no handling of offsets here: the crib specified must exactly match the
* ciphertext. It will check that the crib is sane (length is vaguely sensible and there's no
* matching characters between crib and ciphertext) but cannot check further - if it's wrong
* your results will be wrong!
*
* There is also no handling of rotor stepping - if the target Enigma stepped in the middle of
* your crib, you're out of luck. TODO: Allow specifying a step point - this is fairly easy to
* configure on a real Bombe, but we're not clear on whether it was ever actually done for
* real (there would almost certainly have been better ways of attacking in most situations
* than attempting to exhaust options for the stepping point, but in some circumstances, e.g.
* via Banburismus, the stepping point might have been known).
*
* @param {string[]} rotors - list of rotor spec strings (without step points!)
* @param {Object} reflector - Reflector object
* @param {string} ciphertext - The ciphertext to attack
* @param {string} crib - Known plaintext for this ciphertext
* @param {boolean} check - Whether to use the checking machine
* @param {function} update - Function to call to send status updates (optional)
*/
constructor(rotors, reflector, ciphertext, crib, check, update=undefined) {
if (ciphertext.length < crib.length) {
throw new OperationError("Crib overruns supplied ciphertext");
}
if (crib.length < 2) {
// This is the absolute bare minimum to be sane, and even then it's likely too short to
// be useful
throw new OperationError("Crib is too short");
}
if (crib.length > 25) {
// A crib longer than this will definitely cause the middle rotor to step somewhere
// A shorter crib is preferable to reduce this chance, of course
throw new OperationError("Crib is too long");
}
for (let i=0; i<crib.length; i++) {
if (ciphertext[i] === crib[i]) {
throw new OperationError(`Invalid crib: character ${ciphertext[i]} at pos ${i} in both ciphertext and crib`);
}
}
this.ciphertext = ciphertext;
this.crib = crib;
this.initRotors(rotors);
this.check = check;
this.updateFn = update;
const [mostConnected, edges] = this.makeMenu();
// This is the bundle of wires corresponding to the 26 letters within each of the 26
// possible nodes in the menu
this.wires = new Array(26*26);
// These are the pseudo-Engima devices corresponding to each edge in the menu, and the
// nodes in the menu they each connect to
this.scramblers = new Array();
for (let i=0; i<26; i++) {
this.scramblers.push(new Array());
}
this.sharedScrambler = new SharedScrambler(this.baseRotors.slice(1), reflector);
this.allScramblers = new Array();
this.indicator = undefined;
for (const edge of edges) {
const cRotor = this.baseRotors[0].copy();
const end1 = a2i(edge.node1.letter);
const end2 = a2i(edge.node2.letter);
const scrambler = new Scrambler(this.sharedScrambler, cRotor, edge.pos, end1, end2);
if (edge.pos === 0) {
this.indicator = scrambler;
}
this.scramblers[end1].push(scrambler);
this.scramblers[end2].push(scrambler);
this.allScramblers.push(scrambler);
}
// The Bombe uses a set of rotors to keep track of what settings it's testing. We cheat and
// use one of the actual scramblers if there's one in the right position, but if not we'll
// just create one.
if (this.indicator === undefined) {
this.indicator = new Scrambler(this.sharedScrambler, this.baseRotors[0].copy(), 0, undefined, undefined);
this.allScramblers.push(this.indicator);
}
this.testRegister = a2i(mostConnected.letter);
// This is an arbitrary letter other than the most connected letter
for (const edge of mostConnected.edges) {
this.testInput = [this.testRegister, a2i(edge.getOther(mostConnected).letter)];
break;
}
}
/**
* Build Rotor objects from list of rotor wiring strings.
* @param {string[]} rotors - List of rotor wiring strings
*/
initRotors(rotors) {
// This is ordered from the Enigma fast rotor to the slow, so bottom to top for the Bombe
this.baseRotors = [];
for (const rstr of rotors) {
const rotor = new CopyRotor(rstr, "", "A", "A");
this.baseRotors.push(rotor);
}
}
/**
* Replace the rotors and reflector in all components of this Bombe.
* @param {string[]} rotors - List of rotor wiring strings
* @param {Object} reflector - Reflector object
*/
changeRotors(rotors, reflector) {
// At the end of the run, the rotors are all back in the same position they started
this.initRotors(rotors);
this.sharedScrambler.changeRotors(this.baseRotors.slice(1), reflector);
for (const scrambler of this.allScramblers) {
scrambler.changeRotor(this.baseRotors[0].copy());
}
}
/**
* If we have a way of sending status messages, do so.
* @param {...*} msg - Message to send.
*/
update(...msg) {
if (this.updateFn !== undefined) {
this.updateFn(...msg);
}
}
/**
* Recursive depth-first search on the menu graph.
* This is used to a) isolate unconnected sub-graphs, and b) count the number of loops in each
* of those graphs.
* @param {Object} node - Node object to start the search from
* @returns {[number, number, Object, number, Object[]} - loop count, node count, most connected
* node, order of most connected node, list of edges in this sub-graph
*/
dfs(node) {
let loops = 0;
let nNodes = 1;
let mostConnected = node;
let nConnections = mostConnected.edges.size;
let edges = new Set();
node.visited = true;
for (const edge of node.edges) {
if (edge.visited) {
// Already been here from the other end.
continue;
}
edge.visited = true;
edges.add(edge);
const other = edge.getOther(node);
if (other.visited) {
// We have a loop, record that and continue
loops += 1;
continue;
}
// This is a newly visited node
const [oLoops, oNNodes, oMostConnected, oNConnections, oEdges] = this.dfs(other);
loops += oLoops;
nNodes += oNNodes;
edges = new Set([...edges, ...oEdges]);
if (oNConnections > nConnections) {
mostConnected = oMostConnected;
nConnections = oNConnections;
}
}
return [loops, nNodes, mostConnected, nConnections, edges];
}
/**
* Build a menu from the ciphertext and crib.
* A menu is just a graph where letters in either the ciphertext or crib (Enigma is symmetric,
* so there's no difference mathematically) are nodes and states of the Enigma machine itself
* are the edges.
* Additionally, we want a single connected graph, and of the subgraphs available, we want the
* one with the most loops (since these generate feedback cycles which efficiently close off
* disallowed states).
* Finally, we want to identify the most connected node in that graph (as it's the best choice
* of measurement point).
* @returns [Object, Object[]] - the most connected node, and the list of edges in the subgraph
*/
makeMenu() {
// First, we make a graph of all of the mappings given by the crib
// Make all nodes first
const nodes = new Map();
for (const c of this.ciphertext + this.crib) {
if (!nodes.has(c)) {
const node = new Node(c);
nodes.set(c, node);
}
}
// Then all edges
for (let i=0; i<this.crib.length; i++) {
const a = this.crib[i];
const b = this.ciphertext[i];
new Edge(i, nodes.get(a), nodes.get(b));
}
// list of [loop_count, node_count, most_connected_node, connections_on_most_connected, edges]
const graphs = [];
// Then, for each unconnected subgraph, we count the number of loops and nodes
for (const start of nodes.keys()) {
if (nodes.get(start).visited) {
continue;
}
const subgraph = this.dfs(nodes.get(start));
graphs.push(subgraph);
}
// Return the subgraph with the most loops (ties broken by node count)
graphs.sort((a, b) => {
let result = b[0] - a[0];
if (result === 0) {
result = b[1] - a[1];
}
return result;
});
this.nLoops = graphs[0][0];
return [graphs[0][2], graphs[0][4]];
}
/**
* Bombe electrical simulation. Energise a wire. For all connected wires (both via the diagonal
* board and via the scramblers), energise them too, recursively.
* @param {number} i - Bombe wire bundle
* @param {number} j - Bombe stecker hypothesis wire within bundle
*/
energise(i, j) {
const idx = 26*i + j;
if (this.wires[idx]) {
return;
}
this.wires[idx] = true;
// Welchman's diagonal board: if A steckers to B, that implies B steckers to A. Handle
// both.
const idxPair = 26*j + i;
this.wires[idxPair] = true;
if (i === this.testRegister || j === this.testRegister) {
this.energiseCount++;
if (this.energiseCount === 26) {
// no point continuing, bail out
return;
}
}
for (let k=0; k<this.scramblers[i].length; k++) {
const scrambler = this.scramblers[i][k];
const out = scrambler.transform(j);
const other = scrambler.getOtherEnd(i);
// Lift the pre-check before the call, to save some function call overhead
const otherIdx = 26*other + out;
if (!this.wires[otherIdx]) {
this.energise(other, out);
if (this.energiseCount === 26) {
return;
}
}
}
if (i === j) {
return;
}
for (let k=0; k<this.scramblers[j].length; k++) {
const scrambler = this.scramblers[j][k];
const out = scrambler.transform(i);
const other = scrambler.getOtherEnd(j);
const otherIdx = 26*other + out;
if (!this.wires[otherIdx]) {
this.energise(other, out);
if (this.energiseCount === 26) {
return;
}
}
}
}
/**
* Trial decryption at the current setting.
* Used after we get a stop.
* This applies the detected stecker pair if we have one. It does not handle the other
* steckering or stepping (which is why we limit it to 26 characters, since it's guaranteed to
* be wrong after that anyway).
* @param {string} stecker - Known stecker spec string.
* @returns {string}
*/
tryDecrypt(stecker) {
const fastRotor = this.indicator.rotor;
const initialPos = fastRotor.pos;
const res = [];
const plugboard = new Plugboard(stecker);
// The indicator scrambler starts in the right place for the beginning of the ciphertext.
for (let i=0; i<Math.min(26, this.ciphertext.length); i++) {
const t = this.indicator.transform(plugboard.transform(a2i(this.ciphertext[i])));
res.push(i2a(plugboard.transform(t)));
this.indicator.step(1);
}
fastRotor.pos = initialPos;
return res.join("");
}
/**
* Format a steckered pair, in sorted order to allow uniquing.
* @param {number} a - A letter
* @param {number} b - Its stecker pair
* @returns {string}
*/
formatPair(a, b) {
if (a < b) {
return `${i2a(a)}${i2a(b)}`;
}
return `${i2a(b)}${i2a(a)}`;
}
/**
* The checking machine was used to manually verify Bombe stops. Using a device which was
* effectively a non-stepping Enigma, the user would walk through each of the links in the
* menu at the rotor positions determined by the Bombe. By starting with the stecker pair the
* Bombe gives us, we find the stecker pair of each connected letter in the graph, and so on.
* If a contradiction is reached, the stop is invalid. If not, we have most (but not
* necessarily all) of the plugboard connections.
* You will notice that this procedure is exactly the same as what the Bombe itself does, only
* we start with an assumed good hypothesis and read out the stecker pair for every letter.
* On the real hardware that wasn't practical, but fortunately we're not the real hardware, so
* we don't need to implement the manual checking machine procedure.
* @param {number} pair - The stecker pair of the test register.
* @returns {string} - The empty string for invalid stops, or a plugboard configuration string
* containing all known pairs.
*/
checkingMachine(pair) {
if (pair !== this.testInput[1]) {
// We have a new hypothesis for this stop - apply the new one.
// De-energise the board
for (let i=0; i<this.wires.length; i++) {
this.wires[i] = false;
}
this.energiseCount = 0;
// Re-energise with the corrected hypothesis
this.energise(this.testRegister, pair);
}
const results = new Set();
results.add(this.formatPair(this.testRegister, pair));
for (let i=0; i<26; i++) {
let count = 0;
let other;
for (let j=0; j<26; j++) {
if (this.wires[i*26 + j]) {
count++;
other = j;
}
}
if (count > 1) {
// This is an invalid stop.
return "";
} else if (count === 0) {
// No information about steckering from this wire
continue;
}
results.add(this.formatPair(i, other));
}
return [...results].join(" ");
}
/**
* Check to see if the Bombe has stopped. If so, process the stop.
* @returns {(undefined|string[3])} - Undefined for no stop, or [rotor settings, plugboard settings, decryption preview]
*/
checkStop() {
// Count the energised outputs
const count = this.energiseCount;
if (count === 26) {
return undefined;
}
// If it's not all of them, we have a stop
let steckerPair;
// The Bombe tells us one stecker pair as well. The input wire and test register we
// started with are hypothesised to be a stecker pair.
if (count === 25) {
// Our steckering hypothesis is wrong. Correct value is the un-energised wire.
for (let j=0; j<26; j++) {
if (!this.wires[26*this.testRegister + j]) {
steckerPair = j;
break;
}
}
} else if (count === 1) {
// This means our hypothesis for the steckering is correct.
steckerPair = this.testInput[1];
} else {
// This was known as a "boxing stop" - we have a stop but not a single hypothesis.
// If this happens a lot it implies the menu isn't good enough.
// If we have the checking machine enabled, we're going to just check each wire in
// turn. If we get 0 or 1 hit, great.
// If we get multiple hits, or the checking machine is off, the user will just have to
// deal with it.
if (!this.check) {
// We can't draw any conclusions about the steckering (one could maybe suggest
// options in some cases, but too hard to present clearly).
return [this.indicator.getPos(), "??", this.tryDecrypt("")];
}
let stecker = undefined;
for (let i = 0; i < 26; i++) {
const newStecker = this.checkingMachine(i);
if (newStecker !== "") {
if (stecker !== undefined) {
// Multiple hypotheses can't be ruled out.
return [this.indicator.getPos(), "??", this.tryDecrypt("")];
}
stecker = newStecker;
}
}
if (stecker === undefined) {
// Checking machine ruled all possibilities out.
return undefined;
}
// If we got here, there was just one possibility allowed by the checking machine. Success.
return [this.indicator.getPos(), stecker, this.tryDecrypt(stecker)];
}
let stecker;
if (this.check) {
stecker = this.checkingMachine(steckerPair);
if (stecker === "") {
// Invalid stop - don't count it, don't return it
return undefined;
}
} else {
stecker = `${i2a(this.testRegister)}${i2a(steckerPair)}`;
}
const testDecrypt = this.tryDecrypt(stecker);
return [this.indicator.getPos(), stecker, testDecrypt];
}
/**
* Having set up the Bombe, do the actual attack run. This tries every possible rotor setting
* and attempts to logically invalidate them. If it can't, it's added to the list of candidate
* solutions.
* @returns {string[][3]} - list of 3-tuples of candidate rotor setting, plugboard settings, and decryption preview
*/
run() {
let stops = 0;
const result = [];
// For each possible rotor setting
const nChecks = Math.pow(26, this.baseRotors.length);
for (let i=1; i<=nChecks; i++) {
// Benchmarking suggests this is faster than using .fill()
for (let i=0; i<this.wires.length; i++) {
this.wires[i] = false;
}
this.energiseCount = 0;
// Energise the test input, follow the current through each scrambler
// (and the diagonal board)
this.energise(...this.testInput);
const stop = this.checkStop();
if (stop !== undefined) {
stops++;
result.push(stop);
}
// Step all the scramblers
// This loop counts how many rotors have reached their starting position (meaning the
// next one needs to step as well)
let n = 1;
for (let j=1; j<this.baseRotors.length; j++) {
if ((i % Math.pow(26, j)) === 0) {
n++;
} else {
break;
}
}
if (n > 1) {
this.sharedScrambler.step(n);
}
for (const scrambler of this.allScramblers) {
scrambler.step();
}
// Send status messages at what seems to be a reasonably sensible frequency
// (note this won't be triggered on 3-rotor runs - they run fast enough it doesn't seem necessary)
if (n > 3) {
this.update(this.nLoops, stops, i/nChecks);
}
}
return result;
}
}
+15
View File
@@ -0,0 +1,15 @@
/**
* Braille resources.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/**
* Braille lookup table.
*/
export const BRAILLE_LOOKUP = {
ascii: " A1B'K2L@CIF/MSP\"E3H9O6R^DJG>NTQ,*5<-U8V.%[$+X!&;:4\\0Z7(_?W]#Y)=",
dot6: "⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿"
};
+204
View File
@@ -0,0 +1,204 @@
/**
* Various components for drawing diagrams on an HTML5 canvas.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
/**
* Draws a line from one point to another
*
* @param ctx
* @param startX
* @param startY
* @param endX
* @param endY
*/
export function drawLine(ctx, startX, startY, endX, endY) {
ctx.beginPath();
ctx.moveTo(startX, startY);
ctx.lineTo(endX, endY);
ctx.closePath();
ctx.stroke();
}
/**
* Draws a bar chart on the canvas.
*
* @param canvas
* @param scores
* @param xAxisLabel
* @param yAxisLabel
* @param numXLabels
* @param numYLabels
* @param fontSize
*/
export function drawBarChart(canvas, scores, xAxisLabel, yAxisLabel, numXLabels, numYLabels, fontSize) {
fontSize = fontSize || 15;
if (!numXLabels || numXLabels > Math.round(canvas.width / 50)) {
numXLabels = Math.round(canvas.width / 50);
}
if (!numYLabels || numYLabels > Math.round(canvas.width / 50)) {
numYLabels = Math.round(canvas.height / 50);
}
// Graph properties
const ctx = canvas.getContext("2d"),
leftPadding = canvas.width * 0.08,
rightPadding = canvas.width * 0.03,
topPadding = canvas.height * 0.08,
bottomPadding = canvas.height * 0.2,
graphHeight = canvas.height - topPadding - bottomPadding,
graphWidth = canvas.width - leftPadding - rightPadding,
base = topPadding + graphHeight,
ceil = topPadding;
ctx.font = fontSize + "px Arial";
// Draw axis
ctx.lineWidth = "1.0";
ctx.strokeStyle = "#444";
drawLine(ctx, leftPadding, base, graphWidth + leftPadding, base); // x
drawLine(ctx, leftPadding, base, leftPadding, ceil); // y
// Bar properties
const barPadding = graphWidth * 0.003,
barWidth = (graphWidth - (barPadding * scores.length)) / scores.length,
max = Math.max.apply(Math, scores);
let currX = leftPadding + barPadding;
// Draw bars
ctx.fillStyle = "green";
for (let i = 0; i < scores.length; i++) {
const h = scores[i] / max * graphHeight;
ctx.fillRect(currX, base - h, barWidth, h);
currX += barWidth + barPadding;
}
// Mark x axis
ctx.fillStyle = "black";
ctx.textAlign = "center";
currX = leftPadding + barPadding;
if (numXLabels >= scores.length) {
// Mark every score
for (let i = 0; i <= scores.length; i++) {
ctx.fillText(i, currX, base + (bottomPadding * 0.3));
currX += barWidth + barPadding;
}
} else {
// Mark some scores
for (let i = 0; i <= numXLabels; i++) {
const val = Math.ceil((scores.length / numXLabels) * i);
currX = (graphWidth / numXLabels) * i + leftPadding;
ctx.fillText(val, currX, base + (bottomPadding * 0.3));
}
}
// Mark y axis
ctx.textAlign = "right";
let currY;
if (numYLabels >= max) {
// Mark every increment
for (let i = 0; i <= max; i++) {
currY = base - (i / max * graphHeight) + fontSize / 3;
ctx.fillText(i, leftPadding * 0.8, currY);
}
} else {
// Mark some increments
for (let i = 0; i <= numYLabels; i++) {
const val = Math.ceil((max / numYLabels) * i);
currY = base - (val / max * graphHeight) + fontSize / 3;
ctx.fillText(val, leftPadding * 0.8, currY);
}
}
// Label x axis
if (xAxisLabel) {
ctx.textAlign = "center";
ctx.fillText(xAxisLabel, graphWidth / 2 + leftPadding, base + bottomPadding * 0.8);
}
// Label y axis
if (yAxisLabel) {
ctx.save();
const x = leftPadding * 0.3,
y = graphHeight / 2 + topPadding;
ctx.translate(x, y);
ctx.rotate(-Math.PI / 2);
ctx.textAlign = "center";
ctx.fillText(yAxisLabel, 0, 0);
ctx.restore();
}
}
/**
* Draws a scale bar on the canvas.
*
* @param canvas
* @param score
* @param max
* @param markings
*/
export function drawScaleBar(canvas, score, max, markings) {
// Bar properties
const ctx = canvas.getContext("2d"),
leftPadding = canvas.width * 0.01,
rightPadding = canvas.width * 0.01,
topPadding = canvas.height * 0.1,
bottomPadding = canvas.height * 0.35,
barHeight = canvas.height - topPadding - bottomPadding,
barWidth = canvas.width - leftPadding - rightPadding;
// Scale properties
const proportion = score / max;
// Draw bar outline
ctx.strokeRect(leftPadding, topPadding, barWidth, barHeight);
// Shade in up to proportion
const grad = ctx.createLinearGradient(leftPadding, 0, barWidth + leftPadding, 0);
grad.addColorStop(0, "green");
grad.addColorStop(0.5, "gold");
grad.addColorStop(1, "red");
ctx.fillStyle = grad;
ctx.fillRect(leftPadding, topPadding, barWidth * proportion, barHeight);
// Add markings
let x0, y0, x1, y1;
ctx.fillStyle = "black";
ctx.textAlign = "center";
ctx.font = "13px Arial";
for (let i = 0; i < markings.length; i++) {
// Draw min line down
x0 = barWidth / max * markings[i].min + leftPadding;
y0 = topPadding + barHeight + (bottomPadding * 0.1);
x1 = x0;
y1 = topPadding + barHeight + (bottomPadding * 0.3);
drawLine(ctx, x0, y0, x1, y1);
// Draw max line down
x0 = barWidth / max * markings[i].max + leftPadding;
x1 = x0;
drawLine(ctx, x0, y0, x1, y1);
// Join min and max lines
x0 = barWidth / max * markings[i].min + leftPadding;
y0 = topPadding + barHeight + (bottomPadding * 0.3);
x1 = barWidth / max * markings[i].max + leftPadding;
y1 = y0;
drawLine(ctx, x0, y0, x1, y1);
// Add label
if (markings[i].max >= max * 0.9) {
ctx.textAlign = "right";
x0 = x1;
} else if (markings[i].max <= max * 0.1) {
ctx.textAlign = "left";
} else {
x0 = x0 + (x1 - x0) / 2;
}
y0 = topPadding + barHeight + (bottomPadding * 0.8);
ctx.fillText(markings[i].label, x0, y0);
}
}
+179
View File
@@ -0,0 +1,179 @@
/**
* @author tlwr [toby@toby.codes]
* @author Matt C [me@mitt.dev]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import OperationError from "../errors/OperationError.mjs";
import Utils from "../Utils.mjs";
/**
* @constant
* @default
*/
export const RECORD_DELIMITER_OPTIONS = ["Line feed", "CRLF"];
/**
* @constant
* @default
*/
export const FIELD_DELIMITER_OPTIONS = ["Space", "Comma", "Semi-colon", "Colon", "Tab"];
/**
* Default from colour
*
* @constant
* @default
*/
export const COLOURS = {
min: "white",
max: "black"
};
/**
* Gets values from input for a plot.
*
* @param {string} input
* @param {string} recordDelimiter
* @param {string} fieldDelimiter
* @param {boolean} columnHeadingsAreIncluded - whether we should skip the first record
* @param {number} length
* @returns {Object[]}
*/
export function getValues(input, recordDelimiter, fieldDelimiter, columnHeadingsAreIncluded, length) {
let headings;
const values = [];
input
.split(recordDelimiter)
.forEach((row, rowIndex) => {
const split = row.split(fieldDelimiter);
if (split.length !== length) throw new OperationError(`Each row must have length ${length}.`);
if (columnHeadingsAreIncluded && rowIndex === 0) {
headings = split;
} else {
values.push(split);
}
});
return { headings, values };
}
/**
* Gets values from input for a scatter plot.
*
* @param {string} input
* @param {string} recordDelimiter
* @param {string} fieldDelimiter
* @param {boolean} columnHeadingsAreIncluded - whether we should skip the first record
* @returns {Object[]}
*/
export function getScatterValues(input, recordDelimiter, fieldDelimiter, columnHeadingsAreIncluded) {
let { headings, values } = getValues(
input,
recordDelimiter,
fieldDelimiter,
columnHeadingsAreIncluded,
2
);
if (headings) {
headings = {x: headings[0], y: headings[1]};
}
values = values.map(row => {
const x = parseFloat(row[0]),
y = parseFloat(row[1]);
if (Number.isNaN(x)) throw new OperationError("Values must be numbers in base 10.");
if (Number.isNaN(y)) throw new OperationError("Values must be numbers in base 10.");
return [x, y];
});
return { headings, values };
}
/**
* Gets values from input for a scatter plot with colour from the third column.
*
* @param {string} input
* @param {string} recordDelimiter
* @param {string} fieldDelimiter
* @param {boolean} columnHeadingsAreIncluded - whether we should skip the first record
* @returns {Object[]}
*/
export function getScatterValuesWithColour(input, recordDelimiter, fieldDelimiter, columnHeadingsAreIncluded) {
let { headings, values } = getValues(
input,
recordDelimiter, fieldDelimiter,
columnHeadingsAreIncluded,
3
);
if (headings) {
headings = {x: headings[0], y: headings[1]};
}
values = values.map(row => {
const x = parseFloat(row[0]),
y = parseFloat(row[1]),
colour = row[2];
if (Number.isNaN(x)) throw new OperationError("Values must be numbers in base 10.");
if (Number.isNaN(y)) throw new OperationError("Values must be numbers in base 10.");
return [x, y, Utils.escapeHtml(colour)];
});
return { headings, values };
}
/**
* Gets values from input for a time series plot.
*
* @param {string} input
* @param {string} recordDelimiter
* @param {string} fieldDelimiter
* @param {boolean} columnHeadingsAreIncluded - whether we should skip the first record
* @returns {Object[]}
*/
export function getSeriesValues(input, recordDelimiter, fieldDelimiter, columnHeadingsAreIncluded) {
const { values } = getValues(
input,
recordDelimiter, fieldDelimiter,
false,
3
);
let xValues = new Set();
const series = {};
values.forEach(row => {
const serie = row[0],
xVal = row[1],
val = parseFloat(row[2]);
if (Number.isNaN(val)) throw new OperationError("Values must be numbers in base 10.");
xValues.add(xVal);
if (typeof series[serie] === "undefined") series[serie] = {};
series[serie][xVal] = val;
});
xValues = new Array(...xValues);
const seriesList = [];
for (const seriesName in series) {
const serie = series[seriesName];
seriesList.push({name: seriesName, data: serie});
}
return { xValues, series: seriesList };
}
+231
View File
@@ -0,0 +1,231 @@
/**
* Character encoding resources.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2016
* @license Apache-2.0
*/
import cptable from "codepage";
/**
* Character encoding format mappings.
*/
export const CHR_ENC_CODE_PAGES = {
"UTF-8 (65001)": 65001,
"UTF-7 (65000)": 65000,
"UTF-16LE (1200)": 1200,
"UTF-16BE (1201)": 1201,
"UTF-32LE (12000)": 12000,
"UTF-32BE (12001)": 12001,
"IBM EBCDIC International (500)": 500,
"IBM EBCDIC US-Canada (37)": 37,
"IBM EBCDIC Multilingual/ROECE (Latin 2) (870)": 870,
"IBM EBCDIC Greek Modern (875)": 875,
"IBM EBCDIC French (1010)": 1010,
"IBM EBCDIC Turkish (Latin 5) (1026)": 1026,
"IBM EBCDIC Latin 1/Open System (1047)": 1047,
"IBM EBCDIC Lao (1132/1133/1341)": 1132,
"IBM EBCDIC US-Canada (037 + Euro symbol) (1140)": 1140,
"IBM EBCDIC Germany (20273 + Euro symbol) (1141)": 1141,
"IBM EBCDIC Denmark-Norway (20277 + Euro symbol) (1142)": 1142,
"IBM EBCDIC Finland-Sweden (20278 + Euro symbol) (1143)": 1143,
"IBM EBCDIC Italy (20280 + Euro symbol) (1144)": 1144,
"IBM EBCDIC Latin America-Spain (20284 + Euro symbol) (1145)": 1145,
"IBM EBCDIC United Kingdom (20285 + Euro symbol) (1146)": 1146,
"IBM EBCDIC France (20297 + Euro symbol) (1147)": 1147,
"IBM EBCDIC International (500 + Euro symbol) (1148)": 1148,
"IBM EBCDIC Icelandic (20871 + Euro symbol) (1149)": 1149,
"IBM EBCDIC Germany (20273)": 20273,
"IBM EBCDIC Denmark-Norway (20277)": 20277,
"IBM EBCDIC Finland-Sweden (20278)": 20278,
"IBM EBCDIC Italy (20280)": 20280,
"IBM EBCDIC Latin America-Spain (20284)": 20284,
"IBM EBCDIC United Kingdom (20285)": 20285,
"IBM EBCDIC Japanese Katakana Extended (20290)": 20290,
"IBM EBCDIC France (20297)": 20297,
"IBM EBCDIC Arabic (20420)": 20420,
"IBM EBCDIC Greek (20423)": 20423,
"IBM EBCDIC Hebrew (20424)": 20424,
"IBM EBCDIC Korean Extended (20833)": 20833,
"IBM EBCDIC Thai (20838)": 20838,
"IBM EBCDIC Icelandic (20871)": 20871,
"IBM EBCDIC Cyrillic Russian (20880)": 20880,
"IBM EBCDIC Turkish (20905)": 20905,
"IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) (20924)": 20924,
"IBM EBCDIC Cyrillic Serbian-Bulgarian (21025)": 21025,
"OEM United States (437)": 437,
"OEM Greek (formerly 437G); Greek (DOS) (737)": 737,
"OEM Baltic; Baltic (DOS) (775)": 775,
"OEM Russian; Cyrillic + Euro symbol (808)": 808,
"OEM Multilingual Latin 1; Western European (DOS) (850)": 850,
"OEM Latin 2; Central European (DOS) (852)": 852,
"OEM Cyrillic (primarily Russian) (855)": 855,
"OEM Turkish; Turkish (DOS) (857)": 857,
"OEM Multilingual Latin 1 + Euro symbol (858)": 858,
"OEM Portuguese; Portuguese (DOS) (860)": 860,
"OEM Icelandic; Icelandic (DOS) (861)": 861,
"OEM Hebrew; Hebrew (DOS) (862)": 862,
"OEM French Canadian; French Canadian (DOS) (863)": 863,
"OEM Arabic; Arabic (864) (864)": 864,
"OEM Nordic; Nordic (DOS) (865)": 865,
"OEM Russian; Cyrillic (DOS) (866)": 866,
"OEM Modern Greek; Greek, Modern (DOS) (869)": 869,
"OEM Cyrillic (primarily Russian) + Euro Symbol (872)": 872,
"Windows-874 Thai (874)": 874,
"Windows-1250 Central European (1250)": 1250,
"Windows-1251 Cyrillic (1251)": 1251,
"Windows-1252 Latin (1252)": 1252,
"Windows-1253 Greek (1253)": 1253,
"Windows-1254 Turkish (1254)": 1254,
"Windows-1255 Hebrew (1255)": 1255,
"Windows-1256 Arabic (1256)": 1256,
"Windows-1257 Baltic (1257)": 1257,
"Windows-1258 Vietnam (1258)": 1258,
"ISO-8859-1 Latin 1 Western European (28591)": 28591,
"ISO-8859-2 Latin 2 Central European (28592)": 28592,
"ISO-8859-3 Latin 3 South European (28593)": 28593,
"ISO-8859-4 Latin 4 North European (28594)": 28594,
"ISO-8859-5 Latin/Cyrillic (28595)": 28595,
"ISO-8859-6 Latin/Arabic (28596)": 28596,
"ISO-8859-7 Latin/Greek (28597)": 28597,
"ISO-8859-8 Latin/Hebrew (28598)": 28598,
"ISO 8859-8 Hebrew (ISO-Logical) (38598)": 38598,
"ISO-8859-9 Latin 5 Turkish (28599)": 28599,
"ISO-8859-10 Latin 6 Nordic (28600)": 28600,
"ISO-8859-11 Latin/Thai (28601)": 28601,
"ISO-8859-13 Latin 7 Baltic Rim (28603)": 28603,
"ISO-8859-14 Latin 8 Celtic (28604)": 28604,
"ISO-8859-15 Latin 9 (28605)": 28605,
"ISO-8859-16 Latin 10 (28606)": 28606,
"ISO 2022 JIS Japanese with no halfwidth Katakana (50220)": 50220,
"ISO 2022 JIS Japanese with halfwidth Katakana (50221)": 50221,
"ISO 2022 Japanese JIS X 0201-1989 (1 byte Kana-SO/SI) (50222)": 50222,
"ISO 2022 Korean (50225)": 50225,
"ISO 2022 Simplified Chinese (50227)": 50227,
"ISO 6937 Non-Spacing Accent (20269)": 20269,
"EUC Japanese (51932)": 51932,
"EUC Simplified Chinese (51936)": 51936,
"EUC Korean (51949)": 51949,
"ISCII Devanagari (57002)": 57002,
"ISCII Bengali (57003)": 57003,
"ISCII Tamil (57004)": 57004,
"ISCII Telugu (57005)": 57005,
"ISCII Assamese (57006)": 57006,
"ISCII Oriya (57007)": 57007,
"ISCII Kannada (57008)": 57008,
"ISCII Malayalam (57009)": 57009,
"ISCII Gujarati (57010)": 57010,
"ISCII Punjabi (57011)": 57011,
"Japanese Shift-JIS (932)": 932,
"Simplified Chinese GBK (936)": 936,
"Korean (949)": 949,
"Traditional Chinese Big5 (950)": 950,
"US-ASCII (7-bit) (20127)": 20127,
"Simplified Chinese GB2312 (20936)": 20936,
"KOI8-R Russian Cyrillic (20866)": 20866,
"KOI8-U Ukrainian Cyrillic (21866)": 21866,
"Mazovia (Polish) MS-DOS (620)": 620,
"Arabic (ASMO 708) (708)": 708,
"Arabic (Transparent ASMO); Arabic (DOS) (720)": 720,
"Kamenický (Czech) MS-DOS (895)": 895,
"Korean (Johab) (1361)": 1361,
"MAC Roman (10000)": 10000,
"Japanese (Mac) (10001)": 10001,
"MAC Traditional Chinese (Big5) (10002)": 10002,
"Korean (Mac) (10003)": 10003,
"Arabic (Mac) (10004)": 10004,
"Hebrew (Mac) (10005)": 10005,
"Greek (Mac) (10006)": 10006,
"Cyrillic (Mac) (10007)": 10007,
"MAC Simplified Chinese (GB 2312) (10008)": 10008,
"Romanian (Mac) (10010)": 10010,
"Ukrainian (Mac) (10017)": 10017,
"Thai (Mac) (10021)": 10021,
"MAC Latin 2 (Central European) (10029)": 10029,
"Icelandic (Mac) (10079)": 10079,
"Turkish (Mac) (10081)": 10081,
"Croatian (Mac) (10082)": 10082,
"CNS Taiwan (Chinese Traditional) (20000)": 20000,
"TCA Taiwan (20001)": 20001,
"ETEN Taiwan (Chinese Traditional) (20002)": 20002,
"IBM5550 Taiwan (20003)": 20003,
"TeleText Taiwan (20004)": 20004,
"Wang Taiwan (20005)": 20005,
"Western European IA5 (IRV International Alphabet 5) (20105)": 20105,
"IA5 German (7-bit) (20106)": 20106,
"IA5 Swedish (7-bit) (20107)": 20107,
"IA5 Norwegian (7-bit) (20108)": 20108,
"T.61 (20261)": 20261,
"Japanese (JIS 0208-1990 and 0212-1990) (20932)": 20932,
"Korean Wansung (20949)": 20949,
"Extended/Ext Alpha Lowercase (21027)": 21027,
"Europa 3 (29001)": 29001,
"Atari ST/TT (47451)": 47451,
"HZ-GB2312 Simplified Chinese (52936)": 52936,
"Simplified Chinese GB18030 (54936)": 54936,
};
export const CHR_ENC_SIMPLE_LOOKUP = {};
export const CHR_ENC_SIMPLE_REVERSE_LOOKUP = {};
for (const name in CHR_ENC_CODE_PAGES) {
const simpleName = name.match(/(^.+)\([\d/]+\)$/)[1];
CHR_ENC_SIMPLE_LOOKUP[simpleName] = CHR_ENC_CODE_PAGES[name];
CHR_ENC_SIMPLE_REVERSE_LOOKUP[CHR_ENC_CODE_PAGES[name]] = simpleName;
}
/**
* Returns the width of the character set for the given codepage.
* For example, UTF-8 is a Single Byte Character Set, whereas
* UTF-16 is a Double Byte Character Set.
*
* @param {number} page - The codepage number
* @returns {number}
*/
export function chrEncWidth(page) {
if (typeof page !== "number") return 0;
// Raw Bytes have a width of 1
if (page === 0) return 1;
const pageStr = page.toString();
// Confirm this page is legitimate
if (!Object.prototype.hasOwnProperty.call(CHR_ENC_SIMPLE_REVERSE_LOOKUP, pageStr))
return 0;
// Statically defined code pages
if (Object.prototype.hasOwnProperty.call(cptable, pageStr))
return cptable[pageStr].dec.length > 256 ? 2 : 1;
// Cached code pages
if (cptable.utils.cache.sbcs.includes(pageStr))
return 1;
if (cptable.utils.cache.dbcs.includes(pageStr))
return 2;
// Dynamically generated code pages
if (Object.prototype.hasOwnProperty.call(cptable.utils.magic, pageStr)) {
// Generate a single character and measure it
const a = cptable.utils.encode(page, "a");
return a.length;
}
return 0;
}
/**
* Unicode Normalisation Forms
*
* @author Matthieu [m@tthieu.xyz]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
/**
* Character encoding format mappings.
*/
export const UNICODE_NORMALISATION_FORMS = ["NFD", "NFC", "NFKD", "NFKC"];
+34
View File
@@ -0,0 +1,34 @@
/**
* @author n1073645 [n1073645@gmail.com]
* @copyright Crown Copyright 2020
* @license Apache-2.0
*/
export function encode(tempIVP, key, rounds, input) {
const ivp = new Uint8Array(key.concat(tempIVP));
const state = new Array(256).fill(0);
let j = 0, i = 0;
const result = [];
// Mixing states based off of IV.
for (let i = 0; i < 256; i++)
state[i] = i;
const ivpLength = ivp.length;
for (let r = 0; r < rounds; r ++) {
for (let k = 0; k < 256; k++) {
j = (j + state[k] + ivp[k % ivpLength]) % 256;
[state[k], state[j]] = [state[j], state[k]];
}
}
j = 0;
i = 0;
// XOR cipher with key.
for (let x = 0; x < input.length; x++) {
i = (++i) % 256;
j = (j + state[i]) % 256;
[state[i], state[j]] = [state[j], state[i]];
const n = (state[i] + state[j]) % 256;
result.push(state[n] ^ input[x]);
}
return result;
}
+82
View File
@@ -0,0 +1,82 @@
/**
* Cipher functions.
*
* @author Matt C [matt@artemisbot.uk]
* @author n1474335 [n1474335@gmail.com]
*
* @copyright Crown Copyright 2018
* @license Apache-2.0
*
*/
import OperationError from "../errors/OperationError.mjs";
import CryptoJS from "crypto-js";
/**
* Affine Cipher Encode operation.
*
* @author Matt C [matt@artemisbot.uk]
* @param {string} input
* @param {Object[]} args
* @returns {string}
*/
export function affineEncode(input, args) {
const alphabet = "abcdefghijklmnopqrstuvwxyz",
a = args[0],
b = args[1];
let output = "";
if (!/^\+?(0|[1-9]\d*)$/.test(a) || !/^\+?(0|[1-9]\d*)$/.test(b)) {
throw new OperationError("The values of a and b can only be integers.");
}
for (let i = 0; i < input.length; i++) {
if (alphabet.indexOf(input[i]) >= 0) {
// Uses the affine function ax+b % m = y (where m is length of the alphabet)
output += alphabet[((a * alphabet.indexOf(input[i])) + b) % 26];
} else if (alphabet.indexOf(input[i].toLowerCase()) >= 0) {
// Same as above, accounting for uppercase
output += alphabet[((a * alphabet.indexOf(input[i].toLowerCase())) + b) % 26].toUpperCase();
} else {
// Non-alphabetic characters
output += input[i];
}
}
return output;
}
/**
* Generates a polybius square for the given keyword
*
* @private
* @author Matt C [matt@artemisbot.uk]
* @param {string} keyword - Must be upper case
* @returns {string}
*/
export function genPolybiusSquare (keyword) {
const alpha = "ABCDEFGHIKLMNOPQRSTUVWXYZ",
polArray = `${keyword}${alpha}`.split("").unique(),
polybius = [];
for (let i = 0; i < 5; i++) {
polybius[i] = polArray.slice(i*5, i*5 + 5);
}
return polybius;
}
/**
* A mapping of string formats to their classes in the CryptoJS library.
*
* @private
* @constant
*/
export const format = {
"Hex": CryptoJS.enc.Hex,
"Base64": CryptoJS.enc.Base64,
"UTF8": CryptoJS.enc.Utf8,
"UTF16": CryptoJS.enc.Utf16,
"UTF16LE": CryptoJS.enc.Utf16LE,
"UTF16BE": CryptoJS.enc.Utf16BE,
"Latin1": CryptoJS.enc.Latin1,
};
+29
View File
@@ -0,0 +1,29 @@
/**
* Code resources.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2018
* @license Apache-2.0
*/
/**
* This tries to rename variable names in a code snippet according to a function.
*
* @param {string} input
* @param {function} replacer - This function will be fed the token which should be renamed.
* @returns {string}
*/
export function replaceVariableNames(input, replacer) {
const tokenRegex = /\\"|"(?:\\"|[^"])*"|(\b[a-z0-9\-_]+\b)/ig;
return input.replace(tokenRegex, (...args) => {
const match = args[0],
quotes = args[1];
if (!quotes) {
return match;
} else {
return replacer(match);
}
});
}
+417
View File
@@ -0,0 +1,417 @@
/**
* Colossus - an emulation of the world's first electronic computer
*
* @author VirtualColossus [martin@virtualcolossus.co.uk]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import {INIT_PATTERNS, ITA2_TABLE, ROTOR_SIZES} from "../lib/Lorenz.mjs";
/**
* Colossus simulator class.
*/
export class ColossusComputer {
/**
* Construct a Colossus.
*
* @param {string} ciphertext
* @param {string} pattern - named pattern of Chi, Mu and Psi wheels
* @param {Object} qbusin - which data inputs are being sent to q bus - each can be null, plain or delta
* @param {Object[]} qbusswitches - Q bus calculation switches, multiple rows
* @param {Object} control - control switches which specify stepping modes
* @param {Object} starts - rotor start positions
*/
constructor(ciphertext, pattern, qbusin, qbusswitches, control, starts, settotal, limit) {
this.ITAlookup = ITA2_TABLE;
this.ReverseITAlookup = {};
for (const letter in this.ITAlookup) {
const code = this.ITAlookup[letter];
this.ReverseITAlookup[code] = letter;
}
this.initThyratrons(pattern);
this.ciphertext = ciphertext;
this.qbusin = qbusin;
this.qbusswitches = qbusswitches;
this.control = control;
this.starts = starts;
this.settotal = settotal;
this.limitations = limit;
this.allCounters = [0, 0, 0, 0, 0];
this.Zbits = [0, 0, 0, 0, 0]; // Z input is the cipher tape
this.ZbitsOneBack = [0, 0, 0, 0, 0]; // for delta
this.Qbits = [0, 0, 0, 0, 0]; // input generated for placing onto the Q-bus (the logic processor)
this.Xbits = [0, 0, 0, 0, 0]; // X is the Chi wheel bits
this.Xptr = [0, 0, 0, 0, 0]; // pointers to the current X bits (Chi wheels)
this.XbitsOneBack = [0, 0, 0, 0, 0]; // the X bits one back (for delta)
this.Sbits = [0, 0, 0, 0, 0]; // S is the Psi wheel bits
this.Sptr = [0, 0, 0, 0, 0]; // pointers to the current S bits (Psi wheels)
this.SbitsOneBack = [0, 0, 0, 0, 0]; // the S bits one back (for delta)
this.Mptr = [0, 0];
this.rotorPtrs = {};
this.totalmotor = 0;
this.P5Zbit = [0, 0];
}
/**
* Begin a run
*
* @returns {object}
*/
run() {
const result = {
printout: ""
};
// loop until our start positions are back to the beginning
this.rotorPtrs = {X1: this.starts.X1, X2: this.starts.X2, X3: this.starts.X3, X4: this.starts.X4, X5: this.starts.X5, M61: this.starts.M61, M37: this.starts.M37, S1: this.starts.S1, S2: this.starts.S2, S3: this.starts.S3, S4: this.starts.S4, S5: this.starts.S5};
// this.rotorPtrs = this.starts;
let runcount = 1;
const fast = this.control.fast;
const slow = this.control.slow;
// Print Headers
result.printout += fast + " " + slow + "\n";
do {
this.allCounters = [0, 0, 0, 0, 0];
this.ZbitsOneBack = [0, 0, 0, 0, 0];
this.XbitsOneBack = [0, 0, 0, 0, 0];
// Run full tape loop and process counters
this.runTape();
// Only print result if larger than set total
let fastRef = "00";
let slowRef = "00";
if (fast !== "") fastRef = this.rotorPtrs[fast].toString().padStart(2, "0");
if (slow !== "") slowRef = this.rotorPtrs[slow].toString().padStart(2, "0");
let printline = "";
for (let c=0;c<5;c++) {
if (this.allCounters[c] > this.settotal) {
printline += String.fromCharCode(c+97) + this.allCounters[c]+" ";
}
}
if (printline !== "") {
result.printout += fastRef + " " + slowRef + " : ";
result.printout += printline;
result.printout += "\n";
}
// Step fast rotor if required
if (fast !== "") {
this.rotorPtrs[fast]++;
if (this.rotorPtrs[fast] > ROTOR_SIZES[fast]) this.rotorPtrs[fast] = 1;
}
// Step slow rotor if fast rotor has returned to initial start position
if (slow !== "" && this.rotorPtrs[fast] === this.starts[fast]) {
this.rotorPtrs[slow]++;
if (this.rotorPtrs[slow] > ROTOR_SIZES[slow]) this.rotorPtrs[slow] = 1;
}
runcount++;
} while (JSON.stringify(this.rotorPtrs) !== JSON.stringify(this.starts));
result.counters = this.allCounters;
result.runcount = runcount;
return result;
}
/**
* Run tape loop
*/
runTape() {
let charZin = "";
this.Xptr = [this.rotorPtrs.X1, this.rotorPtrs.X2, this.rotorPtrs.X3, this.rotorPtrs.X4, this.rotorPtrs.X5];
this.Mptr = [this.rotorPtrs.M37, this.rotorPtrs.M61];
this.Sptr = [this.rotorPtrs.S1, this.rotorPtrs.S2, this.rotorPtrs.S3, this.rotorPtrs.S4, this.rotorPtrs.S5];
// Run full loop of all character on the input tape (Z)
for (let i=0; i<this.ciphertext.length; i++) {
charZin = this.ciphertext.charAt(i);
// Firstly, we check what inputs are specified on the Q-bus input switches
this.getQbusInputs(charZin);
/*
* Pattern conditions on individual impulses. Matching patterns of bits on the Q bus.
* This is the top section on Colussus K rack - the Q bus programming switches
*/
const tmpcnt = this.runQbusProcessingConditional();
/*
* Addition of impulses.
* This is the bottom section of Colossus K rack.
*/
this.runQbusProcessingAddition(tmpcnt);
// Store Z bit impulse 5 two back required for P5 limitation
this.P5Zbit[1] = this.P5Zbit[0];
this.P5Zbit[0] = this.ITAlookup[charZin].split("")[4];
// Step rotors
this.stepThyratrons();
}
}
/**
* Step thyratron rings to simulate movement of Lorenz rotors
* Chi rotors all step one per character
* Motor M61 rotor steps one per character, M37 steps dependant on M61 setting
* Psi rotors only step dependant on M37 setting + limitation
*/
stepThyratrons() {
let X2bPtr = this.Xptr[1]-1;
if (X2bPtr===0) X2bPtr = ROTOR_SIZES.X2;
let S1bPtr = this.Sptr[0]-1;
if (S1bPtr===0) S1bPtr = ROTOR_SIZES.S1;
// Get Chi rotor 5 two back to calculate plaintext (Z+Chi+Psi=Plain)
let X5bPtr=this.Xptr[4]-1;
if (X5bPtr===0) X5bPtr=ROTOR_SIZES.X5;
X5bPtr=X5bPtr-1;
if (X5bPtr===0) X5bPtr=ROTOR_SIZES.X5;
// Get Psi rotor 5 two back to calculate plaintext (Z+Chi+Psi=Plain)
let S5bPtr=this.Sptr[4]-1;
if (S5bPtr===0) S5bPtr=ROTOR_SIZES.S5;
S5bPtr=S5bPtr-1;
if (S5bPtr===0) S5bPtr=ROTOR_SIZES.S5;
const x2sw = this.limitations.X2;
const s1sw = this.limitations.S1;
const p5sw = this.limitations.P5;
// Limitation calculations
let lim=1;
if (x2sw) lim = this.rings.X[2][X2bPtr-1];
if (s1sw) lim = lim ^ this.rings.S[1][S1bPtr-1];
// P5
if (p5sw) {
let p5lim = this.P5Zbit[1];
p5lim = p5lim ^ this.rings.X[5][X5bPtr-1];
p5lim = p5lim ^ this.rings.S[5][S5bPtr-1];
lim = lim ^ p5lim;
}
const basicmotor = this.rings.M[2][this.Mptr[0]-1];
this.totalmotor = basicmotor;
if (x2sw || s1sw) {
if (basicmotor===0 && lim===1) {
this.totalmotor = 0;
} else {
this.totalmotor = 1;
}
}
// Step Chi rotors
for (let r=0; r<5; r++) {
this.Xptr[r]++;
if (this.Xptr[r] > ROTOR_SIZES["X"+(r+1)]) this.Xptr[r] = 1;
}
if (this.totalmotor) {
// Step Psi rotors
for (let r=0; r<5; r++) {
this.Sptr[r]++;
if (this.Sptr[r] > ROTOR_SIZES["S"+(r+1)]) this.Sptr[r] = 1;
}
}
// Move M37 rotor if M61 set
if (this.rings.M[1][this.Mptr[1]-1]===1) this.Mptr[0]++;
if (this.Mptr[0] > ROTOR_SIZES.M37) this.Mptr[0]=1;
// Always move M61 rotor
this.Mptr[1]++;
if (this.Mptr[1] > ROTOR_SIZES.M61) this.Mptr[1]=1;
}
/**
* Get Q bus inputs
*/
getQbusInputs(charZin) {
// Zbits - the bits from the current character from the cipher tape.
this.Zbits = this.ITAlookup[charZin].split("");
if (this.qbusin.Z === "Z") {
// direct Z
this.Qbits = this.Zbits;
} else if (this.qbusin.Z === "ΔZ") {
// delta Z, the Bitwise XOR of this character Zbits + last character Zbits
for (let b=0;b<5;b++) {
this.Qbits[b] = this.Zbits[b] ^ this.ZbitsOneBack[b];
}
}
this.ZbitsOneBack = this.Zbits.slice(); // copy value of object, not reference
// Xbits - the current Chi wheel bits
for (let b=0;b<5;b++) {
this.Xbits[b] = this.rings.X[b+1][this.Xptr[b]-1];
}
if (this.qbusin.Chi !== "") {
if (this.qbusin.Chi === "Χ") {
// direct X added to Qbits
for (let b=0;b<5;b++) {
this.Qbits[b] = this.Qbits[b] ^ this.Xbits[b];
}
} else if (this.qbusin.Chi === "ΔΧ") {
// delta X
for (let b=0;b<5;b++) {
this.Qbits[b] = this.Qbits[b] ^ this.Xbits[b];
this.Qbits[b] = this.Qbits[b] ^ this.XbitsOneBack[b];
}
}
}
this.XbitsOneBack = this.Xbits.slice();
// Sbits - the current Psi wheel bits
for (let b=0;b<5;b++) {
this.Sbits[b] = this.rings.S[b+1][this.Sptr[b]-1];
}
if (this.qbusin.Psi !== "") {
if (this.qbusin.Psi === "Ψ") {
// direct S added to Qbits
for (let b=0;b<5;b++) {
this.Qbits[b] = this.Qbits[b] ^ this.Sbits[b];
}
} else if (this.qbusin.Psi === "ΔΨ") {
// delta S
for (let b=0;b<5;b++) {
this.Qbits[b] = this.Qbits[b] ^ this.Sbits[b];
this.Qbits[b] = this.Qbits[b] ^ this.SbitsOneBack[b];
}
}
}
this.SbitsOneBack = this.Sbits.slice();
}
/**
* Conditional impulse Q bus section
*/
runQbusProcessingConditional() {
const cnt = [-1, -1, -1, -1, -1];
const numrows = this.qbusswitches.condition.length;
for (let r=0;r<numrows;r++) {
const row = this.qbusswitches.condition[r];
if (row.Counter !== "") {
let result = true;
const cPnt = row.Counter-1;
const Qswitch = this.readBusSwitches(row.Qswitches);
// Match switches to bit pattern
for (let s=0;s<5;s++) {
if (Qswitch[s] >= 0 && Qswitch[s] !== parseInt(this.Qbits[s], 10)) result = false;
}
// Check for NOT switch
if (row.Negate) result = !result;
// AND each row to get final result
if (cnt[cPnt] === -1) {
cnt[cPnt] = result;
} else if (!result) {
cnt[cPnt] = false;
}
}
}
// Negate the whole column, this allows A OR B by doing NOT(NOT A AND NOT B)
for (let c=0;c<5;c++) {
if (this.qbusswitches.condNegateAll && cnt[c] !== -1) cnt[c] = !cnt[c];
}
return cnt;
}
/**
* Addition of impulses Q bus section
*/
runQbusProcessingAddition(cnt) {
const row = this.qbusswitches.addition[0];
const Qswitch = row.Qswitches.slice();
// To save making the arguments of this operation any larger, limiting addition counter to first one only
// Colossus could actually add into any of the five counters.
if (row.C1) {
let addition = 0;
for (let s=0;s<5;s++) {
// XOR addition
if (Qswitch[s]) {
addition = addition ^ this.Qbits[s];
}
}
const equals = (row.Equals===""?-1:(row.Equals==="."?0:1));
if (addition === equals) {
// AND with conditional rows to get final result
if (cnt[0] === -1) cnt[0] = true;
} else {
cnt[0] = false;
}
}
// Final check, check for addition section negate
// then, if any column set, from top to bottom of rack, add to counter.
for (let c=0;c<5;c++) {
if (this.qbusswitches.addNegateAll && cnt[c] !== -1) cnt[c] = !cnt[c];
if (this.qbusswitches.totalMotor === "" || (this.qbusswitches.totalMotor === "x" && this.totalmotor === 0) || (this.qbusswitches.totalMotor === "." && this.totalmotor === 1)) {
if (cnt[c] === true) this.allCounters[c]++;
}
}
}
/**
* Initialise thyratron rings
* These hold the pattern of 1s & 0s for each rotor on banks of thyraton GT1C valves which act as a one-bit store.
*/
initThyratrons(pattern) {
this.rings = {
X: {
1: INIT_PATTERNS[pattern].X[1].slice().reverse(),
2: INIT_PATTERNS[pattern].X[2].slice().reverse(),
3: INIT_PATTERNS[pattern].X[3].slice().reverse(),
4: INIT_PATTERNS[pattern].X[4].slice().reverse(),
5: INIT_PATTERNS[pattern].X[5].slice().reverse()
},
M: {
1: INIT_PATTERNS[pattern].M[1].slice().reverse(),
2: INIT_PATTERNS[pattern].M[2].slice().reverse(),
},
S: {
1: INIT_PATTERNS[pattern].S[1].slice().reverse(),
2: INIT_PATTERNS[pattern].S[2].slice().reverse(),
3: INIT_PATTERNS[pattern].S[3].slice().reverse(),
4: INIT_PATTERNS[pattern].S[4].slice().reverse(),
5: INIT_PATTERNS[pattern].S[5].slice().reverse()
}
};
}
/**
* Read argument bus switches X & . and convert to 1 & 0
*/
readBusSwitches(row) {
const output = [-1, -1, -1, -1, -1];
for (let c=0;c<5;c++) {
if (row[c]===".") output[c] = 0;
if (row[c]==="x") output[c] = 1;
}
return output;
}
}
+668
View File
@@ -0,0 +1,668 @@
/**
* Co-ordinate conversion resources.
*
* @author j433866 [j433866@gmail.com]
* @copyright Crown Copyright 2019
* @license Apache-2.0
*/
import OperationError from "../errors/OperationError.mjs";
import geohash from "ngeohash";
/*
Currently unable to update to geodesy v2 as we cannot load .js modules into a .mjs file.
When we do update, imports will look like this:
import LatLonEllipsoidal from "geodesy/latlon-ellipsoidal.js";
import Mgrs from "geodesy/mgrs.js";
import OsGridRef from "geodesy/osgridref.js";
import Utm from "geodesy/utm.js";
*/
import geodesy from "geodesy";
const LatLonEllipsoidal = geodesy.LatLonEllipsoidal,
Mgrs = geodesy.Mgrs,
OsGridRef = geodesy.OsGridRef,
Utm = geodesy.Utm;
/**
* Co-ordinate formats
*/
export const FORMATS = [
"Degrees Minutes Seconds",
"Degrees Decimal Minutes",
"Decimal Degrees",
"Geohash",
"Military Grid Reference System",
"Ordnance Survey National Grid",
"Universal Transverse Mercator"
];
/**
* Formats that should be passed to the conversion module as-is
*/
const NO_CHANGE = [
"Geohash",
"Military Grid Reference System",
"Ordnance Survey National Grid",
"Universal Transverse Mercator",
];
/**
* Convert a given latitude and longitude into a different format.
*
* @param {string} input - Input string to be converted
* @param {string} inFormat - Format of the input coordinates
* @param {string} inDelim - The delimiter splitting the lat/long of the input
* @param {string} outFormat - Format to convert to
* @param {string} outDelim - The delimiter to separate the output with
* @param {string} includeDir - Whether or not to include the compass direction in the output
* @param {number} precision - Precision of the result
* @returns {string} A formatted string of the converted co-ordinates
*/
export function convertCoordinates (input, inFormat, inDelim, outFormat, outDelim, includeDir, precision) {
let isPair = false,
split,
latlon,
convLat,
convLon,
conv,
hash,
utm,
mgrs,
osng,
splitLat,
splitLong,
lat,
lon;
// Can't have a precision less than 0!
if (precision < 0) {
precision = 0;
}
if (inDelim === "Auto") {
// Try to detect a delimiter in the input.
inDelim = findDelim(input);
if (inDelim === null) {
throw new OperationError("Unable to detect the input delimiter automatically.");
}
} else if (!inDelim.includes("Direction")) {
// Convert the delimiter argument value to the actual character
inDelim = realDelim(inDelim);
}
if (inFormat === "Auto") {
// Try to detect the format of the input data
inFormat = findFormat(input, inDelim);
if (inFormat === null) {
throw new OperationError("Unable to detect the input format automatically.");
}
}
// Convert the output delimiter argument to the real character
outDelim = realDelim(outDelim);
if (!NO_CHANGE.includes(inFormat)) {
if (inDelim.includes("Direction")) {
// Split on directions
split = input.split(/[NnEeSsWw]/g);
if (split[0] === "") {
// Remove first element if direction preceding
split = split.slice(1);
}
} else {
split = input.split(inDelim);
}
// Replace any co-ordinate symbols with spaces so we can split on them later
for (let i = 0; i < split.length; i++) {
split[i] = split[i].replace(/[°˝´'"]/g, " ");
}
if (split.length > 1) {
isPair = true;
}
} else {
// Remove any delimiters from the input
input = input.replace(inDelim, "");
isPair = true;
}
// Conversions from the input format into a geodesy latlon object
switch (inFormat) {
case "Geohash":
hash = geohash.decode(input.replace(/[^A-Za-z0-9]/g, ""));
latlon = new LatLonEllipsoidal(hash.latitude, hash.longitude);
break;
case "Military Grid Reference System":
utm = Mgrs.parse(input.replace(/[^A-Za-z0-9]/g, "")).toUtm();
latlon = utm.toLatLonE();
break;
case "Ordnance Survey National Grid":
osng = OsGridRef.parse(input.replace(/[^A-Za-z0-9]/g, ""));
latlon = OsGridRef.osGridToLatLon(osng);
break;
case "Universal Transverse Mercator":
// Geodesy needs a space between the first 2 digits and the next letter
if (/^[\d]{2}[A-Za-z]/.test(input)) {
input = input.slice(0, 2) + " " + input.slice(2);
}
utm = Utm.parse(input);
latlon = utm.toLatLonE();
break;
case "Degrees Minutes Seconds":
if (isPair) {
// Split up the lat/long into degrees / minutes / seconds values
splitLat = splitInput(split[0]);
splitLong = splitInput(split[1]);
if (splitLat.length >= 3 && splitLong.length >= 3) {
lat = convDMSToDD(splitLat[0], splitLat[1], splitLat[2], 10);
lon = convDMSToDD(splitLong[0], splitLong[1], splitLong[2], 10);
latlon = new LatLonEllipsoidal(lat.degrees, lon.degrees);
} else {
throw new OperationError("Invalid co-ordinate format for Degrees Minutes Seconds");
}
} else {
// Not a pair, so only try to convert one set of co-ordinates
splitLat = splitInput(split[0]);
if (splitLat.length >= 3) {
lat = convDMSToDD(splitLat[0], splitLat[1], splitLat[2]);
latlon = new LatLonEllipsoidal(lat.degrees, lat.degrees);
} else {
throw new OperationError("Invalid co-ordinate format for Degrees Minutes Seconds");
}
}
break;
case "Degrees Decimal Minutes":
if (isPair) {
splitLat = splitInput(split[0]);
splitLong = splitInput(split[1]);
if (splitLat.length !== 2 || splitLong.length !== 2) {
throw new OperationError("Invalid co-ordinate format for Degrees Decimal Minutes.");
}
// Convert to decimal degrees, and then convert to a geodesy object
lat = convDDMToDD(splitLat[0], splitLat[1], 10);
lon = convDDMToDD(splitLong[0], splitLong[1], 10);
latlon = new LatLonEllipsoidal(lat.degrees, lon.degrees);
} else {
// Not a pair, so only try to convert one set of co-ordinates
splitLat = splitInput(input);
if (splitLat.length !== 2) {
throw new OperationError("Invalid co-ordinate format for Degrees Decimal Minutes.");
}
lat = convDDMToDD(splitLat[0], splitLat[1], 10);
latlon = new LatLonEllipsoidal(lat.degrees, lat.degrees);
}
break;
case "Decimal Degrees":
if (isPair) {
splitLat = splitInput(split[0]);
splitLong = splitInput(split[1]);
if (splitLat.length !== 1 || splitLong.length !== 1) {
throw new OperationError("Invalid co-ordinate format for Decimal Degrees.");
}
latlon = new LatLonEllipsoidal(splitLat[0], splitLong[0]);
} else {
// Not a pair, so only try to convert one set of co-ordinates
splitLat = splitInput(split[0]);
if (splitLat.length !== 1) {
throw new OperationError("Invalid co-ordinate format for Decimal Degrees.");
}
latlon = new LatLonEllipsoidal(splitLat[0], splitLat[0]);
}
break;
default:
throw new OperationError(`Unknown input format '${inFormat}'`);
}
// Everything is now a geodesy latlon object
// These store the latitude and longitude as decimal
if (inFormat.includes("Degrees")) {
// If the input string contains directions, we need to check if they're S or W.
// If either of the directions are, we should make the decimal value negative
const dirs = input.toUpperCase().match(/[NESW]/g);
if (dirs && dirs.length >= 1) {
// Make positive lat/lon values with S/W directions into negative values
if (dirs[0] === "S" || dirs[0] === "W" && latlon.lat > 0) {
latlon.lat = -latlon.lat;
}
if (dirs.length >= 2) {
if (dirs[1] === "S" || dirs[1] === "W" && latlon.lon > 0) {
latlon.lon = -latlon.lon;
}
}
}
}
// Try to find the compass directions of the lat and long
const [latDir, longDir] = findDirs(latlon.lat + "," + latlon.lon, ",");
// Output conversions for each output format
switch (outFormat) {
case "Decimal Degrees":
// We could use the built in latlon.toString(),
// but this makes adjusting the output harder
lat = convDDToDD(latlon.lat, precision);
lon = convDDToDD(latlon.lon, precision);
convLat = lat.string;
convLon = lon.string;
break;
case "Degrees Decimal Minutes":
lat = convDDToDDM(latlon.lat, precision);
lon = convDDToDDM(latlon.lon, precision);
convLat = lat.string;
convLon = lon.string;
break;
case "Degrees Minutes Seconds":
lat = convDDToDMS(latlon.lat, precision);
lon = convDDToDMS(latlon.lon, precision);
convLat = lat.string;
convLon = lon.string;
break;
case "Geohash":
convLat = geohash.encode(latlon.lat, latlon.lon, precision);
break;
case "Military Grid Reference System":
utm = latlon.toUtm();
mgrs = utm.toMgrs();
// MGRS wants a precision that's an even number between 2 and 10
if (precision % 2 !== 0) {
precision = precision + 1;
}
if (precision > 10) {
precision = 10;
}
convLat = mgrs.toString(precision);
break;
case "Ordnance Survey National Grid":
osng = OsGridRef.latLonToOsGrid(latlon);
if (osng.toString() === "") {
throw new OperationError("Could not convert co-ordinates to OS National Grid. Are the co-ordinates in range?");
}
// OSNG wants a precision that's an even number between 2 and 10
if (precision % 2 !== 0) {
precision = precision + 1;
}
if (precision > 10) {
precision = 10;
}
convLat = osng.toString(precision);
break;
case "Universal Transverse Mercator":
utm = latlon.toUtm();
convLat = utm.toString(precision);
break;
}
if (convLat === undefined) {
throw new OperationError("Error converting co-ordinates.");
}
if (outFormat.includes("Degrees")) {
// Format DD/DDM/DMS for output
// If we're outputting a compass direction, remove the negative sign
if (latDir === "S" && includeDir !== "None") {
convLat = convLat.replace("-", "");
}
if (longDir === "W" && includeDir !== "None") {
convLon = convLon.replace("-", "");
}
let outConv = "";
if (includeDir === "Before") {
outConv += latDir + " ";
}
outConv += convLat;
if (includeDir === "After") {
outConv += " " + latDir;
}
outConv += outDelim;
if (isPair) {
if (includeDir === "Before") {
outConv += longDir + " ";
}
outConv += convLon;
if (includeDir === "After") {
outConv += " " + longDir;
}
outConv += outDelim;
}
conv = outConv;
} else {
conv = convLat + outDelim;
}
return conv;
}
/**
* Split up the input using a space or degrees signs, and sanitise the result
*
* @param {string} input - The input data to be split
* @returns {number[]} An array of the different items in the string, stored as floats
*/
function splitInput (input) {
const split = [];
input.split(/\s+/).forEach(item => {
// Remove any character that isn't a digit, decimal point or negative sign
item = item.replace(/[^0-9.-]/g, "");
if (item.length > 0) {
// Turn the item into a float
split.push(parseFloat(item));
}
});
return split;
}
/**
* Convert Degrees Minutes Seconds to Decimal Degrees
*
* @param {number} degrees - The degrees of the input co-ordinates
* @param {number} minutes - The minutes of the input co-ordinates
* @param {number} seconds - The seconds of the input co-ordinates
* @param {number} precision - The precision the result should be rounded to
* @returns {{string: string, degrees: number}} An object containing the raw converted value (obj.degrees), and a formatted string version (obj.string)
*/
function convDMSToDD (degrees, minutes, seconds, precision) {
const absDegrees = Math.abs(degrees);
let conv = absDegrees + (minutes / 60) + (seconds / 3600);
let outString = round(conv, precision) + "°";
if (isNegativeZero(degrees) || degrees < 0) {
conv = -conv;
outString = "-" + outString;
}
return {
"degrees": conv,
"string": outString
};
}
/**
* Convert Decimal Degrees Minutes to Decimal Degrees
*
* @param {number} degrees - The input degrees to be converted
* @param {number} minutes - The input minutes to be converted
* @param {number} precision - The precision which the result should be rounded to
* @returns {{string: string, degrees: number}} An object containing the raw converted value (obj.degrees), and a formatted string version (obj.string)
*/
function convDDMToDD (degrees, minutes, precision) {
const absDegrees = Math.abs(degrees);
let conv = absDegrees + minutes / 60;
let outString = round(conv, precision) + "°";
if (isNegativeZero(degrees) || degrees < 0) {
conv = -conv;
outString = "-" + outString;
}
return {
"degrees": conv,
"string": outString
};
}
/**
* Convert Decimal Degrees to Decimal Degrees
*
* Doesn't affect the input, just puts it into an object
* @param {number} degrees - The input degrees to be converted
* @param {number} precision - The precision which the result should be rounded to
* @returns {{string: string, degrees: number}} An object containing the raw converted value (obj.degrees), and a formatted string version (obj.string)
*/
function convDDToDD (degrees, precision) {
return {
"degrees": degrees,
"string": round(degrees, precision) + "°"
};
}
/**
* Convert Decimal Degrees to Degrees Minutes Seconds
*
* @param {number} decDegrees - The input data to be converted
* @param {number} precision - The precision which the result should be rounded to
* @returns {{string: string, degrees: number, minutes: number, seconds: number}} An object containing the raw converted value as separate numbers (.degrees, .minutes, .seconds), and a formatted string version (obj.string)
*/
function convDDToDMS (decDegrees, precision) {
const absDegrees = Math.abs(decDegrees);
let degrees = Math.floor(absDegrees);
const minutes = Math.floor(60 * (absDegrees - degrees)),
seconds = round(3600 * (absDegrees - degrees) - 60 * minutes, precision);
let outString = degrees + "° " + minutes + "' " + seconds + "\"";
if (isNegativeZero(decDegrees) || decDegrees < 0) {
degrees = -degrees;
outString = "-" + outString;
}
return {
"degrees": degrees,
"minutes": minutes,
"seconds": seconds,
"string": outString
};
}
/**
* Convert Decimal Degrees to Degrees Decimal Minutes
*
* @param {number} decDegrees - The input degrees to be converted
* @param {number} precision - The precision the input data should be rounded to
* @returns {{string: string, degrees: number, minutes: number}} An object containing the raw converted value as separate numbers (.degrees, .minutes), and a formatted string version (obj.string)
*/
function convDDToDDM (decDegrees, precision) {
const absDegrees = Math.abs(decDegrees);
let degrees = Math.floor(absDegrees);
const minutes = absDegrees - degrees,
decMinutes = round(minutes * 60, precision);
let outString = degrees + "° " + decMinutes + "'";
if (decDegrees < 0 || isNegativeZero(decDegrees)) {
degrees = -degrees;
outString = "-" + outString;
}
return {
"degrees": degrees,
"minutes": decMinutes,
"string": outString,
};
}
/**
* Finds and returns the compass directions in an input string
*
* @param {string} input - The input co-ordinates containing the direction
* @param {string} delim - The delimiter separating latitide and longitude
* @returns {string[]} String array containing the latitude and longitude directions
*/
export function findDirs(input, delim) {
const upperInput = input.toUpperCase();
const dirExp = new RegExp(/[NESW]/g);
const dirs = upperInput.match(dirExp);
if (dirs) {
// If there's actually compass directions
// in the input, use these to work out the direction
if (dirs.length <= 2 && dirs.length >= 1) {
return dirs.length === 2 ? [dirs[0], dirs[1]] : [dirs[0], ""];
}
}
// Nothing was returned, so guess the directions
let lat = upperInput,
long,
latDir = "",
longDir = "";
if (!delim.includes("Direction")) {
if (upperInput.includes(delim)) {
const split = upperInput.split(delim);
if (split.length >= 1) {
if (split[0] !== "") {
lat = split[0];
}
if (split.length >= 2 && split[1] !== "") {
long = split[1];
}
}
}
} else {
const split = upperInput.split(dirExp);
if (split.length > 1) {
lat = split[0] === "" ? split[1] : split[0];
if (split.length > 2 && split[2] !== "") {
long = split[2];
}
}
}
if (lat) {
lat = parseFloat(lat);
latDir = lat < 0 ? "S" : "N";
}
if (long) {
long = parseFloat(long);
longDir = long < 0 ? "W" : "E";
}
return [latDir, longDir];
}
/**
* Detects the co-ordinate format of the input data
*
* @param {string} input - The input data whose format we need to detect
* @param {string} delim - The delimiter separating the data in input
* @returns {string} The input format
*/
export function findFormat (input, delim) {
let testData;
const mgrsPattern = new RegExp(/^[0-9]{2}\s?[C-HJ-NP-X]{1}\s?[A-HJ-NP-Z][A-HJ-NP-V]\s?[0-9\s]+/),
osngPattern = new RegExp(/^[A-HJ-Z]{2}\s+[0-9\s]+$/),
geohashPattern = new RegExp(/^[0123456789BCDEFGHJKMNPQRSTUVWXYZ]+$/),
utmPattern = new RegExp(/^[0-9]{2}\s?[C-HJ-NP-X]\s[0-9.]+\s?[0-9.]+$/),
degPattern = new RegExp(/[°'"]/g);
input = input.trim();
if (delim !== null && delim.includes("Direction")) {
const split = input.split(/[NnEeSsWw]/);
if (split.length > 1) {
testData = split[0] === "" ? split[1] : split[0];
}
} else if (delim !== null && delim !== "") {
if (input.includes(delim)) {
const split = input.split(delim);
if (split.length > 1) {
testData = split[0] === "" ? split[1] : split[0];
}
} else {
testData = input;
}
}
// Test non-degrees formats
if (!degPattern.test(input)) {
const filteredInput = input.toUpperCase().replace(delim, "");
if (utmPattern.test(filteredInput)) {
return "Universal Transverse Mercator";
}
if (mgrsPattern.test(filteredInput)) {
return "Military Grid Reference System";
}
if (osngPattern.test(filteredInput)) {
return "Ordnance Survey National Grid";
}
if (geohashPattern.test(filteredInput)) {
return "Geohash";
}
}
// Test DMS/DDM/DD formats
if (testData !== undefined) {
const split = splitInput(testData);
switch (split.length) {
case 3:
return "Degrees Minutes Seconds";
case 2:
return "Degrees Decimal Minutes";
case 1:
return "Decimal Degrees";
}
}
return null;
}
/**
* Automatically find the delimeter type from the given input
*
* @param {string} input
* @returns {string} Delimiter type
*/
export function findDelim (input) {
input = input.trim();
const delims = [",", ";", ":"];
const testDir = input.match(/[NnEeSsWw]/g);
if (testDir !== null && testDir.length > 0 && testDir.length < 3) {
// Possibly contains a direction
const splitInput = input.split(/[NnEeSsWw]/);
if (splitInput.length <= 3 && splitInput.length > 0) {
// If there's 3 splits (one should be empty), then assume we have directions
if (splitInput[0] === "") {
return "Direction Preceding";
} else if (splitInput[splitInput.length - 1] === "") {
return "Direction Following";
}
}
}
// Loop through the standard delimiters, and try to find them in the input
for (let i = 0; i < delims.length; i++) {
const delim = delims[i];
if (input.includes(delim)) {
const splitInput = input.split(delim);
if (splitInput.length <= 3 && splitInput.length > 0) {
// Don't want to try and convert more than 2 co-ordinates
return delim;
}
}
}
return null;
}
/**
* Gets the real string for a delimiter name.
*
* @param {string} delim The delimiter to be matched
* @returns {string}
*/
export function realDelim (delim) {
return {
"Auto": "Auto",
"Space": " ",
"\\n": "\n",
"Comma": ",",
"Semi-colon": ";",
"Colon": ":"
}[delim];
}
/**
* Returns true if a zero is negative
*
* @param {number} zero
* @returns {boolean}
*/
function isNegativeZero(zero) {
return zero === 0 && (1/zero < 0);
}
/**
* Rounds a number to a specified number of decimal places
*
* @param {number} input - The number to be rounded
* @param {precision} precision - The number of decimal places the number should be rounded to
* @returns {number}
*/
function round(input, precision) {
precision = Math.pow(10, precision);
return Math.round(input * precision) / precision;
}
+9
View File
@@ -0,0 +1,9 @@
/**
* Crypt resources.
*
* @author n1474335 [n1474335@gmail.com]
* @copyright Crown Copyright 2021
* @license Apache-2.0
*/
export const cryptNotice = "WARNING: Cryptographic operations in CyberChef should not be relied upon to provide security in any situation. No guarantee is offered for their correctness. We advise you not to use keys generated from CyberChef in operational contexts.";
Loaded 100 of 895 files, more files were not shown because too many files have changed in this diff. Show more