diff --git a/.gitignore b/.gitignore index 482be5c7..93f13619 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ node_modules npm-debug.log -build/dev -docs/* -!docs/*.conf.json -!docs/*.ico diff --git a/build/prod/.htaccess b/.htaccess similarity index 100% rename from build/prod/.htaccess rename to .htaccess diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100755 index 2963e138..00000000 --- a/Gruntfile.js +++ /dev/null @@ -1,444 +0,0 @@ -module.exports = function(grunt) { - grunt.file.defaultEncoding = "utf8"; - grunt.file.preserveBOM = false; - - // Tasks - grunt.registerTask("dev", - "A persistent task which creates a development build whenever source files are modified.", - ["clean:dev", "concat:css", "concat:js", "copy:html_dev", "copy:static_dev", "chmod:build", "watch"]); - - grunt.registerTask("prod", - "Creates a production-ready build. Use the --msg flag to add a compile message.", - ["jshint", "exec:stats", "clean", "jsdoc", "concat", "copy", "cssmin", "uglify:prod", "inline", "htmlmin", "chmod"]); - - grunt.registerTask("docs", - "Compiles documentation in the /docs directory.", - ["clean:docs", "jsdoc", "chmod:docs"]); - - grunt.registerTask("stats", - "Provides statistics about the code base such as how many lines there are as well as details of file sizes before and after compression.", - ["concat:js", "uglify:prod", "exec:stats", "exec:repo_size", "exec:display_stats"]); - - grunt.registerTask("default", - "Lints the code base and shows stats", - ["jshint", "exec:stats", "exec:display_stats"]); - - grunt.registerTask("doc", "docs"); - grunt.registerTask("lint", "jshint"); - - - // Load tasks provided by each plugin - grunt.loadNpmTasks("grunt-contrib-jshint"); - grunt.loadNpmTasks("grunt-jsdoc"); - grunt.loadNpmTasks("grunt-contrib-clean"); - grunt.loadNpmTasks("grunt-contrib-concat"); - grunt.loadNpmTasks("grunt-contrib-copy"); - grunt.loadNpmTasks("grunt-contrib-uglify"); - grunt.loadNpmTasks("grunt-contrib-cssmin"); - grunt.loadNpmTasks("grunt-contrib-htmlmin"); - grunt.loadNpmTasks("grunt-inline-alt"); - grunt.loadNpmTasks("grunt-chmod"); - grunt.loadNpmTasks("grunt-exec"); - grunt.loadNpmTasks("grunt-contrib-watch"); - - - // JS includes - var js_files = [ - // Third party framework libraries - "src/js/lib/jquery-2.1.1.js", - "src/js/lib/bootstrap-3.3.6.js", - "src/js/lib/split.js", - "src/js/lib/bootstrap-switch.js", - "src/js/lib/yahoo.js", - "src/js/lib/snowfall.jquery.js", - - // Third party operation libraries - "src/js/lib/cryptojs/core.js", - "src/js/lib/cryptojs/x64-core.js", - "src/js/lib/cryptojs/enc-base64.js", - "src/js/lib/cryptojs/enc-utf16.js", - "src/js/lib/cryptojs/md5.js", - "src/js/lib/cryptojs/evpkdf.js", - "src/js/lib/cryptojs/cipher-core.js", - "src/js/lib/cryptojs/mode-cfb.js", - "src/js/lib/cryptojs/mode-ctr-gladman.js", - "src/js/lib/cryptojs/mode-ctr.js", - "src/js/lib/cryptojs/mode-ecb.js", - "src/js/lib/cryptojs/mode-ofb.js", - "src/js/lib/cryptojs/format-hex.js", - "src/js/lib/cryptojs/lib-typedarrays.js", - "src/js/lib/cryptojs/pad-ansix923.js", - "src/js/lib/cryptojs/pad-iso10126.js", - "src/js/lib/cryptojs/pad-iso97971.js", - "src/js/lib/cryptojs/pad-nopadding.js", - "src/js/lib/cryptojs/pad-zeropadding.js", - "src/js/lib/cryptojs/aes.js", - "src/js/lib/cryptojs/hmac.js", - "src/js/lib/cryptojs/rabbit-legacy.js", - "src/js/lib/cryptojs/rabbit.js", - "src/js/lib/cryptojs/ripemd160.js", - "src/js/lib/cryptojs/sha1.js", - "src/js/lib/cryptojs/sha256.js", - "src/js/lib/cryptojs/sha224.js", - "src/js/lib/cryptojs/sha512.js", - "src/js/lib/cryptojs/sha384.js", - "src/js/lib/cryptojs/sha3.js", - "src/js/lib/cryptojs/tripledes.js", - "src/js/lib/cryptojs/rc4.js", - "src/js/lib/cryptojs/pbkdf2.js", - "src/js/lib/jsbn/jsbn.js", - "src/js/lib/jsbn/jsbn2.js", - "src/js/lib/jsbn/base64.js", - "src/js/lib/jsbn/ec.js", - "src/js/lib/jsbn/prng4.js", - "src/js/lib/jsbn/rng.js", - "src/js/lib/jsbn/rsa.js", - "src/js/lib/jsbn/sec.js", - "src/js/lib/jsrasign/asn1-1.0.js", - "src/js/lib/jsrasign/asn1hex-1.1.js", - "src/js/lib/jsrasign/asn1x509-1.0.js", - "src/js/lib/jsrasign/base64x-1.1.js", - "src/js/lib/jsrasign/crypto-1.1.js", - "src/js/lib/jsrasign/dsa-modified-1.0.js", - "src/js/lib/jsrasign/ecdsa-modified-1.0.js", - "src/js/lib/jsrasign/ecparam-1.0.js", - "src/js/lib/jsrasign/keyutil-1.0.js", - "src/js/lib/jsrasign/x509-1.1.js", - "src/js/lib/blowfish.dojo.js", - "src/js/lib/rawdeflate.js", - "src/js/lib/rawinflate.js", - "src/js/lib/zip.js", - "src/js/lib/unzip.js", - "src/js/lib/zlib_and_gzip.js", - "src/js/lib/bzip2.js", - "src/js/lib/punycode.js", - "src/js/lib/uas_parser.js", - "src/js/lib/esprima.js", - "src/js/lib/escodegen.browser.js", - "src/js/lib/esmangle.min.js", - "src/js/lib/diff.js", - "src/js/lib/moment.js", - "src/js/lib/moment-timezone.js", - "src/js/lib/prettify.js", - "src/js/lib/vkbeautify.js", - "src/js/lib/Sortable.js", - "src/js/lib/bootstrap-colorpicker.js", - - // Custom libraries - "src/js/lib/canvas_components.js", - - // Utility functions - "src/js/core/Utils.js", - - // Operation objects - "src/js/operations/*.js", - - // Core framework objects - "src/js/core/*.js", - "src/js/config/Categories.js", - "src/js/config/OperationConfig.js", - - // HTML view objects - "src/js/views/html/*.js", - "!src/js/views/html/main.js", - - // Start the app! - "src/js/views/html/main.js", - ]; - - var banner = '/**\n\ - * CyberChef - The Cyber Swiss Army Knife\n\ - *\n\ - * @copyright Crown Copyright 2016\n\ - * @license Apache-2.0\n\ - *\n\ - * Copyright 2016 Crown Copyright\n\ - *\n\ - * Licensed under the Apache License, Version 2.0 (the "License");\n\ - * you may not use this file except in compliance with the License.\n\ - * You may obtain a copy of the License at\n\ - *\n\ - * http://www.apache.org/licenses/LICENSE-2.0\n\ - *\n\ - * Unless required by applicable law or agreed to in writing, software\n\ - * distributed under the License is distributed on an "AS IS" BASIS,\n\ - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\ - * See the License for the specific language governing permissions and\n\ - * limitations under the License.\n\ - */\n'; - - var template_options = { - data: { - compile_msg: grunt.option("compile-msg") || grunt.option("msg") || "", - codebase_stats: grunt.file.read("src/static/stats.txt").split("\n").join("
") - } - }; - - // Project configuration - grunt.initConfig({ - jshint: { - options: { - jshintrc: "src/js/.jshintrc" - }, - gruntfile: ["Gruntfile.js"], - core: ["src/js/core/**/*.js"], - config: ["src/js/config/**/*.js"], - views: ["src/js/views/**/*.js"], - operations: ["src/js/operations/**/*.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/**/*.js", - "!src/js/lib/**/*", - ], - } - }, - clean: { - dev: ["build/dev/*"], - prod: ["build/prod/*"], - docs: ["docs/*", "!docs/*.conf.json", "!docs/*.ico"], - }, - concat: { - options: { - process: template_options - }, - css: { - options: { - banner: banner.replace(/\/\*\*/g, "/*!"), - process: function(content, srcpath) { - // Change special comments from /** to /*! to comply with cssmin - content = content.replace(/^\/\*\* /g, "/*! "); - return grunt.template.process(content); - } - }, - src: [ - "src/css/lib/**/*.css", - "src/css/structure/**/*.css", - "src/css/themes/classic.css" - ], - dest: "build/dev/styles.css" - }, - js: { - options: { - banner: '"use strict";\n' - }, - src: js_files, - dest: "build/dev/scripts.js" - } - }, - copy: { - html_dev: { - options: { - process: function(content, srcpath) { - return grunt.template.process(content, template_options); - } - }, - src: "src/html/index.html", - dest: "build/dev/index.html" - }, - html_prod: { - options: { - process: function(content, srcpath) { - return grunt.template.process(content, template_options); - } - }, - src: "src/html/index.html", - dest: "build/prod/index.html" - }, - html_inline: { - options: { - process: function(content, srcpath) { - // TODO: Do all this in Jade - content = content.replace( - 'Download CyberChef', - 'Compile time: ' + grunt.template.today("dd/mm/yyyy HH:MM:ss") + ' UTC'); - return grunt.template.process(content, template_options); - } - }, - src: "src/html/index.html", - dest: "build/prod/cyberchef.htm" - }, - static_dev: { - files: [ - { - expand: true, - cwd: "src/static/", - src: [ - "**/*", - "**/.*", - "!stats.txt" - ], - dest: "build/dev/" - } - ] - }, - static_prod: { - files: [ - { - expand: true, - cwd: "src/static/", - src: [ - "**/*", - "**/.*", - "!stats.txt" - ], - dest: "build/prod/" - } - ] - } - }, - uglify: { - options: { - preserveComments: function(node, comment) { - if (comment.value.indexOf("* @license") === 0) return true; - return false; - }, - screwIE8: true, - ASCIIOnly: true, - beautify: { - beautify: false, - inline_script: true, - ascii_only: true, - screw_ie8: true - }, - compress: { - screw_ie8: true - }, - banner: banner - }, - prod: { - src: "build/dev/scripts.js", - dest: "build/prod/scripts.js" - } - }, - cssmin: { - prod: { - src: "build/dev/styles.css", - dest: "build/prod/styles.css" - } - }, - htmlmin: { - prod: { - options: { - removeComments: true, - collapseWhitespace: true, - minifyJS: true, - minifyCSS: true - }, - src: "build/prod/index.html", - dest: "build/prod/index.html" - }, - inline: { - options: { - removeComments: true, - collapseWhitespace: true, - minifyJS: false, - minifyCSS: false - }, - src: "build/prod/cyberchef.htm", - dest: "build/prod/cyberchef.htm" - } - }, - inline: { - options: { - tag: "", - inlineTagAttributes: { - js: "type='application/javascript'", - css: "type='text/css'" - } - }, - prod: { - src: "build/prod/cyberchef.htm", - dest: "build/prod/cyberchef.htm" - } - }, - chmod: { - build: { - options: { - mode: "755", - }, - src: ["build/**/*", "build/**/.htaccess", "build/"] - }, - docs: { - options: { - mode: "755", - }, - src: ["docs/**/*", "docs/"] - } - }, - exec: { - repo_size: { - command: [ - "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 - }, - stats: { - command: "rm src/static/stats.txt;" + - [ - "ls src/ -R1 | grep '^$' -v | grep ':$' -v | wc -l | xargs printf '%b\tsource files\n'", - "find src/ -regex '.*\..*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "du -hs src/ | pcregrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "ls src/js/ -R1 | grep '\.js$' | wc -l | xargs printf '\n%b\tJavaScript source files\n'", - "find src/js/ -regex '.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "find src/js/ -regex '.*/lib/.*\.js' -print | wc -l | xargs printf '\n%b\tthird party JavaScript source files\n'", - "find src/js/ -regex '.*/lib/.*\.js' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*/lib/.*\.js' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | wc -l | xargs printf '\n%b\tfirst party JavaScript source files\n'", - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -print | xargs cat | wc -l | xargs printf '%b\tlines\n'", - "find src/js/ -regex '.*\.js' -not -regex '.*/lib/.*' -exec du -hcs {} \+ | tail -n1 | egrep -o '^[^\t]*' | xargs printf '%b\tsize\n'", - - "du build/dev/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '\n%b\tuncompressed JavaScript size\n'", - "du build/prod/scripts.js -h | egrep -o '^[^\t]*' | xargs printf '%b\tcompressed JavaScript size\n'", - - "grep -E '^\\s+name: ' src/js/config/Categories.js | wc -l | xargs printf '\n%b\tcategories\n'", - "grep -E '^\\s+\"[A-Za-z0-9 \\-]+\": {' src/js/config/OperationConfig.js | wc -l | xargs printf '%b\toperations\n'", - - ].join(" >> src/static/stats.txt;") + " >> src/static/stats.txt;", - stderr: false - }, - display_stats: { - command: "cat src/static/stats.txt" - }, - clean_git: { - command: "git gc --prune=now --aggressive" - }, - }, - watch: { - css: { - files: "src/css/**/*.css", - tasks: ["concat:css", "chmod:build"] - }, - js: { - files: "src/js/**/*.js", - tasks: ["concat:js_all", "chmod:build"] - }, - html: { - files: "src/html/**/*.html", - tasks: ["copy:html_dev", "chmod:build"] - }, - static: { - files: ["src/static/**/*", "src/static/**/.*"], - tasks: ["copy:static_dev", "chmod:build"] - }, - grunt: { - files: "Gruntfile.js", - tasks: ["clean:dev", "concat:css", "concat:js_all", "copy:html_dev", "copy:static_dev", "chmod:build"] - } - }, - }); - -}; diff --git a/README.md b/README.md deleted file mode 100755 index c49873d6..00000000 --- a/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# CyberChef - -####*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 creating hexdumps, simple encoding like XOR or Base64, more complex encryption like AES, DES and Blowfish, data compression and decompression, calculating hashes and checksums, IPv6 and X.509 parsing, 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 and the code has not been peer-reviewed for compliance with a formal specification. - -## Live demo - -CyberChef is still under active development. As a result, it shouldn't be considered a finished product. There is still testing and bug fixing to do, new features to be added and additional documentation to write. Please contribute! - -Cryptographic operations in CyberChef should not be relied upon to provide security in any situation. No guarantee is offered for their correctness. - -[A live demo can be found here][1] - have fun! -Note: Use Chrome or Firefox, see the Browser Support section below for details. - - -## How it works - -There are four main areas in CyberChef: - - 1. The **input** box in the top right, where you can paste, type or drag the data you want to operate on. - 2. The **output** box in the bottom right, where the outcome of the specified processing will be displayed. - 3. The **operations** list on the far left, where you can find all the operations that CyberChef is capable of in categorised lists, or by searching. - 4. The **recipe** area in the middle, where you drag the operations that you want to use and specify arguments and options. - -You can use as many operations as you like in simple or complex ways. Some examples are as follows: - - - [Decode a Base64-encoded string][2] - - [Convert a date and time to a different time zone][3] - - [Parse a Teredo IPv6 address][4] - - [Convert data from a hexdump, then decompress][5] - - [Display multiple timestamps as full dates][6] - - [Carry out different operations on data of different types][7] - - -## 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. - - 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). - - If any bake takes longer than 200 milliseconds, auto bake will be switched off automatically to prevent further performance issues. - - 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. - - Save and load recipes - - If you come up with an awesome recipe that you know you’ll want to use again, just click save and add it to your local storage. It'll be waiting for you next time you visit CyberChef. - - You can also copy a URL which includes your recipe and input which can be shared with others. - - Search - - If you know the name of the operation you want or a word associated with it, start typing it into the search field and any matching operations will immediately be shown. - - 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][8]). - - 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 (note that files larger than about 500kb may cause your browser to hang or even crash due to the way that browsers handle large amounts of textual data). - - CyberChef is entirely client-side - - It should be noted that none of your input or recipe configuration 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 desktop. - - -## Browser support - -CyberChef works well in modern versions of Google Chrome and Mozilla Firefox. - -To aid in the efficient development of new features and operations, there has been no attempt to maintain support for any version of Microsoft Internet Explorer. - -Microsoft Edge is currently unsupported, but if anyone would like to contribute compatibility fixes, they would be appreciated. - - -## Contributing - -An installation walkthrough, how-to guides for adding new operations, descriptions of the repository structure, available data types and coding conventions can all be found in the project [wiki pages](#### TO BE REPLACED ####). - - - 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. - - - [1]: https://gchq.github.io/cyberchef - [2]: https://gchq.github.io/cyberchef/?recipe=%5B%7B%22op%22%3A%22From%20Base64%22%2C%22args%22%3A%5B%22A-Za-z0-9%2B%2F%3D%22%2Ctrue%5D%7D%5D&input=VTI4Z2JHOXVaeUJoYm1RZ2RHaGhibXR6SUdadmNpQmhiR3dnZEdobElHWnBjMmd1 - [3]: https://gchq.github.io/cyberchef/?recipe=%5B%7B%22op%22%3A%22Translate%20DateTime%20Format%22%2C%22args%22%3A%5B%22Standard%20date%20and%20time%22%2C%22DD%2FMM%2FYYYY%20HH%3Amm%3Ass%22%2C%22UTC%22%2C%22dddd%20Do%20MMMM%20YYYY%20HH%3Amm%3Ass%20Z%20z%22%2C%22Australia%2FQueensland%22%5D%7D%5D&input=MTUvMDYvMjAxNSAyMDo0NTowMA - [4]: https://gchq.github.io/cyberchef/?recipe=%5B%7B%22op%22%3A%22Parse%20IPv6%20address%22%2C%22args%22%3A%5B%5D%7D%5D&input=MjAwMTowMDAwOjQxMzY6ZTM3ODo4MDAwOjYzYmY6M2ZmZjpmZGQy - [5]: https://gchq.github.io/cyberchef/?recipe=%5B%7B%22op%22%3A%22From%20Hexdump%22%2C%22args%22%3A%5B%5D%7D%2C%7B%22op%22%3A%22Gunzip%22%2C%22args%22%3A%5B%5D%7D%5D&input=MDAwMDAwMDAgIDFmIDhiIDA4IDAwIDEyIGJjIGYzIDU3IDAwIGZmIDBkIGM3IGMxIDA5IDAwIDIwICB8Li4uLi6881cu%2Fy7HwS4uIHwKMDAwMDAwMTAgIDA4IDA1IGQwIDU1IGZlIDA0IDJkIGQzIDA0IDFmIGNhIDhjIDQ0IDIxIDViIGZmICB8Li7QVf4uLdMuLsouRCFb%2F3wKMDAwMDAwMjAgIDYwIGM3IGQ3IDAzIDE2IGJlIDQwIDFmIDc4IDRhIDNmIDA5IDg5IDBiIDlhIDdkICB8YMfXLi6%2BQC54Sj8uLi4ufXwKMDAwMDAwMzAgIDRlIGM4IDRlIDZkIDA1IDFlIDAxIDhiIDRjIDI0IDAwIDAwIDAwICAgICAgICAgICB8TshObS4uLi5MJC4uLnw - [6]: https://gchq.github.io/cyberchef/?recipe=%5B%7B%22op%22%3A%22Fork%22%2C%22args%22%3A%5B%22%5C%5Cn%22%2C%22%5C%5Cn%22%5D%7D%2C%7B%22op%22%3A%22From%20UNIX%20Timestamp%22%2C%22args%22%3A%5B%22Seconds%20(s)%22%5D%7D%5D&input=OTc4MzQ2ODAwCjEwMTI2NTEyMDAKMTA0NjY5NjQwMAoxMDgxMDg3MjAwCjExMTUzMDUyMDAKMTE0OTYwOTYwMA - [7]: https://gchq.github.io/cyberchef/?recipe=%5B%7B%22op%22%3A%22Fork%22%2C%22args%22%3A%5B%22%5C%5Cn%22%2C%22%5C%5Cn%22%5D%7D%2C%7B%22op%22%3A%22Conditional%20Jump%22%2C%22args%22%3A%5B%221%22%2C%222%22%2C%2210%22%5D%7D%2C%7B%22op%22%3A%22To%20Hex%22%2C%22args%22%3A%5B%22Space%22%5D%7D%2C%7B%22op%22%3A%22Return%22%2C%22args%22%3A%5B%5D%7D%2C%7B%22op%22%3A%22To%20Base64%22%2C%22args%22%3A%5B%22A-Za-z0-9%2B%2F%3D%22%5D%7D%5D&input=U29tZSBkYXRhIHdpdGggYSAxIGluIGl0ClNvbWUgZGF0YSB3aXRoIGEgMiBpbiBpdA - [8]: https://gchq.github.io/cyberchef/?recipe=%5B%7B%22op%22%3A%22XOR%22%2C%22args%22%3A%5B%22de%20ad%20be%20ef%22%2C%22Hex%22%2Cfalse%2Cfalse%5D%7D%2C%7B%22op%22%3A%22To%20Hexdump%22%2C%22args%22%3A%5B%2216%22%2Cfalse%2Cfalse%5D%7D%5D&input=VGhlIGFuc3dlciB0byB0aGUgdWx0aW1hdGUgcXVlc3Rpb24gb2YgbGlmZSwgdGhlIFVuaXZlcnNlLCBhbmQgZXZlcnl0aGluZyBpcyA0Mi4 \ No newline at end of file diff --git a/build/prod/cyberchef.htm b/cyberchef.htm similarity index 100% rename from build/prod/cyberchef.htm rename to cyberchef.htm diff --git a/docs/Base.html b/docs/Base.html new file mode 100755 index 00000000..27990a08 --- /dev/null +++ b/docs/Base.html @@ -0,0 +1,786 @@ + + + + + + + CyberChef Namespace: Base + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Base

+
+ +
+ +

+ Base +

+ + +
+ + +
+
+ + +

Numerical base operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> DEFAULT_RADIX

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 36
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_to(input, args)

+ + +
+
+ + +
+

To Base operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from(input, args)

+ + +
+
+ + +
+

From Base operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Base64.html b/docs/Base64.html new file mode 100755 index 00000000..dbec6698 --- /dev/null +++ b/docs/Base64.html @@ -0,0 +1,2158 @@ + + + + + + + CyberChef Namespace: Base64 + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Base64

+
+ +
+ +

+ Base64 +

+ + +
+ + +
+
+ + +

Base64 operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> ALPHABET

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • A-Za-z0-9+/=
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ALPHABET_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["{\"name\":\"Standard: A-Za-z0-9+/=\",\"value\":\"A-Za-z0-9+/=\"}","{\"name\":\"URL safe: 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: 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+/=\"}"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_NON_ALPH_CHARS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BASE32_ALPHABET

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • A-Z2-7=
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SHOW_IN_BINARY

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> OFFSETS_SHOW_VARIABLE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_to(input, args)

+ + +
+
+ + +
+

To Base64 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from(input, args)

+ + +
+
+ + +
+

From Base64 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_to_32(input, args)

+ + +
+
+ + +
+

To Base32 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from_32(input, args)

+ + +
+
+ + +
+

From Base32 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_offsets(input, args)

+ + +
+
+ + +
+

Show Base64 offsets operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_to(pos, args)

+ + +
+
+ + +
+

Highlight to Base64

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_from(pos, args)

+ + +
+
+ + +
+

Highlight from Base64

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/BitwiseOp.html b/docs/BitwiseOp.html new file mode 100755 index 00000000..c03d43de --- /dev/null +++ b/docs/BitwiseOp.html @@ -0,0 +1,3501 @@ + + + + + + + CyberChef Namespace: BitwiseOp + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: BitwiseOp

+
+ +
+ +

+ BitwiseOp +

+ + +
+ + +
+
+ + +

Bitwise operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> XOR_PRESERVE_NULLS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> XOR_DIFFERENTIAL

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> KEY_FORMAT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Hex","Base64","UTF8","UTF16","UTF16LE","UTF16BE","Latin1"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> XOR_BRUTE_KEY_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["1","2"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> XOR_BRUTE_SAMPLE_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 100
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> XOR_BRUTE_SAMPLE_OFFSET

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> XOR_BRUTE_PRINT_KEY

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> XOR_BRUTE_OUTPUT_HEX

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<private, static> _bit_op(input, key, func, null_preserving, differential)

+ + +
+
+ + +
+

Runs bitwise operations across the input data.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
key + + +byte_array + + + + +
func + + +function + + + + +

The bitwise calculation to carry out

null_preserving + + +boolean + + + + +
differential + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_xor(input, args)

+ + +
+
+ + +
+

XOR operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_xor_brute(input, args)

+ + +
+
+ + +
+

XOR Brute Force operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_not(input, args)

+ + +
+
+ + +
+

NOT operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_and(input, args)

+ + +
+
+ + +
+

AND operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_or(input, args)

+ + +
+
+ + +
+

OR operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_add(input, args)

+ + +
+
+ + +
+

ADD operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sub(input, args)

+ + +
+
+ + +
+

SUB operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _xor(operand, key)

+ + +
+
+ + +
+

XOR bitwise calculation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operand + + +number + + + + +
key + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _not(operand)

+ + +
+
+ + +
+

NOT bitwise calculation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operand + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _and(operand, key)

+ + +
+
+ + +
+

AND bitwise calculation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operand + + +number + + + + +
key + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _or(operand, key)

+ + +
+
+ + +
+

OR bitwise calculation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operand + + +number + + + + +
key + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _add(operand, key)

+ + +
+
+ + +
+

ADD bitwise calculation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operand + + +number + + + + +
key + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _sub(operand, key)

+ + +
+
+ + +
+

SUB bitwise calculation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operand + + +number + + + + +
key + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/ByteRepr.html b/docs/ByteRepr.html new file mode 100755 index 00000000..37d71c6b --- /dev/null +++ b/docs/ByteRepr.html @@ -0,0 +1,3536 @@ + + + + + + + CyberChef Namespace: ByteRepr + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: ByteRepr

+
+ +
+ +

+ ByteRepr +

+ + +
+ + +
+
+ + +

Byte representation operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> DELIM_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Space","Comma","Semi-colon","Colon","Line feed","CRLF"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> HEX_DELIM_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Space","Comma","Semi-colon","Colon","Line feed","CRLF","0x","\\x","None"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BIN_DELIM_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Space","Comma","Semi-colon","Colon","Line feed","CRLF","None"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> CHARCODE_BASE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 16
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> HEX_CONTENT_CONVERT_WHICH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Only special chars","Only special chars including spaces","All chars"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> HEX_CONTENT_SPACES_BETWEEN_BYTES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_to_hex(input, args)

+ + +
+
+ + +
+

To Hex operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from_hex(input, args)

+ + +
+
+ + +
+

From Hex operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_to_charcode(input, args)

+ + +
+
+ + +
+

To Charcode operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from_charcode(input, args)

+ + +
+
+ + +
+

From Charcode operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_to(pos, args)

+ + +
+
+ + +
+

Highlight to hex

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_from(pos, args)

+ + +
+
+ + +
+

Highlight to hex

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_to_decimal(input, args)

+ + +
+
+ + +
+

To Decimal operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from_decimal(input, args)

+ + +
+
+ + +
+

From Decimal operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_to_binary(input, args)

+ + +
+
+ + +
+

To Binary operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from_binary(input, args)

+ + +
+
+ + +
+

From Binary operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_to_binary(pos, args)

+ + +
+
+ + +
+

Highlight to binary

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_from_binary(pos, args)

+ + +
+
+ + +
+

Highlight from binary

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_to_hex_content(input, args)

+ + +
+
+ + +
+

To Hex Content operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from_hex_content(input, args)

+ + +
+
+ + +
+

From Hex Content operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/CharEnc.html b/docs/CharEnc.html new file mode 100755 index 00000000..262168ce --- /dev/null +++ b/docs/CharEnc.html @@ -0,0 +1,604 @@ + + + + + + + CyberChef Namespace: CharEnc + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: CharEnc

+
+ +
+ +

+ CharEnc +

+ + +
+ + +
+
+ + +

Character encoding operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> IO_FORMAT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Windows-1251","Hex","Base64"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run(input, args)

+ + +
+
+ + +
+

Text encoding operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Checksum.html b/docs/Checksum.html new file mode 100755 index 00000000..17b8e574 --- /dev/null +++ b/docs/Checksum.html @@ -0,0 +1,1200 @@ + + + + + + + CyberChef Namespace: Checksum + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Checksum

+
+ +
+ +

+ Checksum +

+ + +
+ + +
+
+ + +

Checksum operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<static> run_fletcher16(input, args)

+ + +
+
+ + +
+

Fletcher-16 Checksum operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_adler32(input, args)

+ + +
+
+ + +
+

Adler-32 Checksum operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_crc32(input, args)

+ + +
+
+ + +
+

CRC-32 Checksum operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_tcp_ip(input, args)

+ + +
+
+ + +
+

TCP/IP Checksum operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>GCHQ Contributor [1]</p>
  • +
+
+ + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns '3f2c'
+Checksum.run_tcp_ip([0x45,0x00,0x00,0x87,0xa3,0x1b,0x40,0x00,0x40,0x06,
+                     0x00,0x00,0xac,0x11,0x00,0x04,0xac,0x11,0x00,0x03])
+
+// returns 'a249'
+Checksum.run_tcp_ip([0x45,0x00,0x01,0x11,0x3f,0x74,0x40,0x00,0x40,0x06,
+                     0x00,0x00,0xac,0x11,0x00,0x03,0xac,0x11,0x00,0x04])
+ + + +
+ + + +
+
+

<private, static> _gen_crc_table()

+ + +
+
+ + +
+

Generates a CRC table for use with CRC checksums.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +array + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Chef.html b/docs/Chef.html new file mode 100755 index 00000000..d2fc1c06 --- /dev/null +++ b/docs/Chef.html @@ -0,0 +1,1026 @@ + + + + + + + CyberChef Class: Chef + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Chef

+
+ +
+ +

+ Chef +

+ + +
+ + +
+
+ + +
+
+

new Chef()

+ + +
+
+ + +
+

The main controller for CyberChef.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

bake(input_text, recipe_config, options, progress [, step])

+ + +
+
+ + +
+

Runs the recipe over the input.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
input_text + + +string + + + + + + + + + + +

The input data as a string

recipe_config + + +Array.<Object> + + + + + + + + + + +

The recipe configuration object

options + + +Object + + + + + + + + + + +

The options object storing various user choices

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
attemp_highlight + + +boolean + + + + +

Whether or not to attempt highlighting

+ +
progress + + +number + + + + + + + + + + +

The position in the recipe to start from

step + + +number + + + + + + + <optional>
+ + + + + +

The number of operations to execute

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+
    +
  • +
    +

    response

    +
    + + + +
    +
    + Type +
    +
    + +Object + + + +
    +
    + +
  • + +
  • +
    +

    response.result - The output of the recipe

    +
    + + + +
    +
    + Type +
    +
    + +string + + + +
    +
    + +
  • + +
  • +
    +

    response.type - The data type of the result

    +
    + + + +
    +
    + Type +
    +
    + +string + + + +
    +
    + +
  • + +
  • +
    +

    response.progress - The position that we have got to in the recipe

    +
    + + + +
    +
    + Type +
    +
    + +number + + + +
    +
    + +
  • + +
  • +
    +

    response.options - The app options object (which may have been changed)

    +
    + + + +
    +
    + Type +
    +
    + +number + + + +
    +
    + +
  • + +
  • +
    +

    response.duration - The number of ms it took to execute the recipe

    +
    + + + +
    +
    + Type +
    +
    + +number + + + +
    +
    + +
  • + +
  • +
    +

    response.error - The error object thrown by a failed operation (false if no error)

    +
    + + + +
    +
    + Type +
    +
    + +number + + + +
    +
    + +
  • +
+ + +
+ + + +
+
+

silent_bake(recipe_config)

+ + +
+
+ + +
+

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.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
recipe_config + + +Array.<Object> + + + + +

The recipe configuration object

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The time it took to run the silent bake in milliseconds.

+
+ + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Cipher.html b/docs/Cipher.html new file mode 100755 index 00000000..08fffd65 --- /dev/null +++ b/docs/Cipher.html @@ -0,0 +1,4185 @@ + + + + + + + CyberChef Namespace: Cipher + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Cipher

+
+ +
+ +

+ Cipher +

+ + +
+ + +
+
+ + +

Cipher operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> IO_FORMAT1

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Hex","Base64","UTF8","UTF16","UTF16LE","UTF16BE","Latin1"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> IO_FORMAT2

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["UTF8","UTF16","UTF16LE","UTF16BE","Latin1","Hex","Base64"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> IO_FORMAT3

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Hex","Base64","UTF16","UTF16LE","UTF16BE","Latin1"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> IO_FORMAT4

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Latin1","UTF8","UTF16","UTF16LE","UTF16BE","Hex","Base64"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> MODES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["CBC","CFB","CTR","OFB","ECB"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PADDING

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Pkcs7","Iso97971","AnsiX923","Iso10126","ZeroPadding","NoPadding"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> RESULT_TYPE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Show all","Ciphertext","Key","IV","Salt"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BLOWFISH_MODES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["ECB","CBC","PCBC","CFB","OFB","CTR"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BLOWFISH_OUTPUT_TYPES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Base64","Hex","String","Raw"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> KDF_KEY_SIZE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 256
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> KDF_ITERATIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 1
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> RC4DROP_BYTES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 768
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<private, static> _enc(algo, input, args)

+ + +
+
+ + +
+

Runs encryption operations using the CryptoJS framework.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +function + + + + +

The CryptoJS algorithm to use

input + + +byte_array + + + + +
args + + +function + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _dec(algo, input, args)

+ + +
+
+ + +
+

Runs decryption operations using the CryptoJS framework.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
algo + + +function + + + + +

The CryptoJS algorithm to use

input + + +byte_array + + + + +
args + + +function + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_aes_enc(input, args)

+ + +
+
+ + +
+

AES Encrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_aes_dec(input, args)

+ + +
+
+ + +
+

AES Decrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_des_enc(input, args)

+ + +
+
+ + +
+

DES Encrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_des_dec(input, args)

+ + +
+
+ + +
+

DES Decrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_triple_des_enc(input, args)

+ + +
+
+ + +
+

Triple DES Encrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_triple_des_dec(input, args)

+ + +
+
+ + +
+

Triple DES Decrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_rabbit_enc(input, args)

+ + +
+
+ + +
+

Rabbit Encrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_rabbit_dec(input, args)

+ + +
+
+ + +
+

Rabbit Decrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_blowfish_enc(input, args)

+ + +
+
+ + +
+

Blowfish Encrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_blowfish_dec(input, args)

+ + +
+
+ + +
+

Blowfish Decrypt operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_pbkdf2(input, args)

+ + +
+
+ + +
+

Derive PBKDF2 key operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_evpkdf(input, args)

+ + +
+
+ + +
+

Derive EVP key operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_rc4(input, args)

+ + +
+
+ + +
+

RC4 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_rc4drop(input, args)

+ + +
+
+ + +
+

RC4 Drop operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Code.html b/docs/Code.html new file mode 100755 index 00000000..eb907263 --- /dev/null +++ b/docs/Code.html @@ -0,0 +1,2464 @@ + + + + + + + CyberChef Namespace: Code + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Code

+
+ +
+ +

+ Code +

+ + +
+ + +
+
+ + +

Code operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> LANGUAGES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["default-code","default-markup","bash","bsh","c","cc","coffee","cpp","cs","csh","cv","cxx","cyc","htm","html","in.tag","java","javascript","js","json","m","mxml","perl","pl","pm","py","python","rb","rc","rs","ruby","rust","sh","uq.val","xhtml","xml","xsl"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> LINE_NUMS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BEAUTIFY_INDENT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • \t
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PRESERVE_COMMENTS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_syntax_highlight(input, args)

+ + +
+
+ + +
+

Syntax highlighter operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_xml_beautify(input, args)

+ + +
+
+ + +
+

XML Beautify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_json_beautify(input, args)

+ + +
+
+ + +
+

JSON Beautify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_css_beautify(input, args)

+ + +
+
+ + +
+

CSS Beautify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sql_beautify(input, args)

+ + +
+
+ + +
+

SQL Beautify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_xml_minify(input, args)

+ + +
+
+ + +
+

XML Minify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_json_minify(input, args)

+ + +
+
+ + +
+

JSON Minify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_css_minify(input, args)

+ + +
+
+ + +
+

CSS Minify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sql_minify(input, args)

+ + +
+
+ + +
+

SQL Minify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_generic_beautify(input, args)

+ + +
+
+ + +
+

Generic Code Beautify operation.

+

Yeeeaaah...

+

I'm not proud of this code, but seriously, try writing a generic lexer and parser that
correctly generates an AST for multiple different languages. I have tried, and I can tell
you it's pretty much impossible.

+

This basically works. That'll have to be good enough. It's not meant to produce working code,
just slightly more readable code.

+

Things that don't work:

+
    +
  • For loop formatting
  • +
  • Do-While loop formatting
  • +
  • Switch/Case indentation
  • +
  • Bit shift operators
  • +
+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Compress.html b/docs/Compress.html new file mode 100755 index 00000000..a49598c2 --- /dev/null +++ b/docs/Compress.html @@ -0,0 +1,3186 @@ + + + + + + + CyberChef Namespace: Compress + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Compress

+
+ +
+ +

+ Compress +

+ + +
+ + +
+
+ + +

Compression operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> COMPRESSION_TYPE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Dynamic Huffman Coding","Fixed Huffman Coding","None (Store)"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INFLATE_BUFFER_TYPE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Adaptive","Block"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> COMPRESSION_METHOD

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Deflate","None (Store)"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> OS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["MSDOS","Unix","Macintosh"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> RAW_COMPRESSION_TYPE_LOOKUP

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":""}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INFLATE_INDEX

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INFLATE_BUFFER_SIZE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INFLATE_RESIZE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INFLATE_VERIFY

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> RAW_BUFFER_TYPE_LOOKUP

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":""}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ZLIB_COMPRESSION_TYPE_LOOKUP

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":""}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ZLIB_BUFFER_TYPE_LOOKUP

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":""}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> GZIP_CHECKSUM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PKZIP_FILENAME

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • file.txt
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ZIP_COMPRESSION_METHOD_LOOKUP

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":""}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ZIP_OS_LOOKUP

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":""}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PKUNZIP_VERIFY

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_raw_deflate(input, args)

+ + +
+
+ + +
+

Raw Deflate operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_raw_inflate(input, args)

+ + +
+
+ + +
+

Raw Inflate operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_zlib_deflate(input, args)

+ + +
+
+ + +
+

Zlib Deflate operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_zlib_inflate(input, args)

+ + +
+
+ + +
+

Zlib Inflate operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_gzip(input, args)

+ + +
+
+ + +
+

Gzip operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_gunzip(input, args)

+ + +
+
+ + +
+

Gunzip operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_pkzip(input, args)

+ + +
+
+ + +
+

Zip operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_pkunzip(input, args)

+ + +
+
+ + +
+

Unzip operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_bzip2_decompress(input, args)

+ + +
+
+ + +
+

Bzip2 Decompress operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/ControlsWaiter.html b/docs/ControlsWaiter.html new file mode 100755 index 00000000..f8e3bbb6 --- /dev/null +++ b/docs/ControlsWaiter.html @@ -0,0 +1,2381 @@ + + + + + + + CyberChef Class: ControlsWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: ControlsWaiter

+
+ +
+ +

+ ControlsWaiter +

+ + +
+ + +
+
+ + +
+
+

new ControlsWaiter(app, manager)

+ + +
+
+ + +
+

Waiter to handle events related to the CyberChef controls (i.e. Bake, Step, Save, Load etc.)

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

adjust_width()

+ + +
+
+ + +
+

Adjusts the display properties of the control buttons so that they fit within the current width
without wrapping or overflowing.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

set_auto_bake(value)

+ + +
+
+ + +
+

Checks or unchecks the Auto Bake checkbox based on the given value.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +boolean + + + + +

The new value for Auto Bake.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

bake_click()

+ + +
+
+ + +
+

Handler to trigger baking.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

step_click()

+ + +
+
+ + +
+

Handler for the 'Step through' command. Executes the next step of the recipe.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

auto_bake_change()

+ + +
+
+ + +
+

Handler for changes made to the Auto Bake checkbox.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

clear_recipe_click()

+ + +
+
+ + +
+

Handler for the 'Clear recipe' command. Removes all operations from the recipe.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

clear_breaks_click()

+ + +
+
+ + +
+

Handler for the 'Clear breakpoints' command. Removes all breakpoints from operations in the
recipe.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+ + + +
+
+ + +
+

Populates the save disalog box with a URL incorporating the recipe and input.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
recipe_config + + +Array.<Object> + + + + + + + <optional>
+ + + + + +

The recipe configuration object array.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

generate_state_url(include_recipe, include_input [, recipe_config])

+ + +
+
+ + +
+

Generates a URL containing the current recipe and input state.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
include_recipe + + +boolean + + + + + + + + + + +

Whether to include the recipe in the URL.

include_input + + +boolean + + + + + + + + + + +

Whether to include the input in the URL.

recipe_config + + +Array.<Object> + + + + + + + <optional>
+ + + + + +

The recipe configuration object array.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

save_text_change()

+ + +
+
+ + +
+

Handler for changes made to the save dialog text area. Re-initialises the save link.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

save_click()

+ + +
+
+ + +
+

Handler for the 'Save' command. Pops up the save dialog box.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

slr_check_change()

+ + +
+
+ + +
+

Handler for the save link recipe checkbox change event.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

sli_check_change()

+ + +
+
+ + +
+

Handler for the save link input checkbox change event.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

load_click()

+ + +
+
+ + +
+

Handler for the 'Load' command. Pops up the load dialog box.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

save_button_click()

+ + +
+
+ + +
+

Saves the recipe specified in the save textarea to local storage.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

populate_load_recipes_list()

+ + +
+
+ + +
+

Populates the list of saved recipes in the load dialog box from local storage.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

load_delete_click()

+ + +
+
+ + +
+

Removes the currently selected recipe from local storage.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

load_name_change()

+ + +
+
+ + +
+

Displays the selected recipe in the load text box.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

load_button_click()

+ + +
+
+ + +
+

Loads the selected recipe and populates the Recipe with its operations.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Convert.html b/docs/Convert.html new file mode 100755 index 00000000..ad198263 --- /dev/null +++ b/docs/Convert.html @@ -0,0 +1,1989 @@ + + + + + + + CyberChef Namespace: Convert + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Convert

+
+ +
+ +

+ Convert +

+ + +
+ + +
+
+ + +

Unit conversion operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> DISTANCE_UNITS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["[Metric]","Nanometres (nm)","Micrometres (µm)","Millimetres (mm)","Centimetres (cm)","Metres (m)","Kilometers (km)","[/Metric]","[Imperial]","Thou (th)","Inches (in)","Feet (ft)","Yards (yd)","Chains (ch)","Furlongs (fur)","Miles (mi)","Leagues (lea)","[/Imperial]","[Maritime]","Fathoms (ftm)","Cables","Nautical miles","[/Maritime]","[Comparisons]","Cars (4m)","Buses (8.4m)","American football fields (91m)","Football pitches (105m)","[/Comparisons]","[Astronomical]","Earth-to-Moons","Earth's equators","Astronomical units (au)","Light-years (ly)","Parsecs (pc)","[/Astronomical]"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DISTANCE_FACTOR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":30856776000000000}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DATA_UNITS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Bits (b)","Nibbles","Octets","Bytes (B)","[Binary bits (2^n)]","Kibibits (Kib)","Mebibits (Mib)","Gibibits (Gib)","Tebibits (Tib)","Pebibits (Pib)","Exbibits (Eib)","Zebibits (Zib)","Yobibits (Yib)","[/Binary bits (2^n)]","[Decimal bits (10^n)]","Decabits","Hectobits","Kilobits (kb)","Megabits (Mb)","Gigabits (Gb)","Terabits (Tb)","Petabits (Pb)","Exabits (Eb)","Zettabits (Zb)","Yottabits (Yb)","[/Decimal bits (10^n)]","[Binary bytes (8 x 2^n)]","Kibibytes (KiB)","Mebibytes (MiB)","Gibibytes (GiB)","Tebibytes (TiB)","Pebibytes (PiB)","Exbibytes (EiB)","Zebibytes (ZiB)","Yobibytes (YiB)","[/Binary bytes (8 x 2^n)]","[Decimal bytes (8 x 10^n)]","Kilobytes (KB)","Megabytes (MB)","Gigabytes (GB)","Terabytes (TB)","Petabytes (PB)","Exabytes (EB)","Zettabytes (ZB)","Yottabytes (YB)","[/Decimal bytes (8 x 10^n)]"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DATA_FACTOR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":8e+24}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> AREA_UNITS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["[Metric]","Square metre (sq m)","Square kilometre (sq km)","Centiare (ca)","Deciare (da)","Are (a)","Decare (daa)","Hectare (ha)","[/Metric]","[Imperial]","Square inch (sq in)","Square foot (sq ft)","Square yard (sq yd)","Square mile (sq mi)","Perch (sq per)","Rood (ro)","International acre (ac)","[/Imperial]","[US customary units]","US survey acre (ac)","US survey square mile (sq mi)","US survey township","[/US customary units]","[Nuclear physics]","Yoctobarn (yb)","Zeptobarn (zb)","Attobarn (ab)","Femtobarn (fb)","Picobarn (pb)","Nanobarn (nb)","Microbarn (μb)","Millibarn (mb)","Barn (b)","Kilobarn (kb)","Megabarn (Mb)","Outhouse","Shed","Planck area","[/Nuclear physics]","[Comparisons]","Washington D.C.","Isle of Wight","Wales","Texas","[/Comparisons]"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> AREA_FACTOR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":696241000000}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> MASS_UNITS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["[Metric]","Yoctogram (yg)","Zeptogram (zg)","Attogram (ag)","Femtogram (fg)","Picogram (pg)","Nanogram (ng)","Microgram (μg)","Milligram (mg)","Centigram (cg)","Decigram (dg)","Gram (g)","Decagram (dag)","Hectogram (hg)","Kilogram (kg)","Megagram (Mg)","Tonne (t)","Gigagram (Gg)","Teragram (Tg)","Petagram (Pg)","Exagram (Eg)","Zettagram (Zg)","Yottagram (Yg)","[/Metric]","[Imperial Avoirdupois]","Grain (gr)","Dram (dr)","Ounce (oz)","Pound (lb)","Nail","Stone (st)","Quarter (gr)","Tod","US hundredweight (cwt)","Imperial hundredweight (cwt)","US ton (t)","Imperial ton (t)","[/Imperial Avoirdupois]","[Imperial Troy]","Grain (gr)","Pennyweight (dwt)","Troy dram (dr t)","Troy ounce (oz t)","Troy pound (lb t)","Mark","[/Imperial Troy]","[Archaic]","Wey","Wool wey","Suffolk wey","Wool sack","Coal sack","Load","Last","Flax or feather last","Gunpowder last","Picul","Rice last","[/Archaic]","[Comparisons]","Big Ben (14 tonnes)","Blue whale (180 tonnes)","International Space Station (417 tonnes)","Space Shuttle (2,041 tonnes)","RMS Titanic (52,000 tonnes)","Great Pyramid of Giza (6,000,000 tonnes)","Earth's oceans (1.4 yottagrams)","[/Comparisons]","[Astronomical]","A teaspoon of neutron star (5,500 million tonnes)","Lunar mass (ML)","Earth mass (M⊕)","Jupiter mass (MJ)","Solar mass (M☉)","Sagittarius A* (7.5 x 10^36 kgs-ish)","Milky Way galaxy (1.2 x 10^42 kgs)","The observable universe (1.45 x 10^53 kgs)","[/Astronomical]"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> MASS_FACTOR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":1.45e+56}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SPEED_UNITS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["[Metric]","Metres per second (m/s)","Kilometres per hour (km/h)","[/Metric]","[Imperial]","Miles per hour (mph)","Knots (kn)","[/Imperial]","[Comparisons]","Human hair growth rate","Bamboo growth rate","World's fastest snail","Usain Bolt's top speed","Jet airliner cruising speed","Concorde","SR-71 Blackbird","Space Shuttle","International Space Station","[/Comparisons]","[Scientific]","Sound in standard atmosphere","Sound in water","Lunar escape velocity","Earth escape velocity","Earth's solar orbit","Solar system's Milky Way orbit","Milky Way relative to the cosmic microwave background","Solar escape velocity","Neutron star escape velocity (0.3c)","Light in a diamond (0.4136c)","Signal in an optical fibre (0.667c)","Light (c)","[/Scientific]"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SPEED_FACTOR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • {"undefined":299792458}
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_distance(input, args)

+ + +
+
+ + +
+

Convert distance operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_data_size(input, args)

+ + +
+
+ + +
+

Convert data units operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_area(input, args)

+ + +
+
+ + +
+

Convert area operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_mass(input, args)

+ + +
+
+ + +
+

Convert mass operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_speed(input, args)

+ + +
+
+ + +
+

Convert speed operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/DateTime.html b/docs/DateTime.html new file mode 100755 index 00000000..d84610b4 --- /dev/null +++ b/docs/DateTime.html @@ -0,0 +1,1501 @@ + + + + + + + CyberChef Namespace: DateTime + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: DateTime

+
+ +
+ +

+ DateTime +

+ + +
+ + +
+
+ + +

Date and time operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> UNITS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Seconds (s)","Milliseconds (ms)","Microseconds (μs)","Nanoseconds (ns)"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DATETIME_FORMATS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["{\"name\":\"Standard date and time\",\"value\":\"DD/MM/YYYY HH:mm:ss\"}","{\"name\":\"American-style date and time\",\"value\":\"MM/DD/YYYY HH:mm:ss\"}","{\"name\":\"International date and time\",\"value\":\"YYYY-MM-DD HH:mm:ss\"}","{\"name\":\"Verbose date and time\",\"value\":\"dddd Do MMMM YYYY HH:mm:ss Z z\"}","{\"name\":\"UNIX timestamp (seconds)\",\"value\":\"X\"}","{\"name\":\"UNIX timestamp offset (milliseconds)\",\"value\":\"x\"}","{\"name\":\"Automatic\",\"value\":\"\"}"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INPUT_FORMAT_STRING

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • DD/MM/YYYY HH:mm:ss
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> OUTPUT_FORMAT_STRING

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • dddd Do MMMM YYYY HH:mm:ss Z z
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> TIMEZONES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> FORMAT_EXAMPLES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_from_unix_timestamp(input, args)

+ + +
+
+ + +
+

From UNIX Timestamp operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_to_unix_timestamp(input, args)

+ + +
+
+ + +
+

To UNIX Timestamp operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_translate_format(input, args)

+ + +
+
+ + +
+

Translate DateTime Format operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_parse(input, args)

+ + +
+
+ + +
+

Parse DateTime operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Dish.html b/docs/Dish.html new file mode 100755 index 00000000..1a8d2a9a --- /dev/null +++ b/docs/Dish.html @@ -0,0 +1,1651 @@ + + + + + + + CyberChef Class: Dish + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Dish

+
+ +
+ +

+ Dish +

+ + +
+ + +
+
+ + +
+
+

new Dish(value, type)

+ + +
+
+ + +
+

The data being operated on by each operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +byte_array +| + +string +| + +number + + + + +

The value of the input data.

type + + +number + + + + +

The data type of value, see Dish enums.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, readonly> BYTE_ARRAY

+ + +
+
+ +
+

Dish data type enum for byte arrays.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, readonly> STRING

+ + +
+
+ +
+

Dish data type enum for strings.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, readonly> NUMBER

+ + +
+
+ +
+

Dish data type enum for numbers.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, readonly> HTML

+ + +
+
+ +
+

Dish data type enum for HTML.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> type_enum(type_str)

+ + +
+
+ + +
+

Returns the data type enum for the given type string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type_str + + +string + + + + +

The name of the data type.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The data type enum value.

+
+ + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<static> enum_lookup(type_enum)

+ + +
+
+ + +
+

Returns the data type string for the given type enum.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type_enum + + +string + + + + +

The enum value of the data type.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The data type as a string.

+
+ + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

set(value, type)

+ + +
+
+ + +
+

Sets the data value and type and then validates them.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +byte_array +| + +string +| + +number + + + + +

The value of the input data.

type + + +number + + + + +

The data type of value, see Dish enums.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

get(type)

+ + +
+
+ + +
+

Returns the value of the data in the type format specified.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +number + + + + +

The data type of value, see Dish enums.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The value of the output data.

+
+ + + +
+
+ Type +
+
+ +byte_array +| + +string +| + +number + + + +
+
+ + + + + +
+ + + +
+
+

translate(to_type)

+ + +
+
+ + +
+

Translates the data to the given type format.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
to_type + + +number + + + + +

The data type of value, see Dish enums.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

valid()

+ + +
+
+ + +
+

Validates that the value is the type that has been specified.
May have to disable parts of BYTE_ARRAY validation if it effects performance.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Whether the data is valid or not.

+
+ + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Endian.html b/docs/Endian.html new file mode 100755 index 00000000..dfddd449 --- /dev/null +++ b/docs/Endian.html @@ -0,0 +1,750 @@ + + + + + + + CyberChef Namespace: Endian + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Endian

+
+ +
+ +

+ Endian +

+ + +
+ + +
+
+ + +

Endian operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> DATA_FORMAT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Hex","Raw"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> WORD_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 4
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PAD_INCOMPLETE_WORDS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_swap_endianness(input, args)

+ + +
+
+ + +
+

Swap endianness operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Entropy.html b/docs/Entropy.html new file mode 100755 index 00000000..4df78f07 --- /dev/null +++ b/docs/Entropy.html @@ -0,0 +1,1010 @@ + + + + + + + CyberChef Namespace: Entropy + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Entropy

+
+ +
+ +

+ Entropy +

+ + +
+ + +
+
+ + +

Entropy operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> CHUNK_SIZE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 1000
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> FREQ_ZEROS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_entropy(input, args)

+ + +
+
+ + +
+

Entropy operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_freq_distrib(input, args)

+ + +
+
+ + +
+

Frequency distribution operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _calc_entropy(data)

+ + +
+
+ + +
+

Calculates the Shannon entropy for a given chunk of data.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +byte_array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Extract.html b/docs/Extract.html new file mode 100755 index 00000000..ccd76b03 --- /dev/null +++ b/docs/Extract.html @@ -0,0 +1,2707 @@ + + + + + + + CyberChef Namespace: Extract + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Extract

+
+ +
+ +

+ Extract +

+ + +
+ + +
+
+ + +

Identifier extraction operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> MIN_STRING_LEN

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 3
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DISPLAY_TOTAL

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INCLUDE_IPV4

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INCLUDE_IPV6

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_LOCAL

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INCLUDE_WIN_PATH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INCLUDE_UNIX_PATH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+ + + +
+
+ + +
+

Runs search operations across the input data using refular expressions.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
search_regex + + +RegExp + + + + +
remove_regex + + +RegExp + + + + +

A regular expression defining results to remove from the
final list

include_total + + +boolean + + + + +

Whether or not to include the total number of results

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_strings(input, args)

+ + +
+
+ + +
+

Strings operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_ip(input, args)

+ + +
+
+ + +
+

Extract IP addresses operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_email(input, args)

+ + +
+
+ + +
+

Extract email addresses operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_mac(input, args)

+ + +
+
+ + +
+

Extract MAC addresses operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_urls(input, args)

+ + +
+
+ + +
+

Extract URLs operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_domains(input, args)

+ + +
+
+ + +
+

Extract domains operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_file_paths(input, args)

+ + +
+
+ + +
+

Extract file paths operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_dates(input, args)

+ + +
+
+ + +
+

Extract dates operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_all_idents(input, args)

+ + +
+
+ + +
+

Extract all identifiers operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/FileType.html b/docs/FileType.html new file mode 100755 index 00000000..418335c7 --- /dev/null +++ b/docs/FileType.html @@ -0,0 +1,1014 @@ + + + + + + + CyberChef Namespace: FileType + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: FileType

+
+ +
+ +

+ FileType +

+ + +
+ + +
+
+ + +

File type operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> IGNORE_COMMON_BYTE_SEQUENCES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_detect(input, args)

+ + +
+
+ + +
+

Detect File Type operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_scan_for_embedded_files(input, args)

+ + +
+
+ + +
+

Scan for Embedded Files operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _magic_type(buf)

+ + +
+
+ + +
+

Given a buffer, detects magic byte sequences at specific positions and returns the
extension and mime type.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buf + + +byte_array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+
    +
  • +
    +

    type

    +
    + + + +
    +
    + Type +
    +
    + +Object + + + +
    +
    + +
  • + +
  • +
    +

    type.ext - File extension

    +
    + + + +
    +
    + Type +
    +
    + +string + + + +
    +
    + +
  • + +
  • +
    +

    type.mime - Mime type

    +
    + + + +
    +
    + Type +
    +
    + +string + + + +
    +
    + +
  • + +
  • +
    +

    [type.desc] - Description

    +
    + + + +
    +
    + Type +
    +
    + +string + + + +
    +
    + +
  • +
+ + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/FlowControl.html b/docs/FlowControl.html new file mode 100755 index 00000000..1d6754d4 --- /dev/null +++ b/docs/FlowControl.html @@ -0,0 +1,1982 @@ + + + + + + + CyberChef Namespace: FlowControl + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: FlowControl

+
+ +
+ +

+ FlowControl +

+ + +
+ + +
+
+ + +

Flow Control operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> FORK_DELIM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • \n
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> MERGE_DELIM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • \n
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> JUMP_NUM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> MAX_JUMPS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 10
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_fork(state)

+ + +
+
+ + +
+

Fork operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Object + + + + +

The current state of the recipe.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
progress + + +number + + + + +

The current position in the recipe.

dish + + +Dish + + + + +

The Dish being operated on.

op_list + + +Array.<Operation> + + + + +

The list of operations in the recipe.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The updated state of the recipe.

+
+ + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_merge(state)

+ + +
+
+ + +
+

Merge operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Object + + + + +

The current state of the recipe.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
progress + + +number + + + + +

The current position in the recipe.

dish + + +Dish + + + + +

The Dish being operated on.

op_list + + +Array.<Operation> + + + + +

The list of operations in the recipe.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The updated state of the recipe.

+
+ + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_jump(state)

+ + +
+
+ + +
+

Jump operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Object + + + + +

The current state of the recipe.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
progress + + +number + + + + +

The current position in the recipe.

dish + + +Dish + + + + +

The Dish being operated on.

op_list + + +Array.<Operation> + + + + +

The list of operations in the recipe.

num_jumps + + +number + + + + +

The number of jumps taken so far.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The updated state of the recipe.

+
+ + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_cond_jump(state)

+ + +
+
+ + +
+

Conditional Jump operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Object + + + + +

The current state of the recipe.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
progress + + +number + + + + +

The current position in the recipe.

dish + + +Dish + + + + +

The Dish being operated on.

op_list + + +Array.<Operation> + + + + +

The list of operations in the recipe.

num_jumps + + +number + + + + +

The number of jumps taken so far.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The updated state of the recipe.

+
+ + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_return(state)

+ + +
+
+ + +
+

Return operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Object + + + + +

The current state of the recipe.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
progress + + +number + + + + +

The current position in the recipe.

dish + + +Dish + + + + +

The Dish being operated on.

op_list + + +Array.<Operation> + + + + +

The list of operations in the recipe.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The updated state of the recipe.

+
+ + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/HTML.html b/docs/HTML.html new file mode 100755 index 00000000..c7bc5c3b --- /dev/null +++ b/docs/HTML.html @@ -0,0 +1,1936 @@ + + + + + + + CyberChef Namespace: HTML + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: HTML

+
+ +
+ +

+ HTML +

+ + +
+ + +
+
+ + +

HTML operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> CONVERT_ALL

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> CONVERT_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Named entities where possible","Numeric entities","Hex entities"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_INDENTATION

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_LINE_BREAKS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<private, static, constant> _byte_to_entity

+ + +
+
+ +
+

Lookup table to translate byte values to their HTML entity codes.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<private, static, constant> _entity_to_byte

+ + +
+
+ +
+

Lookup table to translate HTML entity codes to their byte values.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_to_entity(input, args)

+ + +
+
+ + +
+

To HTML Entity operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from_entity(input, args)

+ + +
+
+ + +
+

From HTML Entity operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_strip_tags(input, args)

+ + +
+
+ + +
+

Strip HTML tags operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_parse_colour_code(input, args)

+ + +
+
+ + +
+

Parse colour code operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _hsl_to_rgb(h, s, l)

+ + +
+
+ + +
+

Converts an HSL color value to RGB. Conversion formula
adapted from http://en.wikipedia.org/wiki/HSL_color_space.
Assumes h, s, and l are contained in the set [0, 1] and
returns r, g, and b in the set [0, 255].

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
h + + +number + + + + +

The hue

s + + +number + + + + +

The saturation

l + + +number + + + + +

The lightness

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • Mohsen (http://stackoverflow.com/a/9493060)
  • +
+
+ + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The RGB representation

+
+ + + +
+
+ Type +
+
+ +Array + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _rgb_to_hsl(r, g, b)

+ + +
+
+ + +
+

Converts an RGB color value to HSL. Conversion formula
adapted from http://en.wikipedia.org/wiki/HSL_color_space.
Assumes r, g, and b are contained in the set [0, 255] and
returns h, s, and l in the set [0, 1].

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
r + + +number + + + + +

The red color value

g + + +number + + + + +

The green color value

b + + +number + + + + +

The blue color value

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • Mohsen (http://stackoverflow.com/a/9493060)
  • +
+
+ + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The HSL representation

+
+ + + +
+
+ Type +
+
+ +Array + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/HTMLApp.html b/docs/HTMLApp.html new file mode 100755 index 00000000..0028f43e --- /dev/null +++ b/docs/HTMLApp.html @@ -0,0 +1,3838 @@ + + + + + + + CyberChef Class: HTMLApp + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: HTMLApp

+
+ +
+ +

+ HTMLApp +

+ + +
+ + +
+
+ + +
+
+

new HTMLApp(categories, operations, default_favourites, options)

+ + +
+
+ + +
+

HTML view for CyberChef responsible for building the web page and dealing with all user
interactions.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
categories + + +Array.<CatConf> + + + + +

The list of categories and operations to be populated.

operations + + +Object.<string, OpConf> + + + + +

The list of operation configuration objects.

default_favourites + + +Array.<String> + + + + +

A list of default favourite operations.

options + + +Object + + + + +

Default setting for app options.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

setup()

+ + +
+
+ + +
+

This function sets up the stage and creates listeners for all events.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

handle_error(err)

+ + +
+
+ + +
+

An error handler for displaying the error to the user.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
err + + +Error + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

bake( [step])

+ + +
+
+ + +
+

Calls the Chef to bake the current input using the current recipe.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
step + + +boolean + + + + + + + <optional>
+ + + + + +

Set to true if we should only execute one operation instead of the
whole recipe.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

auto_bake()

+ + +
+
+ + +
+

Runs Auto Bake if it is set.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

silent_bake()

+ + +
+
+ + +
+

Runs a silent bake forcing the browser to load and cache all the relevant JavaScript code needed
to do a real bake.

+

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.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • The number of miliseconds it took to run the silent bake.
  • +
+
+ + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

get_input()

+ + +
+
+ + +
+

Gets the user's input data.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

set_input(input)

+ + +
+
+ + +
+

Sets the user's input data.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +

The string to set the input to

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

populate_operations_list()

+ + +
+
+ + +
+

Populates the operations accordion list with the categories and operations specified in the
view constructor.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

initialise_splitter()

+ + +
+
+ + +
+

Sets up the adjustable splitter to allow the user to resize areas of the page.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

load_local_storage()

+ + +
+
+ + +
+

Loads the information previously saved to the HTML5 local storage object so that user options
and favourites can be restored.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

load_favourites()

+ + +
+
+ + +
+

Loads the user's favourite operations from the HTML5 local storage object and populates the
Favourites category with them.
If the user currently has no saved favourites, the defaults from the view constructor are used.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

valid_favourites(favourites)

+ + +
+
+ + +
+

Filters the list of favourite operations that the user had stored and removes any that are no
longer available. The user is notified if this is the case.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
favourites + + +Array.<string> + + + + +

A list of the user's favourite operations

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A list of the valid favourites

+
+ + + +
+
+ Type +
+
+ +Array.<string> + + + +
+
+ + + + + +
+ + + +
+
+

save_favourites(favourites)

+ + +
+
+ + +
+

Saves a list of favourite operations to the HTML5 local storage object.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
favourites + + +Array.<string> + + + + +

A list of the user's favourite operations

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

reset_favourites()

+ + +
+
+ + +
+

Resets favourite operations back to the default as specified in the view constructor and
refreshes the operation list.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

add_favourite(name)

+ + +
+
+ + +
+

Adds an operation to the user's favourites.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + +

The name of the operation

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

load_URI_params()

+ + +
+
+ + +
+

Checks for input and recipe in the URI parameters and loads them if present.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

next_ing_id()

+ + +
+
+ + +
+

Returns the next ingredient ID and increments it for next time.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

get_recipe_config()

+ + +
+
+ + +
+

Gets the current recipe configuration.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

set_recipe_config(recipe_config)

+ + +
+
+ + +
+

Given a recipe configuration, sets the recipe to that configuration.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
recipe_config + + +Array.<Object> + + + + +

The recipe configuration

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

reset_layout()

+ + +
+
+ + +
+

Resets the splitter positions to default.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

set_compile_message()

+ + +
+
+ + +
+

Sets the compile message.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

alert(str, style, timeout [, silent])

+ + +
+
+ + +
+

Pops up a message to the user and writes it to the console log.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
str + + +string + + + + + + + + + + + + +

The message to display (HTML supported)

style + + +string + + + + + + + + + + + + +

The colour of the popup
"danger" = red
"warning" = amber
"info" = blue
"success" = green

timeout + + +number + + + + + + + + + + + + +

The number of milliseconds before the popup closes automatically
0 for never (until the user closes it)

silent + + +boolean + + + + + + + <optional>
+ + + + + +
+ + false + +

Don't show the message in the popup, only print it to the
console

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Example
+ +
// Pops up a red box with the message "[current time] Error: Something has gone wrong!"
+// that will need to be dismissed by the user.
+this.alert("Error: Something has gone wrong!", "danger", 0);
+
+// Pops up a blue information box with the message "[current time] Happy Christmas!"
+// that will disappear after 5 seconds.
+this.alert("Happy Christmas!", "info", 5000);
+ + + +
+ + + +
+
+

confirm(title, body, callback [, scope])

+ + +
+
+ + +
+

Pops up a box asking the user a question and sending the answer to a specified callback function.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
title + + +string + + + + + + + + + + + + +

The title of the box

body + + +string + + + + + + + + + + + + +

The question (HTML supported)

callback + + +function + + + + + + + + + + + + +

A function accepting one boolean argument which handles the
response e.g. function(answer) {...}

scope + + +Object + + + + + + + <optional>
+ + + + + +
+ + this + +

The object to bind to the callback function

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Example
+ +
// Pops up a box asking if the user would like a cookie. Prints the answer to the console.
+this.confirm("Question", "Would you like a cookie?", function(answer) {console.log(answer);});
+ + + +
+ + + +
+
+

alert_close_click()

+ + +
+
+ + +
+

Handler for the alert close button click event.
Closes the alert box.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

state_change(e)

+ + +
+
+ + +
+

Handler for CyerChef statechange events.
Fires whenever the input or recipe changes in any way.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + +
Listens to Events:
+ + + + + + + + + + +
+ + + +
+
+

pop_state(e)

+ + +
+
+ + +
+

Handler for the history popstate event.
Reloads parameters from the URL.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

call_api()

+ + +
+
+ + +
+

Function to call an external API from this view.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/HTMLCategory.html b/docs/HTMLCategory.html new file mode 100755 index 00000000..807cd895 --- /dev/null +++ b/docs/HTMLCategory.html @@ -0,0 +1,697 @@ + + + + + + + CyberChef Class: HTMLCategory + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: HTMLCategory

+
+ +
+ +

+ HTMLCategory +

+ + +
+ + +
+
+ + +
+
+

new HTMLCategory(name, selected)

+ + +
+
+ + +
+

Object to handle the creation of operation categories.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + +

The name of the category.

selected + + +boolean + + + + +

Whether this category is pre-selected or not.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

add_operation(operation)

+ + +
+
+ + +
+

Adds an operation to this category.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operation + + +HTMLOperation + + + + +

The operation to add.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

to_html()

+ + +
+
+ + +
+

Renders the category and all operations within it in HTML.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/HTMLIngredient.html b/docs/HTMLIngredient.html new file mode 100755 index 00000000..6192f749 --- /dev/null +++ b/docs/HTMLIngredient.html @@ -0,0 +1,997 @@ + + + + + + + CyberChef Class: HTMLIngredient + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: HTMLIngredient

+
+ +
+ +

+ HTMLIngredient +

+ + +
+ + +
+
+ + +
+
+

new HTMLIngredient(config, app, manager)

+ + +
+
+ + +
+

Object to handle the creation of operation ingredients.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
config + + +Object + + + + +

The configuration object for this ingredient.

app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

to_html()

+ + +
+
+ + +
+

Renders the ingredient in HTML.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

toggle_disable_args(e)

+ + +
+
+ + +
+

Handler for argument disable toggle.
Toggles disabled state for all arguments in the disable_args list for this ingredient.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

populate_option_change(e)

+ + +
+
+ + +
+

Handler for populate option changes.
Populates the relevant argument with the specified value.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

editable_option_change(e)

+ + +
+
+ + +
+

Handler for editable option changes.
Populates the input box with the selected value.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/HTMLOperation.html b/docs/HTMLOperation.html new file mode 100755 index 00000000..7c2bbb81 --- /dev/null +++ b/docs/HTMLOperation.html @@ -0,0 +1,1037 @@ + + + + + + + CyberChef Class: HTMLOperation + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: HTMLOperation

+
+ +
+ +

+ HTMLOperation +

+ + +
+ + +
+
+ + +
+
+

new HTMLOperation(name, config, app, manager)

+ + +
+
+ + +
+

Object to handle the creation of operations.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + +

The name of the operation.

config + + +Object + + + + +

The configuration object for this operation.

app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> INFO_ICON

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_ICON

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

to_stub_html()

+ + +
+
+ + +
+

Renders the operation in HTML as a stub operation with no ingredients.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

to_full_html()

+ + +
+
+ + +
+

Renders the operation in HTML as a full operation with ingredients.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

highlight_search_string(search_str, name_pos, desc_pos)

+ + +
+
+ + +
+

Highlights the searched string in the name and description of the operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
search_str + + +string + + + + +
name_pos + + +number + + + + +

The position of the search string in the operation name

desc_pos + + +number + + + + +

The position of the search string in the operation description

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/HTTP.html b/docs/HTTP.html new file mode 100755 index 00000000..af4886a8 --- /dev/null +++ b/docs/HTTP.html @@ -0,0 +1,709 @@ + + + + + + + CyberChef Namespace: HTTP + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: HTTP

+
+ +
+ +

+ HTTP +

+ + +
+ + +
+
+ + +

HTTP operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<static> run_strip_headers(input, args)

+ + +
+
+ + +
+

Strip HTTP headers operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_parse_user_agent(input, args)

+ + +
+
+ + +
+

Parse User Agent operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Hash.html b/docs/Hash.html new file mode 100755 index 00000000..b24a05e6 --- /dev/null +++ b/docs/Hash.html @@ -0,0 +1,2497 @@ + + + + + + + CyberChef Namespace: Hash + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Hash

+
+ +
+ +

+ Hash +

+ + +
+ + +
+
+ + +

Hashing operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> SHA3_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["512","384","256","224"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> HMAC_FUNCTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["MD5","SHA1","SHA224","SHA256","SHA384","SHA512","SHA3","RIPEMD-160"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_md5(input, args)

+ + +
+
+ + +
+

MD5 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sha1(input, args)

+ + +
+
+ + +
+

SHA1 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sha224(input, args)

+ + +
+
+ + +
+

SHA224 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sha256(input, args)

+ + +
+
+ + +
+

SHA256 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sha384(input, args)

+ + +
+
+ + +
+

SHA384 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sha512(input, args)

+ + +
+
+ + +
+

SHA512 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_sha3(input, args)

+ + +
+
+ + +
+

SHA3 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_ripemd160(input, args)

+ + +
+
+ + +
+

RIPEMD-160 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_hmac(input, args)

+ + +
+
+ + +
+

HMAC operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_all(input, args)

+ + +
+
+ + +
+

Generate all hashes operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_analyse(input, args)

+ + +
+
+ + +
+

Analyse hash operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Hexdump.html b/docs/Hexdump.html new file mode 100755 index 00000000..361387d6 --- /dev/null +++ b/docs/Hexdump.html @@ -0,0 +1,1386 @@ + + + + + + + CyberChef Namespace: Hexdump + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Hexdump

+
+ +
+ +

+ Hexdump +

+ + +
+ + +
+
+ + +

Hexdump operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> WIDTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 16
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> UPPER_CASE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> INCLUDE_FINAL_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_to(input, args)

+ + +
+
+ + +
+

To Hexdump operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from(input, args)

+ + +
+
+ + +
+

From Hexdump operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_to(pos, args)

+ + +
+
+ + +
+

Highlight to hexdump

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

<static> highlight_from(pos, args)

+ + +
+
+ + +
+

Highlight from hexdump

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Array.<Object> + + + + +
pos[].start + + +number + + + + +
pos[].end + + +number + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

pos

+
+ + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/HighlighterWaiter.html b/docs/HighlighterWaiter.html new file mode 100755 index 00000000..7e450df2 --- /dev/null +++ b/docs/HighlighterWaiter.html @@ -0,0 +1,3673 @@ + + + + + + + CyberChef Class: HighlighterWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: HighlighterWaiter

+
+ +
+ +

+ HighlighterWaiter +

+ + +
+ + +
+
+ + +
+
+

new HighlighterWaiter(app)

+ + +
+
+ + +
+

Waiter to handle events related to highlighting in CyberChef.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, readonly> INPUT

+ + +
+
+ +
+

HighlighterWaiter data type enum for the input.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, readonly> OUTPUT

+ + +
+
+ +
+

HighlighterWaiter data type enum for the output.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<private> _is_selection_backwards()

+ + +
+
+ + +
+

Determines if the current text selection is running backwards or forwards.
StackOverflow answer id: 12652116

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

<private> _get_output_html_offset(node, offset)

+ + +
+
+ + +
+

Calculates the text offset of a position in an HTML element, ignoring HTML tags.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
node + + +element + + + + +

The parent HTML node.

offset + + +number + + + + +

The offset since the last HTML element.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<private> _get_output_html_selection_offsets()

+ + +
+
+ + +
+

Gets the current selection offsets in the output HTML, ignoring HTML tags.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+
    +
  • +
    +

    pos

    +
    + + + +
    +
    + Type +
    +
    + +Object + + + +
    +
    + +
  • + +
  • +
    +

    pos.start

    +
    + + + +
    +
    + Type +
    +
    + +number + + + +
    +
    + +
  • + +
  • +
    +

    pos.end

    +
    + + + +
    +
    + Type +
    +
    + +number + + + +
    +
    + +
  • +
+ + +
+ + + +
+
+

input_scroll(e)

+ + +
+
+ + +
+

Handler for input scroll events.
Scrolls the highlighter pane to match the input textarea position.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

output_scroll(e)

+ + +
+
+ + +
+

Handler for output scroll events.
Scrolls the highlighter pane to match the output textarea position.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

input_mousedown(e)

+ + +
+
+ + +
+

Handler for input mousedown events.
Calculates the current selection info, and highlights the corresponding data in the output.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

output_mousedown(e)

+ + +
+
+ + +
+

Handler for output mousedown events.
Calculates the current selection info, and highlights the corresponding data in the input.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

output_html_mousedown(e)

+ + +
+
+ + +
+

Handler for output HTML mousedown events.
Calculates the current selection info.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

input_mouseup(e)

+ + +
+
+ + +
+

Handler for input mouseup events.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

output_mouseup(e)

+ + +
+
+ + +
+

Handler for output mouseup events.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

output_html_mouseup(e)

+ + +
+
+ + +
+

Handler for output HTML mouseup events.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

input_mousemove(e)

+ + +
+
+ + +
+

Handler for input mousemove events.
Calculates the current selection info, and highlights the corresponding data in the output.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

output_mousemove(e)

+ + +
+
+ + +
+

Handler for output mousemove events.
Calculates the current selection info, and highlights the corresponding data in the input.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

output_html_mousemove(e)

+ + +
+
+ + +
+

Handler for output HTML mousemove events.
Calculates the current selection info.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

selection_info(start, end)

+ + +
+
+ + +
+

Given start and end offsets, writes the HTML for the selection info element with the correct
padding.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
start + + +number + + + + +

The start offset.

end + + +number + + + + +

The end offset.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

remove_highlights()

+ + +
+
+ + +
+

Removes highlighting and selection information.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

generate_highlight_list()

+ + +
+
+ + +
+

Generates a list of all the highlight functions assigned to operations in the recipe, if the
entire recipe supports highlighting.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+
    +
  • +
    +

    highlights

    +
    + + + +
    +
    + Type +
    +
    + +Array.<Object> + + + +
    +
    + +
  • + +
  • +
    +

    highlights[].f

    +
    + + + +
    +
    + Type +
    +
    + +function + + + +
    +
    + +
  • + +
  • +
    +

    highlights[].b

    +
    + + + +
    +
    + Type +
    +
    + +function + + + +
    +
    + +
  • + +
  • +
    +

    highlights[].args

    +
    + + + +
    +
    + Type +
    +
    + +Array.<Object> + + + +
    +
    + +
  • +
+ + +
+ + + +
+
+

highlight_output(pos)

+ + +
+
+ + +
+

Highlights the given offsets in the output.
We will only highlight if:

+
- input hasn't changed since last bake
+- last bake was a full bake
+- all operations in the recipe support highlighting
+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Object + + + + +

The position object for the highlight.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
start + + +number + + + + +

The start offset.

end + + +number + + + + +

The end offset.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

highlight_input(pos)

+ + +
+
+ + +
+

Highlights the given offsets in the input.
We will only highlight if:

+
- input hasn't changed since last bake
+- last bake was a full bake
+- all operations in the recipe support highlighting
+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +Object + + + + +

The position object for the highlight.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
start + + +number + + + + +

The start offset.

end + + +number + + + + +

The end offset.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

highlight(textarea, highlighter, pos)

+ + +
+
+ + +
+

Adds the relevant HTML to the specified highlight element such that highlighting appears
underneath the correct offset.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
textarea + + +element + + + + +

The input or output textarea.

highlighter + + +element + + + + +

The input or output highlighter element.

pos + + +Object + + + + +

The position object for the highlight.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
start + + +number + + + + +

The start offset.

end + + +number + + + + +

The end offset.

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/IP.html b/docs/IP.html new file mode 100755 index 00000000..2704ba0a --- /dev/null +++ b/docs/IP.html @@ -0,0 +1,3651 @@ + + + + + + + CyberChef Namespace: IP + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: IP

+
+ +
+ +

+ IP +

+ + +
+ + +
+
+ + +

Internet Protocol address operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> INCLUDE_NETWORK_INFO

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ENUMERATE_ADDRESSES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ALLOW_LARGE_LIST

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> IPv4_REGEX

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • /^\s*((?:\d{1,3}\.){3}\d{1,3})\s*$/
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> IPv6_REGEX

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • /^\s*(((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\4)::|:\b|(?![\dA-F])))|(?!\3\4)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4}))\s*$/i
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> IP_FORMAT_LIST

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Dotted Decimal","Decimal","Hex"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DELIM_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Line feed","CRLF","Space","Comma","Semi-colon"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> GROUP_CIDR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 24
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> GROUP_ONLY_SUBNET

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<private, static, constant> _LARGE_RANGE_ERROR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • The specified range contains more than 65,536 addresses. Running this query could crash your browser. If you want to run it, select the "Allow large queries" option. You are advised to turn off "Auto Bake" whilst editing large ranges.
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_parse_ip_range(input, args)

+ + +
+
+ + +
+

Parse IP range operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_parse_ipv6(input, args)

+ + +
+
+ + +
+

Parse IPv6 address operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_change_ip_format(input, args)

+ + +
+
+ + +
+

Change IP format operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_group_ips(input, args)

+ + +
+
+ + +
+

Group IP addresses operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _ipv4_cidr_range(cidr, include_network_info, enumerate_addresses, allow_large_list)

+ + +
+
+ + +
+

Parses an IPv4 CIDR range (e.g. 192.168.0.0/24) and displays information about it.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cidr + + +RegExp + + + + +
include_network_info + + +boolean + + + + +
enumerate_addresses + + +boolean + + + + +
allow_large_list + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _ipv6_cidr_range(cidr, include_network_info)

+ + +
+
+ + +
+

Parses an IPv6 CIDR range (e.g. ff00::/48) and displays information about it.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cidr + + +RegExp + + + + +
include_network_info + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _gen_ipv6_mask(cidr)

+ + +
+
+ + +
+

Generates an IPv6 subnet mask given a CIDR value.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cidr + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<number> + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _ipv4_hyphenated_range(range, include_network_info, enumerate_addresses, allow_large_list)

+ + +
+
+ + +
+

Parses an IPv4 hyphenated range (e.g. 192.168.0.0 - 192.168.0.255) and displays information
about it.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
range + + +RegExp + + + + +
include_network_info + + +boolean + + + + +
enumerate_addresses + + +boolean + + + + +
allow_large_list + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _ipv6_hyphenated_range(range, include_network_info)

+ + +
+
+ + +
+

Parses an IPv6 hyphenated range (e.g. ff00:: - ffff::) and displays information about it.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
range + + +RegExp + + + + +
include_network_info + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _str_to_ipv4(ip_str)

+ + +
+
+ + +
+

Converts an IPv4 address from string format to numerical format.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ip_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
Example
+ +
// returns 168427520
+IP._str_to_ipv4("10.10.0.0");
+ + + +
+ + + +
+
+

<private, static> _ipv4_to_str(ip_int)

+ + +
+
+ + +
+

Converts an IPv4 address from numerical format to string format.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ip_int + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "10.10.0.0"
+IP._ipv4_to_str(168427520);
+ + + +
+ + + +
+
+

<private, static> _str_to_ipv6(ip_str)

+ + +
+
+ + +
+

Converts an IPv6 address from string format to numerical array format.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ip_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<number> + + + +
+
+ + + + + +
Example
+ +
// returns [65280, 0, 0, 0, 0, 0, 4369, 8738]
+IP._str_to_ipv6("ff00::1111:2222");
+ + + +
+ + + +
+
+

<private, static> _ipv6_to_str(ipv6, compact)

+ + +
+
+ + +
+

Converts an IPv6 address from numerical array format to string format.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ipv6 + + +Array.<number> + + + + +
compact + + +boolean + + + + +

Whether or not to return the address in shorthand or not

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "ff00::1111:2222"
+IP._ipv6_to_str([65280, 0, 0, 0, 0, 0, 4369, 8738], true);
+
+// returns "ff00:0000:0000:0000:0000:0000:1111:2222"
+IP._ipv6_to_str([65280, 0, 0, 0, 0, 0, 4369, 8738], false);
+ + + +
+ + + +
+
+

<private, static> _generate_ipv4_range(ip, end_ip)

+ + +
+
+ + +
+

Generates a list of IPv4 addresses in string format between two given numerical values.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ip + + +number + + + + +
end_ip + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<string> + + + +
+
+ + + + + +
Example
+ +
// returns ["0.0.0.1", "0.0.0.2", "0.0.0.3"]
+IP._generate_ipv4_range(1, 3);
+ + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Ingredient.html b/docs/Ingredient.html new file mode 100755 index 00000000..9289bbbe --- /dev/null +++ b/docs/Ingredient.html @@ -0,0 +1,973 @@ + + + + + + + CyberChef Class: Ingredient + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Ingredient

+
+ +
+ +

+ Ingredient +

+ + +
+ + +
+
+ + +
+
+

new Ingredient(ingredient_config)

+ + +
+
+ + +
+

The arguments to operations.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ingredient_config + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<private> _parse_config(ingredient_config)

+ + +
+
+ + +
+

Reads and parses the given config.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ingredient_config + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

get_config()

+ + +
+
+ + +
+

Returns the value of the Ingredient as it should be displayed in a recipe config.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + + +
+
+ + + + + +
+ + + +
+
+

set_value(value)

+ + +
+
+ + +
+

Sets the value of the Ingredient.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +* + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

<static> prepare(data, type)

+ + +
+
+ + +
+

Most values will be strings when they are entered. This function converts them to the correct
type.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +* + + + + +
type + + +string + + + + +

The name of the data type.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/InputWaiter.html b/docs/InputWaiter.html new file mode 100755 index 00000000..052daaf1 --- /dev/null +++ b/docs/InputWaiter.html @@ -0,0 +1,1514 @@ + + + + + + + CyberChef Class: InputWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: InputWaiter

+
+ +
+ +

+ InputWaiter +

+ + +
+ + +
+
+ + +
+
+

new InputWaiter(app, manager)

+ + +
+
+ + +
+

Waiter to handle events related to the input.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

get()

+ + +
+
+ + +
+

Gets the user's input from the input textarea.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

set(input)

+ + +
+
+ + +
+

Sets the input in the input textarea.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

set_input_info(length, lines)

+ + +
+
+ + +
+

Displays information about the input.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + +number + + + + +

The length of the current input string

lines + + +number + + + + +

The number of the lines in the current input string

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

input_change(e)

+ + +
+
+ + +
+

Handler for input scroll events.
Scrolls the highlighter pane to match the input textarea position and updates history state.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

input_dragover(e)

+ + +
+
+ + +
+

Handler for input dragover events.
Gives the user a visual cue to show that items can be dropped here.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

input_dragleave(e)

+ + +
+
+ + +
+

Handler for input dragleave events.
Removes the visual cue.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

input_drop(e)

+ + +
+
+ + +
+

Handler for input drop events.
Loads the dragged data into the input textarea.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

clear_io_click()

+ + +
+
+ + +
+

Handler for clear IO events.
Resets the input, output and info areas.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/JS.html b/docs/JS.html new file mode 100755 index 00000000..2000965b --- /dev/null +++ b/docs/JS.html @@ -0,0 +1,1517 @@ + + + + + + + CyberChef Namespace: JS + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: JS

+
+ +
+ +

+ JS +

+ + +
+ + +
+
+ + +

JavaScript operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> PARSE_LOC

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PARSE_RANGE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PARSE_TOKENS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PARSE_COMMENT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PARSE_TOLERANT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BEAUTIFY_INDENT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • \t
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BEAUTIFY_QUOTES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Auto","Single","Double"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BEAUTIFY_SEMICOLONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> BEAUTIFY_COMMENT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_parse(input, args)

+ + +
+
+ + +
+

JavaScript Parser operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_beautify(input, args)

+ + +
+
+ + +
+

JavaScript Beautify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_minify(input, args)

+ + +
+
+ + +
+

JavaScript Minify operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/MAC.html b/docs/MAC.html new file mode 100755 index 00000000..6483ba8c --- /dev/null +++ b/docs/MAC.html @@ -0,0 +1,889 @@ + + + + + + + CyberChef Namespace: MAC + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: MAC

+
+ +
+ +

+ MAC +

+ + +
+ + +
+
+ + +

MAC address operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> OUTPUT_CASE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Both","Upper only","Lower only"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> NO_DELIM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DASH_DELIM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> COLON_DELIM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> CISCO_STYLE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_format(input, args)

+ + +
+
+ + +
+

Format MAC addresses operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Manager.html b/docs/Manager.html new file mode 100755 index 00000000..961620ea --- /dev/null +++ b/docs/Manager.html @@ -0,0 +1,2280 @@ + + + + + + + CyberChef Class: Manager + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Manager

+
+ +
+ +

+ Manager +

+ + +
+ + +
+
+ + +
+
+

new Manager(app)

+ + +
+
+ + +
+

This object controls the Waiters responsible for handling events from all areas of the app.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

setup()

+ + +
+
+ + +
+

Sets up the various components and listeners.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

initialise_event_listeners()

+ + +
+
+ + +
+

Main function to handle the creation of the event listeners.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

add_listeners(selector, event_type, callback [, scope])

+ + +
+
+ + +
+

Adds an event listener to each element in the specified group.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
selector + + +string + + + + + + + + + + + + +

A selector string for the element group to add the event to, see
this.get_all()

event_type + + +string + + + + + + + + + + + + +

The event to listen for

callback + + +function + + + + + + + + + + + + +

The function to execute when the event is triggered

scope + + +Object + + + + + + + <optional>
+ + + + + +
+ + this + +

The object to bind to the callback function

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Example
+ +
// Calls the clickable function whenever any element with the .clickable class is clicked
+this.add_listeners(".clickable", "click", this.clickable, this);
+ + + +
+ + + +
+
+

add_multi_event_listener(selector, event_types, callback [, scope])

+ + +
+
+ + +
+

Adds multiple event listeners to the specified element.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
selector + + +string + + + + + + + + + + + + +

A selector string for the element to add the events to

event_types + + +string + + + + + + + + + + + + +

A space-separated string of all the event types to listen for

callback + + +function + + + + + + + + + + + + +

The function to execute when the events are triggered

scope + + +Object + + + + + + + <optional>
+ + + + + +
+ + this + +

The object to bind to the callback function

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Example
+ +
// Calls the search function whenever the the keyup, paste or search events are triggered on the
+// search element
+this.add_multi_event_listener("search", "keyup paste search", this.search, this);
+ + + +
+ + + +
+
+

add_multi_event_listeners(selector, event_types, callback [, scope])

+ + +
+
+ + +
+

Adds multiple event listeners to each element in the specified group.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
selector + + +string + + + + + + + + + + + + +

A selector string for the element group to add the events to

event_types + + +string + + + + + + + + + + + + +

A space-separated string of all the event types to listen for

callback + + +function + + + + + + + + + + + + +

The function to execute when the events are triggered

scope + + +Object + + + + + + + <optional>
+ + + + + +
+ + this + +

The object to bind to the callback function

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Example
+ +
// Calls the save function whenever the the keyup or paste events are triggered on any element
+// with the .saveable class
+this.add_multi_event_listener(".saveable", "keyup paste", this.save, this);
+ + + +
+ + + +
+
+

add_dynamic_listener(selector, event_type, callback [, scope])

+ + +
+
+ + +
+

Adds an event listener to the global document object which will listen on dynamic elements which
may not exist in the DOM yet.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
selector + + +string + + + + + + + + + + + + +

A selector string for the element(s) to add the event to

event_type + + +string + + + + + + + + + + + + +

The event(s) to listen for

callback + + +function + + + + + + + + + + + + +

The function to execute when the event(s) is/are triggered

scope + + +Object + + + + + + + <optional>
+ + + + + +
+ + this + +

The object to bind to the callback function

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Example
+ +
// Pops up an alert whenever any button is clicked, even if it is added to the DOM after this
+// listener is created
+this.add_dynamic_listener("button", "click", alert, this);
+ + + +
+ + + +
+
+

dynamic_listener_handler(e)

+ + +
+
+ + +
+

Handler for dynamic events. This function is called for any dynamic event and decides which
callback(s) to execute based on the type and selector.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +Event + + + + +

The event to be handled

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +

Events

+ +
+ +
+
+

appstart

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

operationadd

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

operationremove

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

oplistcreate

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

statechange

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ +
+ +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Numberwang.html b/docs/Numberwang.html new file mode 100755 index 00000000..11b730f1 --- /dev/null +++ b/docs/Numberwang.html @@ -0,0 +1,513 @@ + + + + + + + CyberChef Namespace: Numberwang + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Numberwang

+
+ +
+ +

+ Numberwang +

+ + +
+ + +
+
+ + +

Numberwang operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • Unknown Male 282
  • +
+
+ + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<static> run(input, args)

+ + +
+
+ + +
+

Numberwang operation. Remain indoors.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/OS.html b/docs/OS.html new file mode 100755 index 00000000..4f13a72c --- /dev/null +++ b/docs/OS.html @@ -0,0 +1,1001 @@ + + + + + + + CyberChef Namespace: OS + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: OS

+
+ +
+ +

+ OS +

+ + +
+ + +
+
+ + +

Operating system operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<static> run_parse_unix_perms(input, args)

+ + +
+
+ + +
+

Parse UNIX file permissions operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _perms_to_str(perms)

+ + +
+
+ + +
+

Given a permissions object dictionary, generates a textual permissions string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
perms + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _perms_to_octal(perms)

+ + +
+
+ + +
+

Given a permissions object dictionary, generates an octal permissions string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
perms + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _ft_from_perms(perms)

+ + +
+
+ + +
+

Given a permissions object dictionary, returns the file type.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
perms + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Operation.html b/docs/Operation.html new file mode 100755 index 00000000..6685162f --- /dev/null +++ b/docs/Operation.html @@ -0,0 +1,1681 @@ + + + + + + + CyberChef Class: Operation + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Operation

+
+ +
+ +

+ Operation +

+ + +
+ + +
+
+ + +
+
+

new Operation(operation_name, operation_config)

+ + +
+
+ + +
+

The Operation specified by the user to be run.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operation_name + + +string + + + + +
operation_config + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<private> _parse_config(operation_config)

+ + +
+
+ + +
+

Reads and parses the given config.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operation_config + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

get_config()

+ + +
+
+ + +
+

Returns the value of the Operation as it should be displayed in a recipe config.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ + + +
+
+

add_ingredient(ingredient)

+ + +
+
+ + +
+

Adds a new Ingredient to this Operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ingredient + + +Ingredient + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

set_ing_values(ing_values)

+ + +
+
+ + +
+

Set the Ingredient values for this Operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ing_values + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

get_ing_values()

+ + +
+
+ + +
+

Get the Ingredient values for this Operation.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<Object> + + + +
+
+ + + + + +
+ + + +
+
+

set_breakpoint(value)

+ + +
+
+ + +
+

Set whether this Operation has a breakpoint.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

is_breakpoint()

+ + +
+
+ + +
+

Returns true if this Operation has a breakpoint set.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

set_disabled(value)

+ + +
+
+ + +
+

Set whether this Operation is disabled.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
value + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

is_disabled()

+ + +
+
+ + +
+

Returns true if this Operation is disabled.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

is_flow_control()

+ + +
+
+ + +
+

Returns true if this Operation is a flow control.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/OperationsWaiter.html b/docs/OperationsWaiter.html new file mode 100755 index 00000000..d89e3c30 --- /dev/null +++ b/docs/OperationsWaiter.html @@ -0,0 +1,1800 @@ + + + + + + + CyberChef Class: OperationsWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: OperationsWaiter

+
+ +
+ +

+ OperationsWaiter +

+ + +
+ + +
+
+ + +
+
+

new OperationsWaiter(app, manager)

+ + +
+
+ + +
+

Waiter to handle events related to the operations.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

search_operations(e)

+ + +
+
+ + +
+

Handler for search events.
Finds operations which match the given search term and displays them under the search box.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

filter_operations(search_str, highlight)

+ + +
+
+ + +
+

Filters operations based on the search string and returns the matching ones.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
search_str + + +string + + + + +
highlight + + +boolean + + + + +

Whether or not to highlight the matching string in the operation
name and description

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<string> + + + +
+
+ + + + + +
+ + + +
+
+

get_selected_op(ops)

+ + +
+
+ + +
+

Finds the operation which has been selected using keyboard shortcuts. This will have the class
'selected-op' set. Returns the index of the operation within the given list.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ops + + +Array.<element> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

op_list_create(e)

+ + +
+
+ + +
+

Handler for oplistcreate events.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + +
Listens to Events:
+ + + + + + + + + + +
+ + + +
+
+

operation_dblclick(e)

+ + +
+
+ + +
+

Handler for operation doubleclick events.
Adds the operation to the recipe and auto bakes.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

edit_favourites_click(e)

+ + +
+
+ + +
+

Handler for edit favourites click events.
Sets up the 'Edit favourites' pane and displays it.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

save_favourites_click()

+ + +
+
+ + +
+

Handler for save favourites click events.
Saves the selected favourites and reloads them.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

reset_favourites_click()

+ + +
+
+ + +
+

Handler for reset favourites click events.
Resets favourites to their defaults.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

op_icon_mouseover(e)

+ + +
+
+ + +
+

Handler for op_icon mouseover events.
Hides any popovers already showing on the operation so that there aren't two at once.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

op_icon_mouseleave(e)

+ + +
+
+ + +
+

Handler for op_icon mouseleave events.
If this icon created a popover and we're moving back to the operation element, display the
operation popover again.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/OptionsWaiter.html b/docs/OptionsWaiter.html new file mode 100755 index 00000000..194fb36c --- /dev/null +++ b/docs/OptionsWaiter.html @@ -0,0 +1,1267 @@ + + + + + + + CyberChef Class: OptionsWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: OptionsWaiter

+
+ +
+ +

+ OptionsWaiter +

+ + +
+ + +
+
+ + +
+
+

new OptionsWaiter(app)

+ + +
+
+ + +
+

Waiter to handle events related to the CyberChef options.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

load(options)

+ + +
+
+ + +
+

Loads options and sets values of switches and inputs to match them.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

options_click()

+ + +
+
+ + +
+

Handler for options click events.
Dispays the options pane.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

reset_options_click()

+ + +
+
+ + +
+

Handler for reset options click events.
Resets options back to their default values.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

switch_change(e, state)

+ + +
+
+ + +
+

Handler for switch change events.
Modifies the option state and saves it to local storage.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
state + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

number_change(e)

+ + +
+
+ + +
+

Handler for number change events.
Modifies the option value and saves it to local storage.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

select_change(e)

+ + +
+
+ + +
+

Handler for select change events.
Modifies the option value and saves it to local storage.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

set_word_wrap()

+ + +
+
+ + +
+

Sets or unsets word wrap on the input and output depending on the word_wrap option value.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/OutputWaiter.html b/docs/OutputWaiter.html new file mode 100755 index 00000000..659ce5e8 --- /dev/null +++ b/docs/OutputWaiter.html @@ -0,0 +1,1195 @@ + + + + + + + CyberChef Class: OutputWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: OutputWaiter

+
+ +
+ +

+ OutputWaiter +

+ + +
+ + +
+
+ + +
+
+

new OutputWaiter(app, manager)

+ + +
+
+ + +
+

Waiter to handle events related to the output.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

get()

+ + +
+
+ + +
+

Gets the output string from the output textarea.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

set(data_str, type, duration)

+ + +
+
+ + +
+

Sets the output in the output textarea.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data_str + + +string + + + + +

The output string/HTML

type + + +string + + + + +

The data type of the output

duration + + +number + + + + +

The length of time (ms) it took to generate the output

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

set_output_info(length, lines, duration)

+ + +
+
+ + +
+

Displays information about the output.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
length + + +number + + + + +

The length of the current output string

lines + + +number + + + + +

The number of the lines in the current output string

duration + + +number + + + + +

The length of time (ms) it took to generate the output

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

save_click()

+ + +
+
+ + +
+

Handler for save click events.
Saves the current output to a file, downloaded as a URL octet stream.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

switch_click()

+ + +
+
+ + +
+

Handler for switch click events.
Moves the current output into the input textarea.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

undo_switch_click()

+ + +
+
+ + +
+

Handler for undo switch click events.
Removes the output from the input and replaces the input that was removed.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/PublicKey.html b/docs/PublicKey.html new file mode 100755 index 00000000..8db5d5bc --- /dev/null +++ b/docs/PublicKey.html @@ -0,0 +1,2206 @@ + + + + + + + CyberChef Namespace: PublicKey + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: PublicKey

+
+ +
+ +

+ PublicKey +

+ + +
+ + +
+
+ + +

Public Key operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> X509_INPUT_FORMAT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["PEM","DER Hex","Base64","Raw"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PEM_HEADER_STRING

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • CERTIFICATE
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ASN1_TRUNCATE_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 32
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_parse_x509(input, args)

+ + +
+
+ + +
+

Parse X.509 certificate operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_pem_to_hex(input, args)

+ + +
+
+ + +
+

PEM to Hex operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_hex_to_pem(input, args)

+ + +
+
+ + +
+

Hex to PEM operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_hex_to_object_identifier(input, args)

+ + +
+
+ + +
+

Hex to Object Identifier operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_object_identifier_to_hex(input, args)

+ + +
+
+ + +
+

Object Identifier to Hex operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_parse_asn1_hex_string(input, args)

+ + +
+
+ + +
+

Parse ASN.1 hex string operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _format_dn_str(dn_str, indent)

+ + +
+
+ + +
+

Formats Distinguished Name (DN) strings.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
dn_str + + +string + + + + +
indent + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _format_byte_str(byte_str, length, indent)

+ + +
+
+ + +
+

Formats byte strings by adding line breaks and delimiters.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
byte_str + + +string + + + + +
length + + +number + + + + +

Line width

indent + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _format_date(date_str)

+ + +
+
+ + +
+

Formats dates.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
date_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Punycode.html b/docs/Punycode.html new file mode 100755 index 00000000..fe44c8f8 --- /dev/null +++ b/docs/Punycode.html @@ -0,0 +1,779 @@ + + + + + + + CyberChef Namespace: Punycode + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Punycode

+
+ +
+ +

+ Punycode +

+ + +
+ + +
+
+ + +

Punycode operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> IDN

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_to_ascii(input, args)

+ + +
+
+ + +
+

To Punycode operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_to_unicode(input, args)

+ + +
+
+ + +
+

From Punycode operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/QuotedPrintable.html b/docs/QuotedPrintable.html new file mode 100755 index 00000000..38cc0708 --- /dev/null +++ b/docs/QuotedPrintable.html @@ -0,0 +1,1755 @@ + + + + + + + CyberChef Namespace: QuotedPrintable + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: QuotedPrintable

+
+ +
+ +

+ QuotedPrintable +

+ + +
+ + +
+
+ + +

Quoted Printable operations.
Some parts taken from mimelib (http://github.com/andris9/mimelib)

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • Andris Reinman
  • + +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<static> run_to(input, args)

+ + +
+
+ + +
+

To Quoted Printable operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from(input, args)

+ + +
+
+ + +
+

From Quoted Printable operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> mimeDecode(str)

+ + +
+
+ + +
+

Decodes mime-encoded data.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> mimeEncode(buffer)

+ + +
+
+ + +
+

Encodes mime data.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
buffer + + +byte_array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _checkRanges(nr, ranges)

+ + +
+
+ + +
+

Checks if a given number falls within a given set of ranges.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nr + + +number + + + + +
ranges + + +Array.<byte_array> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +bolean + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _addSoftLinebreaks(str, encoding)

+ + +
+
+ + +
+

Adds soft line breaks to a string.
Lines can't be longer that 76 + = 78 bytes
http://tools.ietf.org/html/rfc2045#section-6.7

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
encoding + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _addBase64SoftLinebreaks(base64EncodedStr, lineLengthMax)

+ + +
+
+ + +
+

Adds soft line breaks to a base64 string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
base64EncodedStr + + +string + + + + +
lineLengthMax + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _addQPSoftLinebreaks(mimeEncodedStr, lineLengthMax)

+ + +
+
+ + +
+

Adds soft line breaks to a quoted printable string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mimeEncodedStr + + +string + + + + +
lineLengthMax + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Recipe.html b/docs/Recipe.html new file mode 100755 index 00000000..cff88d0b --- /dev/null +++ b/docs/Recipe.html @@ -0,0 +1,1992 @@ + + + + + + + CyberChef Class: Recipe + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: Recipe

+
+ +
+ +

+ Recipe +

+ + +
+ + +
+
+ + +
+
+

new Recipe(recipe_config)

+ + +
+
+ + +
+

The Recipe controls a list of Operations and the Dish they operate on.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
recipe_config + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<private> _parse_config(recipe_config)

+ + +
+
+ + +
+

Reads and parses the given config.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
recipe_config + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

get_config()

+ + +
+
+ + +
+

Returns the value of the Recipe as it should be displayed in a recipe config.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + + +
+
+ + + + + +
+ + + +
+
+

add_operation(operation)

+ + +
+
+ + +
+

Adds a new Operation to this Recipe.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operation + + +Operation + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

add_operations(operations)

+ + +
+
+ + +
+

Adds a list of Operations to this Recipe.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
operations + + +Array.<Operation> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

set_breakpoint(position, value)

+ + +
+
+ + +
+

Set a breakpoint on a specified Operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
position + + +number + + + + +

The index of the Operation

value + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

remove_breaks_up_to(pos)

+ + +
+
+ + +
+

Remove breakpoints on all Operations in the Recipe up to the specified position. Used by Flow
Control Fork operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
pos + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

contains_flow_control()

+ + +
+
+ + +
+

Returns true if there is an Flow Control Operation in this Recipe.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + + +
+
+ + + + + +
+ + + +
+
+

last_op_index( [start_index])

+ + +
+
+ + +
+

Returns the index of the last Operation index that will be executed, taking into account disabled
Operations and breakpoints.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
start_index + + +number + + + + + + + <optional>
+ + + + + +
+ + 0 + +

The index to start searching from

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

(number}

+
+ + + + + + + +
+ + + +
+
+

execute(dish [, start_from])

+ + +
+
+ + +
+

Executes each operation in the recipe over the given Dish.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
dish + + +Dish + + + + + + + + + + + + +
start_from + + +number + + + + + + + <optional>
+ + + + + +
+ + 0 + +

The index of the Operation to start executing from

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+
    +
  • The final progress through the recipe
  • +
+
+ + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

to_string()

+ + +
+
+ + +
+

Returns the recipe configuration in string format.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

from_string(recipe_str)

+ + +
+
+ + +
+

Creates a Recipe from a given configuration string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
recipe_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/RecipeWaiter.html b/docs/RecipeWaiter.html new file mode 100755 index 00000000..eff240ed --- /dev/null +++ b/docs/RecipeWaiter.html @@ -0,0 +1,2973 @@ + + + + + + + CyberChef Class: RecipeWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: RecipeWaiter

+
+ +
+ +

+ RecipeWaiter +

+ + +
+ + +
+
+ + +
+
+

new RecipeWaiter(app, manager)

+ + +
+
+ + +
+

Waiter to handle events related to the recipe.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

initialise_operation_drag_n_drop()

+ + +
+
+ + +
+

Sets up the drag and drop capability for operations in the operations and recipe areas.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

create_sortable_seed_list(list_el)

+ + +
+
+ + +
+

Creates a drag-n-droppable seed list of operations.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
list_el + + +element + + + + +

The list the initialise

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

op_sort_end(evt)

+ + +
+
+ + +
+

Handler for operation sort end events.
Removes the operation from the list if it has been dropped outside. If not, adds it to the list
at the appropriate place and initialises it.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
evt + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

fav_dragover(e)

+ + +
+
+ + +
+

Handler for favourite dragover events.
If the element being dragged is an operation, displays a visual cue so that the user knows it can
be dropped here.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

fav_dragleave(e)

+ + +
+
+ + +
+

Handler for favourite dragleave events.
Removes the visual cue.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

fav_drop(e)

+ + +
+
+ + +
+

Handler for favourite drop events.
Adds the dragged operation to the favourites list.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

ing_change()

+ + +
+
+ + +
+

Handler for ingredient change events.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

disable_click(e)

+ + +
+
+ + +
+

Handler for disable click events.
Updates the icon status.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

breakpoint_click(e)

+ + +
+
+ + +
+

Handler for breakpoint click events.
Updates the icon status.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

operation_dblclick(e)

+ + +
+
+ + +
+

Handler for operation doubleclick events.
Removes the operation from the recipe and auto bakes.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

operation_child_dblclick(e)

+ + +
+
+ + +
+

Handler for operation child doubleclick events.
Removes the operation from the recipe.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+

get_config()

+ + +
+
+ + +
+

Generates a configuration object to represent the current recipe.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +recipe_config + + + +
+
+ + + + + +
+ + + +
+
+

update_breakpoint_indicator(position)

+ + +
+
+ + +
+

Moves or removes the breakpoint indicator in the recipe based on the position.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
position + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

build_recipe_operation(el)

+ + +
+
+ + +
+

Given an operation stub element, this function converts it into a full recipe element with
arguments.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
el + + +element + + + + +

The operation stub element from the operations pane

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

add_operation(name)

+ + +
+
+ + +
+

Adds the specified operation to the recipe.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + +

The name of the operation to add

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +element + + + +
+
+ + + + + +
+ + + +
+
+

clear_recipe()

+ + +
+
+ + +
+

Removes all operations from the recipe.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + + + + + + + + + +
+ + + +
+
+ + + +
+
+ + +
+

Handler for operation dropdown events from toggle_string arguments.
Sets the selected option as the name of the button.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

op_add(e)

+ + +
+
+ + +
+

Handler for operationadd events.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + +
Listens to Events:
+ + + + + + + + + + +
+ + + +
+
+

op_remove(e)

+ + +
+
+ + +
+

Handler for operationremove events.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
e + + +event + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + +
Fires:
+ + + + +
Listens to Events:
+ + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Rotate.html b/docs/Rotate.html new file mode 100755 index 00000000..0a4ad291 --- /dev/null +++ b/docs/Rotate.html @@ -0,0 +1,2146 @@ + + + + + + + CyberChef Namespace: Rotate + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Rotate

+
+ +
+ +

+ Rotate +

+ + +
+ + +
+
+ + +

Bit rotation operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
To Do:
+
+
    +
  • Support for UTF16
  • +
+
+ +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> ROTATE_AMOUNT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 1
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ROTATE_WHOLE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ROT13_AMOUNT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 13
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ROT13_LOWERCASE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> ROT13_UPPERCASE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<private, static> _rot(data, amount, algo)

+ + +
+
+ + +
+

Runs rotation operations across the input data.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +byte_array + + + + +
amount + + +number + + + + +
algo + + +function + + + + +

The rotation operation to carry out

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_rotr(input, args)

+ + +
+
+ + +
+

Rotate right operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_rotl(input, args)

+ + +
+
+ + +
+

Rotate left operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_rot13(input, args)

+ + +
+
+ + +
+

ROT13 operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _rotr(b)

+ + +
+
+ + +
+

Rotate right bitwise op.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
b + + +byte + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _rotl(b)

+ + +
+
+ + +
+

Rotate left bitwise op.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
b + + +byte + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _rotr_whole(data, amount)

+ + +
+
+ + +
+

Rotates a byte array to the right by a specific amount as a whole, so that bits are wrapped
from the end of the array to the beginning.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +byte_array + + + + +
amount + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _rotl_whole(data, amount)

+ + +
+
+ + +
+

Rotates a byte array to the left by a specific amount as a whole, so that bits are wrapped
from the beginning of the array to the end.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +byte_array + + + + +
amount + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/SeasonalWaiter.html b/docs/SeasonalWaiter.html new file mode 100755 index 00000000..9584f93c --- /dev/null +++ b/docs/SeasonalWaiter.html @@ -0,0 +1,1147 @@ + + + + + + + CyberChef Class: SeasonalWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: SeasonalWaiter

+
+ +
+ +

+ SeasonalWaiter +

+ + +
+ + +
+
+ + +
+
+

new SeasonalWaiter(app, manager)

+ + +
+
+ + +
+

Waiter to handle seasonal events and easter eggs.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

manager + + +Manager + + + + +

The CyberChef event manager.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static> tree_walk

+ + +
+
+ +
+

Walks through the entire DOM starting at the specified element and operates on each node.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

load()

+ + +
+
+ + +
+

Loads all relevant items depending on the current date.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

insert_spider_icons()

+ + +
+
+ + +
+

Replaces chef icons with spider icons.

+

#spiderchef

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

insert_spider_text()

+ + +
+
+ + +
+

Replaces all instances of the word "cyber" with "spider".

+

#spiderchef

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

create_snow_option()

+ + +
+
+ + +
+

Adds an option to make it snow.

+

#letitsnow

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

let_it_snow()

+ + +
+
+ + +
+

Initialises a snowstorm.

+

#letitsnow

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

shake_off_snow()

+ + +
+
+ + +
+

When a button is clicked, shake the snow off that button.

+

#letitsnow

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

konami_code_listener()

+ + +
+
+ + +
+

Listen for the Konami code sequence of keys. Turn the page upside down if they are all heard in
sequence.

+

#konamicode

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/SeqUtils.html b/docs/SeqUtils.html new file mode 100755 index 00000000..caafd8a8 --- /dev/null +++ b/docs/SeqUtils.html @@ -0,0 +1,2345 @@ + + + + + + + CyberChef Namespace: SeqUtils + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: SeqUtils

+
+ +
+ +

+ SeqUtils +

+ + +
+ + +
+
+ + +

Sequence utility operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> DELIMITER_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Line feed","CRLF","Space","Comma","Semi-colon","Colon","Nothing (separate chars)"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SORT_REVERSE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SORT_ORDER

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Alphabetical (case sensitive)","Alphabetical (case insensitive)","IP address"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SEARCH_TYPE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Regex","Extended (\\n, \\t, \\x...)","Simple string"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REVERSE_BY

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Character","Line"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_sort(input, args)

+ + +
+
+ + +
+

Sort operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_unique(input, args)

+ + +
+
+ + +
+

Unique operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_count(input, args)

+ + +
+
+ + +
+

Count occurrences operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_reverse(input, args)

+ + +
+
+ + +
+

Reverse operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_add_line_numbers(input, args)

+ + +
+
+ + +
+

Add line numbers operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_remove_line_numbers(input, args)

+ + +
+
+ + +
+

Remove line numbers operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_expand_alph_range(input, args)

+ + +
+
+ + +
+

Expand alphabet range operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _case_insensitive_sort(a, b)

+ + +
+
+ + +
+

Comparison operation for sorting of strings ignoring case.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +string + + + + +
b + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _ip_sort(a, b)

+ + +
+
+ + +
+

Comparison operation for sorting of IPv4 addresses.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +string + + + + +
b + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/StrUtils.html b/docs/StrUtils.html new file mode 100755 index 00000000..769fad7b --- /dev/null +++ b/docs/StrUtils.html @@ -0,0 +1,3346 @@ + + + + + + + CyberChef Namespace: StrUtils + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: StrUtils

+
+ +
+ +

+ StrUtils +

+ + +
+ + +
+
+ + +

String utility operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> REGEX_PRE_POPULATE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["{\"name\":\"User defined\",\"value\":\"\"}","{\"name\":\"IPv4 address\",\"value\":\"(?:(?:\\\\d|[01]?\\\\d\\\\d|2[0-4]\\\\d|25[0-5])\\\\.){3}(?:25[0-5]|2[0-4]\\\\d|[01]?\\\\d\\\\d|\\\\d)(?:\\\\/\\\\d{1,2})?\"}","{\"name\":\"IPv6 address\",\"value\":\"((?=.*::)(?!.*::.+::)(::)?([\\\\dA-Fa-f]{1,4}:(:|\\\\b)|){5}|([\\\\dA-Fa-f]{1,4}:){6})((([\\\\dA-Fa-f]{1,4}((?!\\\\3)::|:\\\\b|(?![\\\\dA-Fa-f])))|(?!\\\\2\\\\3)){2}|(((2[0-4]|1\\\\d|[1-9])?\\\\d|25[0-5])\\\\.?\\\\b){4})\"}","{\"name\":\"Email address\",\"value\":\"(\\\\w[-.\\\\w]*)@([-\\\\w]+(?:\\\\.[-\\\\w]+)*)\\\\.([A-Za-z]{2,4})\"}","{\"name\":\"URL\",\"value\":\"([A-Za-z]+://)([-\\\\w]+(?:\\\\.\\\\w[-\\\\w]*)+)(:\\\\d+)?(/[^.!,?;\\\"\\\\x27<>()\\\\[\\\\]{}\\\\s\\\\x7F-\\\\xFF]*(?:[.!,?]+[^.!,?;\\\"\\\\x27<>()\\\\[\\\\]{}\\\\s\\\\x7F-\\\\xFF]+)*)?\"}","{\"name\":\"Domain\",\"value\":\"(?:(https?):\\\\/\\\\/)?([-\\\\w.]+)\\\\.(com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+\"}","{\"name\":\"Windows file path\",\"value\":\"([A-Za-z]):\\\\\\\\((?:[A-Za-z\\\\d][A-Za-z\\\\d\\\\- \\\\x27_\\\\(\\\\)]{0,61}\\\\\\\\?)*[A-Za-z\\\\d][A-Za-z\\\\d\\\\- \\\\x27_\\\\(\\\\)]{0,61})(\\\\.[A-Za-z\\\\d]{1,6})?\"}","{\"name\":\"UNIX file path\",\"value\":\"(?:/[A-Za-z\\\\d.][A-Za-z\\\\d\\\\-.]{0,61})+\"}","{\"name\":\"MAC address\",\"value\":\"[A-Fa-f\\\\d]{2}(?:[:-][A-Fa-f\\\\d]{2}){5}\"}","{\"name\":\"Date (yyyy-mm-dd)\",\"value\":\"((?:19|20)\\\\d\\\\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])\"}","{\"name\":\"Date (dd/mm/yyyy)\",\"value\":\"(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]((?:19|20)\\\\d\\\\d)\"}","{\"name\":\"Date (mm/dd/yyyy)\",\"value\":\"(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)\\\\d\\\\d)\"}","{\"name\":\"Strings\",\"value\":\"[A-Za-z\\\\d/\\\\-:.,_$%\\\\x27\\\"()<>= !\\\\[\\\\]{}@]{4,}\"}"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REGEX_CASE_INSENSITIVE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REGEX_MULTILINE_MATCHING

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> OUTPUT_FORMAT

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Highlight matches","List matches","List capture groups","List matches with capture groups"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DISPLAY_TOTAL

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> CASE_SCOPE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["All","Word","Sentence","Paragraph"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SEARCH_TYPE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Regex","Extended (\\n, \\t, \\x...)","Simple string"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> FIND_REPLACE_GLOBAL

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> FIND_REPLACE_CASE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> FIND_REPLACE_MULTILINE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> SPLIT_DELIM

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ,
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DELIMITER_OPTIONS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Line feed","CRLF","Space","Comma","Semi-colon","Colon","Nothing (separate chars)"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DIFF_SAMPLE_DELIMITER

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • \n\n
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DIFF_BY

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Character","Word","Line","Sentence","CSS","JSON"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> OFF_CHK_SAMPLE_DELIMITER

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • \n\n
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_regex(input, args)

+ + +
+
+ + +
+

Regular expression operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_upper(input, args)

+ + +
+
+ + +
+

To Upper case operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_lower(input, args)

+ + +
+
+ + +
+

To Upper case operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_find_replace(input, args)

+ + +
+
+ + +
+

Find / Replace operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_split(input, args)

+ + +
+
+ + +
+

Split operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_diff(input, args)

+ + +
+
+ + +
+

Diff operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_offset_checker(input, args)

+ + +
+
+ + +
+

Offset checker operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +html + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_parse_escaped_string(input, args)

+ + +
+
+ + +
+

Parse escaped string operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _regex_highlight(input, regex, display_total)

+ + +
+
+ + +
+

Adds HTML highlights to matches within a string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
regex + + +RegExp + + + + +
display_total + + +boolean + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _regex_list(input, regex, display_total, matches, capture_groups)

+ + +
+
+ + +
+

Creates a string listing the matches within a string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
regex + + +RegExp + + + + +
display_total + + +boolean + + + + +
matches + + +boolean + + + + +

Display full match

capture_groups + + +boolean + + + + +

Display each of the capture groups separately

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Tidy.html b/docs/Tidy.html new file mode 100755 index 00000000..76cd4b86 --- /dev/null +++ b/docs/Tidy.html @@ -0,0 +1,2253 @@ + + + + + + + CyberChef Namespace: Tidy + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Tidy

+
+ +
+ +

+ Tidy +

+ + +
+ + +
+
+ + +

Tidy operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> REMOVE_SPACES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_CARIAGE_RETURNS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_LINE_FEEDS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_TABS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_FORM_FEEDS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • true
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> REMOVE_FULL_STOPS

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> APPLY_TO_EACH_LINE

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DROP_START

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> DROP_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 5
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> TAKE_START

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> TAKE_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 5
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PAD_POSITION

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["Start","End"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PAD_LENGTH

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • 5
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> PAD_CHAR

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_remove_whitespace(input, args)

+ + +
+
+ + +
+

Remove whitespace operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_remove_nulls(input, args)

+ + +
+
+ + +
+

Remove null bytes operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_drop_bytes(input, args)

+ + +
+
+ + +
+

Drop bytes operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_take_bytes(input, args)

+ + +
+
+ + +
+

Take bytes operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +byte_array + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_pad(input, args)

+ + +
+
+ + +
+

Pad lines operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/URL_.html b/docs/URL_.html new file mode 100755 index 00000000..ab1d6f12 --- /dev/null +++ b/docs/URL_.html @@ -0,0 +1,1119 @@ + + + + + + + CyberChef Namespace: URL_ + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: URL_

+
+ +
+ +

+ URL_ +

+ + +
+ + +
+
+ + +

URL operations.
Namespace is appended with an underscore to prevent overwriting the global URL object.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> ENCODE_ALL

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_to(input, args)

+ + +
+
+ + +
+

URL Encode operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_from(input, args)

+ + +
+
+ + +
+

URL Decode operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> run_parse(input, args)

+ + +
+
+ + +
+

Parse URI operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<private, static> _encode_all_chars(str)

+ + +
+
+ + +
+

URL encodes additional special characters beyond the standard set.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/UUID.html b/docs/UUID.html new file mode 100755 index 00000000..8e65d294 --- /dev/null +++ b/docs/UUID.html @@ -0,0 +1,527 @@ + + + + + + + CyberChef Namespace: UUID + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: UUID

+
+ +
+ +

+ UUID +

+ + +
+ + +
+
+ + +

UUID operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

<static> run_generate_v4(input, args)

+ + +
+
+ + +
+

Generate UUID operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Unicode.html b/docs/Unicode.html new file mode 100755 index 00000000..6f61dfc9 --- /dev/null +++ b/docs/Unicode.html @@ -0,0 +1,674 @@ + + + + + + + CyberChef Namespace: Unicode + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Unicode

+
+ +
+ +

+ Unicode +

+ + +
+ + +
+
+ + +

Unicode operations.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<static, constant> PREFIXES

+ + +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Default Value:
+
+
    +
  • ["\\u","%u","U+"]
  • +
+
+ + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<private, static, constant> _prefix_to_regex

+ + +
+
+ +
+

Lookup table to add prefixes to unicode delimiters so that they can be used in a regex.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> run_unescape(input, args)

+ + +
+
+ + +
+

Unescape Unicode Characters operation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
input + + +string + + + + +
args + + +Array.<Object> + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Utils.html b/docs/Utils.html new file mode 100755 index 00000000..760fe17c --- /dev/null +++ b/docs/Utils.html @@ -0,0 +1,6701 @@ + + + + + + + CyberChef Namespace: Utils + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespace: Utils

+
+ +
+ +

+ Utils +

+ + +
+ + +
+
+ + +

Utility functions for use in operations, the core framework and the stage.

+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<private, static, constant> UNIC_WIN1251_MAP

+ + +
+
+ +
+

Mapping of Unicode code points to Windows-1251

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<private, static, constant> WIN1251_UNIC_MAP

+ + +
+
+ +
+

Mapping of Windows-1251 code points to Unicode

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> char_rep

+ + +
+
+ +
+

A mapping of names of delimiter characters to their symbols.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> regex_rep

+ + +
+
+ +
+

A mapping of names of delimiter characters to regular expressions which can select them.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<static, constant> format

+ + +
+
+ +
+

A mapping of string formats to their classes in the CryptoJS library.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

<static> chr(o)

+ + +
+
+ + +
+

Translates an ordinal into a character.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
o + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +char + + + +
+
+ + + + + +
Example
+ +
// returns 'a'
+Utils.chr(97);
+ + + +
+ + + +
+
+

<static> ord(c)

+ + +
+
+ + +
+

Translates a character into an ordinal.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
c + + +char + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +number + + + +
+
+ + + + + +
Example
+ +
// returns 97
+Utils.ord('a');
+ + + +
+ + + +
+
+

<static> pad_left(str, max [, chr])

+ + +
+
+ + +
+

Adds leading zeros to strings

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
str + + +string + + + + + + + + + + + + +

String to add leading characters to.

max + + +number + + + + + + + + + + + + +

Maximum width of the string.

chr + + +char + + + + + + + <optional>
+ + + + + +
+ + '0' + +

The character to pad with.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "0a"
+Utils.pad_left("a", 2);
+
+// returns "000a"
+Utils.pad_left("a", 4);
+
+// returns "xxxa"
+Utils.pad_left("a", 4, "x");
+
+// returns "bcabchello"
+Utils.pad_left("hello", 10, "abc");
+ + + +
+ + + +
+
+

<static> pad_right(str, max [, chr])

+ + +
+
+ + +
+

Adds trailing spaces to strings.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
str + + +string + + + + + + + + + + + + +

String to add trailing characters to.

max + + +number + + + + + + + + + + + + +

Maximum width of the string.

chr + + +char + + + + + + + <optional>
+ + + + + +
+ + '0' + +

The character to pad with.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "a   "
+Utils.pad_right("a", 4);
+
+// returns "axxx"
+Utils.pad_right("a", 4, "x");
+ + + +
+ + + +
+
+

<static> pad_left()

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

<static> truncate(str, max [, suffix])

+ + +
+
+ + +
+

Truncates a long string to max length and adds suffix.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
str + + +string + + + + + + + + + + + + +

String to truncate

max + + +number + + + + + + + + + + + + +

Maximum length of the final string

suffix + + +string + + + + + + + <optional>
+ + + + + +
+ + '...' + +

The string to add to the end of the final string

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "A long..."
+Utils.truncate("A long string", 9);
+
+// returns "A long s-"
+Utils.truncate("A long string", 9, "-");
+ + + +
+ + + +
+
+

<static> hex(c [, length])

+ + +
+
+ + +
+

Converts a character or number to its hex representation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
c + + +char +| + +number + + + + + + + + + + + + +
length + + +number + + + + + + + <optional>
+ + + + + +
+ + 2 + +

The width of the resulting hex number.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "6e"
+Utils.hex("n");
+
+// returns "6e"
+Utils.hex(110);
+ + + +
+ + + +
+
+

<static> bin(c [, length])

+ + +
+
+ + +
+

Converts a character or number to its binary representation.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
c + + +char +| + +number + + + + + + + + + + + + +
length + + +number + + + + + + + <optional>
+ + + + + +
+ + 8 + +

The width of the resulting binary number.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "01101110"
+Utils.bin("n");
+
+// returns "01101110"
+Utils.bin(110);
+ + + +
+ + + +
+
+

<static> printable(str [, preserve_ws])

+ + +
+
+ + +
+

Returns a string with all non-printable chars as dots, optionally preserving whitespace.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
str + + +string + + + + + + + + + + + + +

The input string to display.

preserve_ws + + +boolean + + + + + + + <optional>
+ + + + + +
+ + false + +

Whether or not to print whitespace.

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
+ + + +
+
+

<static> parse_escaped_chars(str)

+ + +
+
+ + +
+

Parse a string entered by a user and replace escaped chars with the bytes they represent.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "\x00"
+Utils.parse_escaped_chars("\\x00");
+
+// returns "\n"
+Utils.parse_escaped_chars("\\n");
+ + + +
+ + + +
+
+

<static> expand_alph_range(alph_str)

+ + +
+
+ + +
+

Expand an alphabet range string into a list of the characters in that range.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
alph_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<char> + + + +
+
+ + + + + +
Example
+ +
// returns ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
+Utils.expand_alph_range("0-9");
+
+// returns ["a", "b", "c", "d", "0", "1", "2", "3", "+", "/"]
+Utils.expand_alph_range("a-d0-3+/");
+
+// returns ["a", "b", "c", "d", "0", "-", "3"]
+Utils.expand_alph_range("a-d0\\-3")
+ + + +
+ + + +
+
+

<static> hex_to_byte_array(hex_str)

+ + +
+
+ + +
+

Translates a hex string into an array of bytes.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
hex_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
Example
+ +
// returns [0xfe, 0x09, 0xa7]
+Utils.hex_to_byte_array("fe09a7");
+ + + +
+ + + +
+
+

<static> byte_array_to_hex(byte_array)

+ + +
+
+ + +
+

Translates an array of bytes to a hex string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
byte_array + + +byte_array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "fe09a7"
+Utils.byte_array_to_hex([0xfe, 0x09, 0xa7]);
+ + + +
+ + + +
+
+

<static> str_to_byte_array(str)

+ + +
+
+ + +
+

Converts a string to a byte array.
Treats the string as UTF-8 if any values are over 255.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
Example
+ +
// returns [72,101,108,108,111]
+Utils.str_to_byte_array("Hello");
+
+// returns [228,189,160,229,165,189]
+Utils.str_to_byte_array("你好");
+ + + +
+ + + +
+
+

<static> str_to_utf8_byte_array(str)

+ + +
+
+ + +
+

Converts a string to a UTF-8 byte array.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
Example
+ +
// returns [72,101,108,108,111]
+Utils.str_to_utf8_byte_array("Hello");
+
+// returns [228,189,160,229,165,189]
+Utils.str_to_utf8_byte_array("你好");
+ + + +
+ + + +
+
+

<static> str_to_charcode(str)

+ + +
+
+ + +
+

Converts a string to a charcode array

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
Example
+ +
// returns [72,101,108,108,111]
+Utils.str_to_charcode("Hello");
+
+// returns [20320,22909]
+Utils.str_to_charcode("你好");
+ + + +
+ + + +
+
+

<static> byte_array_to_utf8(byte_array)

+ + +
+
+ + +
+

Attempts to convert a byte array to a UTF-8 string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
byte_array + + +byte_array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "Hello"
+Utils.byte_array_to_utf8([72,101,108,108,111]);
+
+// returns "你好"
+Utils.byte_array_to_utf8([228,189,160,229,165,189]);
+ + + +
+ + + +
+
+

<static> byte_array_to_chars(byte_array)

+ + +
+
+ + +
+

Converts a charcode array to a string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
byte_array + + +byte_array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "Hello"
+Utils.byte_array_to_chars([72,101,108,108,111]);
+
+// returns "你好"
+Utils.byte_array_to_chars([20320,22909]);
+ + + +
+ + + +
+
+

<static> word_array_to_byte_array(word_array)

+ + +
+
+ + +
+

Converts a CryptoJS.lib.WordArray to a byte_array.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
word_array + + +CryptoJS.lib.WordArray + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
Example
+ +
// returns [84, 101, 115, 116]
+Utils.word_array_to_byte_array(CryptoJS.enc.Hex.parse("54657374"));
+ + + +
+ + + +
+
+

<static> unicode_to_win1251(unic_str)

+ + +
+
+ + +
+

Converts a Unicode string to Windows-1251 encoding

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
unic_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

String encoded in Windows-1251

+
+ + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "îáíîâëåííàÿ òåõíè÷êà ïî Áîèíãó. îðèãèíàë ó ìåíÿ. çàáåðåòå êîãäà áóäåòå â ÊÈ"
+Utils.unicode_to_win1251("обновленная техничка по Боингу. оригинал у меня. заберете когда будете в КИ");
+ + + +
+ + + +
+
+

<static> win1251_to_unicode(win1251_str)

+ + +
+
+ + +
+

Converts a Windows-1251 string to Unicode encoding

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
win1251_str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

String encoded in Unicode

+
+ + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "обновленная техничка по Боингу. оригинал у меня. заберете когда будете в КИ"
+Utils.unicode_to_win1251("îáíîâëåííàÿ òåõíè÷êà ïî Áîèíãó. îðèãèíàë ó ìåíÿ. çàáåðåòå êîãäà áóäåòå â ÊÈ");
+ + + +
+ + + +
+
+

<static> to_base64(data [, alphabet])

+ + +
+
+ + +
+

Base64's the input byte array using the given alphabet, returning a string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
data + + +byte_array +| + +string + + + + + + + + + + +
alphabet + + +string + + + + + + + <optional>
+ + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "SGVsbG8="
+Utils.to_base64([72, 101, 108, 108, 111]);
+
+// returns "SGVsbG8="
+Utils.to_base64("Hello");
+ + + +
+ + + +
+
+

<static> from_base64(data [, alphabet] [, return_type] [, remove_non_alph_chars])

+ + +
+
+ + +
+

UnBase64's the input string using the given alphabet, returning a byte array.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
data + + +byte_array + + + + + + + + + + + + +
alphabet + + +string + + + + + + + <optional>
+ + + + + +
+ +
return_type + + +string + + + + + + + <optional>
+ + + + + +
+ + "string" + +

Either "string" or "byte_array"

remove_non_alph_chars + + +boolean + + + + + + + <optional>
+ + + + + +
+ + true + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
Example
+ +
// returns "Hello"
+Utils.from_base64("SGVsbG8=");
+
+// returns [72, 101, 108, 108, 111]
+Utils.from_base64("SGVsbG8=", null, "byte_array");
+ + + +
+ + + +
+
+

<static> to_hex(data [, delim] [, padding])

+ + +
+
+ + +
+

Convert a byte array into a hex string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
data + + +byte_array + + + + + + + + + + + + +
delim + + +string + + + + + + + <optional>
+ + + + + +
+ + " " + +
padding + + +number + + + + + + + <optional>
+ + + + + +
+ + 2 + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "0a 14 1e"
+Utils.to_hex([10,20,30]);
+
+// returns "0a:14:1e"
+Utils.to_hex([10,20,30], ":");
+ + + +
+ + + +
+
+

<static> to_hex_fast(data)

+ + +
+
+ + +
+

Convert a byte array into a hex string as efficiently as possible with no options.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +byte_array + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "0a141e"
+Utils.to_hex([10,20,30]);
+ + + +
+ + + +
+
+

<static> from_hex(data [, delim] [, byte_len])

+ + +
+
+ + +
+

Convert a hex string into a byte array.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDefaultDescription
data + + +string + + + + + + + + + + + + +
delim + + +string + + + + + + + <optional>
+ + + + + +
+ +
byte_len + + +number + + + + + + + <optional>
+ + + + + +
+ + 2 + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +byte_array + + + +
+
+ + + + + +
Example
+ +
// returns [10,20,30]
+Utils.from_hex("0a 14 1e");
+
+// returns [10,20,30]
+Utils.from_hex("0a:14:1e", "Colon");
+ + + +
+ + + +
+
+

<static> parse_csv(data)

+ + +
+
+ + +
+

Parses CSV data and returns it as a two dimensional array or strings.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Array.<Array.<string>> + + + +
+
+ + + + + +
Example
+ +
// returns [["head1", "head2"], ["data1", "data2"]]
+Utils.parse_csv("head1,head2\ndata1,data2");
+ + + +
+ + + +
+
+

<static> strip_html_tags(html_str, remove_script_and_style)

+ + +
+
+ + +
+

Removes all HTML (or XML) tags from the input string.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
html_str + + +string + + + + +
remove_script_and_style + + +boolean + + + + +

Flag to specify whether to remove entire script or style blocks

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "Test"
+Utils.strip_html_tags("<div>Test</div>");
+ + + +
+ + + +
+
+

<static> escape_html(str)

+ + +
+
+ + +
+

Escapes HTML tags in a string to stop them being rendered

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
str + + +string + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

string

+
+ + + + + + + +
Example
+ +
// return "A &lt;script> tag"
+Utils.escape_html("A <script> tag");
+ + + +
+ + + +
+
+

<static> fuzzy_time(ms)

+ + +
+
+ + +
+

Expresses a number of milliseconds in a human readable format.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RangeSample Output
0 to 45 secondsa few seconds ago
45 to 90 secondsa minute ago
90 seconds to 45 minutes2 minutes ago ... 45 minutes ago
45 to 90 minutesan hour ago
90 minutes to 22 hours2 hours ago ... 22 hours ago
22 to 36 hoursa day ago
36 hours to 25 days2 days ago ... 25 days ago
25 to 45 daysa month ago
45 to 345 days2 months ago ... 11 months ago
345 to 545 days (1.5 years)a year ago
546 days+2 years ago ... 20 years ago
+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ms + + +number + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + + +
+
+ + + + + +
Example
+ +
// returns "3 minutes"
+Utils.fuzzy_time(152435);
+
+// returns "5 days"
+Utils.fuzzy_time(456851321);
+ + + +
+ + + +
+
+

<static> extend(a, b)

+ + +
+
+ + +
+

Adds the properties of one Object to another.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
a + + +Object + + + + +
b + + +Object + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Object + + + +
+
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/WindowWaiter.html b/docs/WindowWaiter.html new file mode 100755 index 00000000..7b60d564 --- /dev/null +++ b/docs/WindowWaiter.html @@ -0,0 +1,692 @@ + + + + + + + CyberChef Class: WindowWaiter + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Class: WindowWaiter

+
+ +
+ +

+ WindowWaiter +

+ + +
+ + +
+
+ + +
+
+

new WindowWaiter(app)

+ + +
+
+ + +
+

Waiter to handle events related to the window object.

+
+ + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
app + + +HTMLApp + + + + +

The main view object for CyberChef.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + +

Methods

+ +
+ +
+
+

window_resize()

+ + +
+
+ + +
+

Handler for window resize events.
Resets the layout of CyberChef's panes after 200ms (so that continuous resizing doesn't cause
continuous resetting).

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

window_blur()

+ + +
+
+ + +
+

Handler for window blur events.
Saves the current time so that we can calculate how long the window was unfocussed for when
focus is returned.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

window_focus()

+ + +
+
+ + +
+

Handler for window focus events.

+

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.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/classes.list.html b/docs/classes.list.html new file mode 100755 index 00000000..c169ae7c --- /dev/null +++ b/docs/classes.list.html @@ -0,0 +1,925 @@ + + + + + + + CyberChef Classes + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Classes

+
+ +
+ +

+ +

+ + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
Chef
+
+ +
Dish
+
+ +
Ingredient
+
+ +
Operation
+
+ +
Recipe
+
+ +
ControlsWaiter
+
+ +
HTMLApp
+
+ +
HTMLCategory
+
+ +
HTMLIngredient
+
+ +
HTMLOperation
+
+ +
HighlighterWaiter
+
+ +
InputWaiter
+
+ +
Manager
+
+ +
OperationsWaiter
+
+ +
OptionsWaiter
+
+ +
OutputWaiter
+
+ +
RecipeWaiter
+
+ +
SeasonalWaiter
+
+ +
WindowWaiter
+
+
+ + + + + +

Namespaces

+ +
+
FlowControl
+
+ +
Utils
+
+ +
Base
+
+ +
Base64
+
+ +
BitwiseOp
+
+ +
ByteRepr
+
+ +
CharEnc
+
+ +
Checksum
+
+ +
Cipher
+
+ +
Code
+
+ +
Compress
+
+ +
Convert
+
+ +
DateTime
+
+ +
Endian
+
+ +
Entropy
+
+ +
Extract
+
+ +
FileType
+
+ +
HTML
+
+ +
HTTP
+
+ +
Hash
+
+ +
Hexdump
+
+ +
IP
+
+ +
JS
+
+ +
MAC
+
+ +
Numberwang
+
+ +
OS
+
+ +
PublicKey
+
+ +
Punycode
+
+ +
QuotedPrintable
+
+ +
Rotate
+
+ +
SeqUtils
+
+ +
StrUtils
+
+ +
Tidy
+
+ +
URL_
+
+ +
UUID
+
+ +
Unicode
+
+
+ + + + + + + + + +

Events

+ +
+ +
+
+

appstart

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

operationadd

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

operationremove

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

oplistcreate

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

statechange

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ +
+ +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/config_Categories.js.html b/docs/config_Categories.js.html new file mode 100755 index 00000000..5e152a72 --- /dev/null +++ b/docs/config_Categories.js.html @@ -0,0 +1,497 @@ + + + + + + + CyberChef Source: config/Categories.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: config/Categories.js

+ +
+
+
/**
+ * 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[]}
+ */
+var Categories = [
+    {
+        name: "Favourites",
+        ops: []
+    },
+    {
+        name: "Data format",
+        ops: [
+            "To Hexdump",
+            "From Hexdump",
+            "To Hex",
+            "From Hex",
+            "To Charcode",
+            "From Charcode",
+            "To Decimal",
+            "From Decimal",
+            "To Binary",
+            "From Binary",
+            "To Base64",
+            "From Base64",
+            "Show Base64 offsets",
+            "To Base32",
+            "From Base32",
+            "To Base",
+            "From Base",
+            "To HTML Entity",
+            "From HTML Entity",
+            "URL Encode",
+            "URL Decode",
+            "Unescape Unicode Characters",
+            "To Quoted Printable",
+            "From Quoted Printable",
+            "To Punycode",
+            "From Punycode",
+            "To Hex Content",
+            "From Hex Content",
+            "PEM to Hex",
+            "Hex to PEM",
+            "Parse ASN.1 hex string",
+            "Change IP format",
+            "Text encoding",
+            "Swap endianness",
+        ]
+    },
+    {
+        name: "Encryption / Encoding",
+        ops: [
+            "AES Encrypt",
+            "AES Decrypt",
+            "Blowfish Encrypt",
+            "Blowfish Decrypt",
+            "DES Encrypt",
+            "DES Decrypt",
+            "Triple DES Encrypt",
+            "Triple DES Decrypt",
+            "Rabbit Encrypt",
+            "Rabbit Decrypt",
+            "RC4",
+            "RC4 Drop",
+            "ROT13",
+            "XOR",
+            "XOR Brute Force",
+            "Derive PBKDF2 key",
+            "Derive EVP key",
+        ]
+    },
+    {
+        name: "Public Key",
+        ops: [
+            "Parse X.509 certificate",
+            "Parse ASN.1 hex string",
+            "PEM to Hex",
+            "Hex to PEM",
+            "Hex to Object Identifier",
+            "Object Identifier to Hex",
+        ]
+    },
+    {
+        name: "Logical operations",
+        ops: [
+            "XOR",
+            "XOR Brute Force",
+            "OR",
+            "NOT",
+            "AND",
+            "ADD",
+            "SUB",
+            "Rotate left",
+            "Rotate right",
+            "ROT13",
+        ]
+    },
+    {
+        name: "Networking",
+        ops: [
+            "Strip HTTP headers",
+            "Parse User Agent",
+            "Parse IP range",
+            "Parse IPv6 address",
+            "Parse URI",
+            "URL Encode",
+            "URL Decode",
+            "Format MAC addresses",
+            "Change IP format",
+            "Group IP addresses",
+        ]
+    },
+    {
+        name: "Language",
+        ops: [
+            "Text encoding",
+            "Unescape Unicode Characters",
+        ]
+    },
+    {
+        name: "Utils",
+        ops: [
+            "Diff",
+            "Remove whitespace",
+            "Remove null bytes",
+            "To Upper case",
+            "To Lower case",
+            "Add line numbers",
+            "Remove line numbers",
+            "Reverse",
+            "Sort",
+            "Unique",
+            "Split",
+            "Count occurrences",
+            "Expand alphabet range",
+            "Parse escaped string",
+            "Drop bytes",
+            "Take bytes",
+            "Pad lines",
+            "Find / Replace",
+            "Regular expression",
+            "Offset checker",
+            "Convert distance",
+            "Convert area",
+            "Convert mass",
+            "Convert speed",
+            "Convert data units",
+            "Parse UNIX file permissions",
+            "Swap endianness",
+            "Parse colour code",
+        ]
+    },
+    {
+        name: "Date / Time",
+        ops: [
+            "Parse DateTime",
+            "Translate DateTime Format",
+            "From UNIX Timestamp",
+            "To UNIX Timestamp",
+            "Extract dates",
+        ]
+    },
+    {
+        name: "Extractors",
+        ops: [
+            "Strings",
+            "Extract IP addresses",
+            "Extract email addresses",
+            "Extract MAC addresses",
+            "Extract URLs",
+            "Extract domains",
+            "Extract file paths",
+            "Extract dates",
+            "Regular expression",
+        ]
+    },
+    {
+        name: "Compression",
+        ops: [
+            "Raw Deflate",
+            "Raw Inflate",
+            "Zlib Deflate",
+            "Zlib Inflate",
+            "Gzip",
+            "Gunzip",
+            "Zip",
+            "Unzip",
+            "Bzip2 Decompress",
+        ]
+    },
+    {
+        name: "Hashing",
+        ops: [
+            "Analyse hash",
+            "Generate all hashes",
+            "MD5",
+            "SHA1",
+            "SHA224",
+            "SHA256",
+            "SHA384",
+            "SHA512",
+            "SHA3",
+            "RIPEMD-160",
+            "HMAC",
+            "Fletcher-16 Checksum",
+            "Adler-32 Checksum",
+            "CRC-32 Checksum",
+            "TCP/IP Checksum",
+        ]
+    },
+    {
+        name: "Code tidy",
+        ops: [
+            "Syntax highlighter",
+            "Generic Code Beautify",
+            "JavaScript Parser",
+            "JavaScript Beautify",
+            "JavaScript Minify",
+            "JSON Beautify",
+            "JSON Minify",
+            "XML Beautify",
+            "XML Minify",
+            "SQL Beautify",
+            "SQL Minify",
+            "CSS Beautify",
+            "CSS Minify",
+            "Strip HTML tags",
+            "Diff",
+        ]
+    },
+    {
+        name: "Other",
+        ops: [
+            "Entropy",
+            "Frequency distribution",
+            "Detect File Type",
+            "Scan for Embedded Files",
+            "Generate UUID",
+            "Numberwang",
+        ]
+    },
+    {
+        name: "Flow control",
+        ops: [
+            "Fork",
+            "Merge",
+            "Jump",
+            "Conditional Jump",
+            "Return",
+        ]
+    },
+];
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/config/OperationConfig.js b/docs/config_OperationConfig.js.html similarity index 79% rename from src/js/config/OperationConfig.js rename to docs/config_OperationConfig.js.html index f011a0b2..b989e879 100755 --- a/src/js/config/OperationConfig.js +++ b/docs/config_OperationConfig.js.html @@ -1,4 +1,98 @@ -/* + + + + + + + CyberChef Source: config/OperationConfig.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: config/OperationConfig.js

+ +
+
+
/*
  * Tell JSHint to ignore "'Object' is not defined" errors in this file, as it references every
  * single operation object by definition.
  */
@@ -43,11 +137,11 @@
  * @license Apache-2.0
  *
  * @constant
- * @type {Object.}
+ * @type {Object.<string, OpConf>}
  */
 var OperationConfig = {
     "Fork": {
-        description: "Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.

For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.", + description: "Split the input data up based on the specified delimiter and run all subsequent operations on each branch separately.<br><br>For example, to decode multiple Base64 strings, enter them all on separate lines then add the 'Fork' and 'From Base64' operations to the recipe. Each string will be decoded separately.", run: FlowControl.run_fork, input_type: "string", output_type: "string", @@ -125,7 +219,7 @@ var OperationConfig = { args: [] }, "From Base64": { - description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

This operation decodes data from an ASCII Base64 string back into its raw format.

e.g. aGVsbG8= becomes hello", + description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation decodes data from an ASCII Base64 string back into its raw format.<br><br>e.g. <code>aGVsbG8=</code> becomes <code>hello</code>", run: Base64.run_from, highlight: Base64.highlight_from, highlight_reverse: Base64.highlight_to, @@ -138,14 +232,14 @@ var OperationConfig = { value: Base64.ALPHABET_OPTIONS }, { - name: "Remove non‑alphabet chars", + name: "Remove non&#8209;alphabet chars", type: "boolean", value: Base64.REMOVE_NON_ALPH_CHARS } ] }, "To Base64": { - description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.

This operation encodes data in an ASCII Base64 string.

e.g. hello becomes aGVsbG8=", + description: "Base64 is a notation for encoding arbitrary byte data using a restricted set of symbols that can be conveniently used by humans and processed by computers.<br><br>This operation encodes data in an ASCII Base64 string.<br><br>e.g. <code>hello</code> becomes <code>aGVsbG8=</code>", run: Base64.run_to, highlight: Base64.highlight_to, highlight_reverse: Base64.highlight_from, @@ -171,7 +265,7 @@ var OperationConfig = { value: Base64.BASE32_ALPHABET }, { - name: "Remove non‑alphabet chars", + name: "Remove non&#8209;alphabet chars", type: "boolean", value: Base64.REMOVE_NON_ALPH_CHARS } @@ -191,7 +285,7 @@ var OperationConfig = { ] }, "Show Base64 offsets": { - description: "When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.

This operation shows all possible offsets for a given string so that each possible encoding can be considered.", + description: "When a string is within a block of data and the whole block is Base64'd, the string itself could be represented in Base64 in three distinct ways depending on its offset within the block.<br><br>This operation shows all possible offsets for a given string so that each possible encoding can be considered.", run: Base64.run_offsets, input_type: "byte_array", output_type: "html", @@ -209,7 +303,7 @@ var OperationConfig = { ] }, "XOR": { - description: "XOR the input with the given key.
e.g. fe023da5

Options
Null preserving: If the current byte is 0x00 or the same as the key, skip it.

Differential: Set the key to the value of the previously decoded byte.", + description: "XOR the input with the given key.<br>e.g. <code>fe023da5</code><br><br><strong>Options</strong><br><u>Null preserving:</u> If the current byte is 0x00 or the same as the key, skip it.<br><br><u>Differential:</u> Set the key to the value of the previously decoded byte.", run: BitwiseOp.run_xor, highlight: true, highlight_reverse: true, @@ -235,7 +329,7 @@ var OperationConfig = { ] }, "XOR Brute Force": { - description: "Enumerate all possible XOR solutions. Current maximum key length is 2 due to browser performance.

Optionally enter a regex string that you expect to find in the plaintext to filter results (crib).", + description: "Enumerate all possible XOR solutions. Current maximum key length is 2 due to browser performance.<br><br>Optionally enter a regex string that you expect to find in the plaintext to filter results (crib).", run: BitwiseOp.run_xor_brute, input_type: "byte_array", output_type: "string", @@ -292,7 +386,7 @@ var OperationConfig = { args: [] }, "AND": { - description: "AND the input with the given key.
e.g. fe023da5", + description: "AND the input with the given key.<br>e.g. <code>fe023da5</code>", run: BitwiseOp.run_and, highlight: true, highlight_reverse: true, @@ -308,7 +402,7 @@ var OperationConfig = { ] }, "OR": { - description: "OR the input with the given key.
e.g. fe023da5", + description: "OR the input with the given key.<br>e.g. <code>fe023da5</code>", run: BitwiseOp.run_or, highlight: true, highlight_reverse: true, @@ -324,7 +418,7 @@ var OperationConfig = { ] }, "ADD": { - description: "ADD the input with the given key (e.g. fe023da5), MOD 255", + description: "ADD the input with the given key (e.g. <code>fe023da5</code>), MOD 255", run: BitwiseOp.run_add, highlight: true, highlight_reverse: true, @@ -340,7 +434,7 @@ var OperationConfig = { ] }, "SUB": { - description: "SUB the input with the given key (e.g. fe023da5), MOD 255", + description: "SUB the input with the given key (e.g. <code>fe023da5</code>), MOD 255", run: BitwiseOp.run_sub, highlight: true, highlight_reverse: true, @@ -356,7 +450,7 @@ var OperationConfig = { ] }, "From Hex": { - description: "Converts a hexadecimal byte string back into a its raw value.

e.g. ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a becomes the UTF-8 encoded string Γειά σου", + description: "Converts a hexadecimal byte string back into a its raw value.<br><br>e.g. <code>ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a</code> becomes the UTF-8 encoded string <code>Γειά σου</code>", run: ByteRepr.run_from_hex, highlight: ByteRepr.highlight_from, highlight_reverse: ByteRepr.highlight_to, @@ -371,7 +465,7 @@ var OperationConfig = { ] }, "To Hex": { - description: "Converts the input string to hexadecimal bytes separated by the specified delimiter.

e.g. The UTF-8 encoded string Γειά σου becomes ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a", + description: "Converts the input string to hexadecimal bytes separated by the specified delimiter.<br><br>e.g. The UTF-8 encoded string <code>Γειά σου</code> becomes <code>ce 93 ce b5 ce b9 ce ac 20 cf 83 ce bf cf 85 0a</code>", run: ByteRepr.run_to_hex, highlight: ByteRepr.highlight_to, highlight_reverse: ByteRepr.highlight_from, @@ -386,7 +480,7 @@ var OperationConfig = { ] }, "From Charcode": { - description: "Converts unicode character codes back into text.

e.g. 0393 03b5 03b9 03ac 20 03c3 03bf 03c5 becomes Γειά σου", + description: "Converts unicode character codes back into text.<br><br>e.g. <code>0393 03b5 03b9 03ac 20 03c3 03bf 03c5</code> becomes <code>Γειά σου</code>", run: ByteRepr.run_from_charcode, highlight: ByteRepr.highlight_from, highlight_reverse: ByteRepr.highlight_to, @@ -406,7 +500,7 @@ var OperationConfig = { ] }, "To Charcode": { - description: "Converts text to its unicode character code equivalent.

e.g. Γειά σου becomes 0393 03b5 03b9 03ac 20 03c3 03bf 03c5", + description: "Converts text to its unicode character code equivalent.<br><br>e.g. <code>Γειά σου</code> becomes <code>0393 03b5 03b9 03ac 20 03c3 03bf 03c5</code>", run: ByteRepr.run_to_charcode, highlight: ByteRepr.highlight_to, highlight_reverse: ByteRepr.highlight_from, @@ -426,7 +520,7 @@ var OperationConfig = { ] }, "From Binary": { - description: "Converts a binary string back into its raw form.

e.g. 01001000 01101001 becomes Hi", + description: "Converts a binary string back into its raw form.<br><br>e.g. <code>01001000 01101001</code> becomes <code>Hi</code>", run: ByteRepr.run_from_binary, highlight: ByteRepr.highlight_from_binary, highlight_reverse: ByteRepr.highlight_to_binary, @@ -441,7 +535,7 @@ var OperationConfig = { ] }, "To Binary": { - description: "Displays the input data as a binary string.

e.g. Hi becomes 01001000 01101001", + description: "Displays the input data as a binary string.<br><br>e.g. <code>Hi</code> becomes <code>01001000 01101001</code>", run: ByteRepr.run_to_binary, highlight: ByteRepr.highlight_to_binary, highlight_reverse: ByteRepr.highlight_from_binary, @@ -456,7 +550,7 @@ var OperationConfig = { ] }, "From Decimal": { - description: "Converts the data from an ordinal integer array back into its raw form.

e.g. 72 101 108 108 111 becomes Hello", + description: "Converts the data from an ordinal integer array back into its raw form.<br><br>e.g. <code>72 101 108 108 111</code> becomes <code>Hello</code>", run: ByteRepr.run_from_decimal, input_type: "string", output_type: "byte_array", @@ -469,7 +563,7 @@ var OperationConfig = { ] }, "To Decimal": { - description: "Converts the input data to an ordinal integer array.

e.g. Hello becomes 72 101 108 108 111", + description: "Converts the input data to an ordinal integer array.<br><br>e.g. <code>Hello</code> becomes <code>72 101 108 108 111</code>", run: ByteRepr.run_to_decimal, input_type: "byte_array", output_type: "string", @@ -542,14 +636,14 @@ var OperationConfig = { ] }, "From HTML Entity": { - description: "Converts HTML entities back to characters

e.g. &amp; becomes &", // tags required to stop the browser just printing & + description: "Converts HTML entities back to characters<br><br>e.g. <code>&amp;<span>amp;</span></code> becomes <code>&amp;</code>", // <span> tags required to stop the browser just printing & run: HTML.run_from_entity, input_type: "string", output_type: "string", args: [] }, "To HTML Entity": { - description: "Converts characters to HTML entities

e.g. & becomes &amp;", // tags required to stop the browser just printing & + description: "Converts characters to HTML entities<br><br>e.g. <code>&amp;</code> becomes <code>&amp;<span>amp;</span></code>", // <span> tags required to stop the browser just printing & run: HTML.run_to_entity, input_type: "string", output_type: "string", @@ -585,14 +679,14 @@ var OperationConfig = { ] }, "URL Decode": { - description: "Converts URI/URL percent-encoded characters back to their raw values.

e.g. %3d becomes =", + description: "Converts URI/URL percent-encoded characters back to their raw values.<br><br>e.g. <code>%3d</code> becomes <code>=</code>", run: URL_.run_from, input_type: "string", output_type: "string", args: [] }, "URL Encode": { - description: "Encodes problematic characters into percent-encoding, a format supported by URIs/URLs.

e.g. = becomes %3d", + description: "Encodes problematic characters into percent-encoding, a format supported by URIs/URLs.<br><br>e.g. <code>=</code> becomes <code>%3d</code>", run: URL_.run_to, input_type: "string", output_type: "string", @@ -612,7 +706,7 @@ var OperationConfig = { args: [] }, "Unescape Unicode Characters": { - description: "Converts unicode-escaped character notation back into raw characters.

Supports the prefixes:
  • \\u
  • %u
  • U+
e.g. \\u03c3\\u03bf\\u03c5 becomes σου", + description: "Converts unicode-escaped character notation back into raw characters.<br><br>Supports the prefixes:<ul><li><code>\\u</code></li><li><code>%u</code></li><li><code>U+</code></li></ul>e.g. <code>\\u03c3\\u03bf\\u03c5</code> becomes <code>σου</code>", run: Unicode.run_unescape, input_type: "string", output_type: "string", @@ -632,14 +726,14 @@ var OperationConfig = { args: [] }, "To Quoted Printable": { - description: "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.

QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length.", + description: "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.<br><br>QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length.", run: QuotedPrintable.run_to, input_type: "byte_array", output_type: "string", args: [] }, "From Punycode": { - description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

e.g. mnchen-3ya decodes to münchen", + description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.<br><br>e.g. <code>mnchen-3ya</code> decodes to <code>münchen</code>", run: Punycode.run_to_unicode, input_type: "string", output_type: "string", @@ -652,7 +746,7 @@ var OperationConfig = { ] }, "To Punycode": { - description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.

e.g. münchen encodes to mnchen-3ya", + description: "Punycode is a way to represent Unicode with the limited character subset of ASCII supported by the Domain Name System.<br><br>e.g. <code>münchen</code> encodes to <code>mnchen-3ya</code>", run: Punycode.run_to_ascii, input_type: "string", output_type: "string", @@ -665,14 +759,14 @@ var OperationConfig = { ] }, "From Hex Content": { - description: "Translates hexadecimal bytes in text back to raw bytes.

e.g. foo|3d|bar becomes foo=bar.", + description: "Translates hexadecimal bytes in text back to raw bytes.<br><br>e.g. <code>foo|3d|bar</code> becomes <code>foo=bar</code>.", run: ByteRepr.run_from_hex_content, input_type: "string", output_type: "byte_array", args: [] }, "To Hex Content": { - description: "Converts special characters in a string to hexadecimal.

e.g. foo=bar becomes foo|3d|bar.", + description: "Converts special characters in a string to hexadecimal.<br><br>e.g. <code>foo=bar</code> becomes <code>foo|3d|bar</code>.", run: ByteRepr.run_to_hex_content, input_type: "byte_array", output_type: "string", @@ -690,7 +784,7 @@ var OperationConfig = { ] }, "Change IP format": { - description: "Convert an IP address from one format to another, e.g. 172.20.23.54 to ac141736", + description: "Convert an IP address from one format to another, e.g. <code>172.20.23.54</code> to <code>ac141736</code>", run: IP.run_change_ip_format, input_type: "string", output_type: "string", @@ -708,7 +802,7 @@ var OperationConfig = { ] }, "Parse IP range": { - description: "Given a CIDR range (e.g. 10.0.0.0/24) or a hyphenated range (e.g. 10.0.0.0 - 10.0.1.0), this operation provides network information and enumerates all IP addresses in the range.

IPv6 is supported but will not be enumerated.", + description: "Given a CIDR range (e.g. <code>10.0.0.0/24</code>) or a hyphenated range (e.g. <code>10.0.0.0 - 10.0.1.0</code>), this operation provides network information and enumerates all IP addresses in the range.<br><br>IPv6 is supported but will not be enumerated.", run: IP.run_parse_ip_range, input_type: "string", output_type: "string", @@ -754,14 +848,14 @@ var OperationConfig = { ] }, "Parse IPv6 address": { - description: "Displays the longhand and shorthand versions of a valid IPv6 address.

Recognises all reserved ranges and parses encapsulated or tunnelled addresses including Teredo and 6to4.", + description: "Displays the longhand and shorthand versions of a valid IPv6 address.<br><br>Recognises all reserved ranges and parses encapsulated or tunnelled addresses including Teredo and 6to4.", run: IP.run_parse_ipv6, input_type: "string", output_type: "string", args: [] }, "Text encoding": { - description: "Translates the data between different character encodings.

Supported charsets are:
  • UTF8
  • UTF16
  • UTF16LE (little-endian)
  • UTF16BE (big-endian)
  • Hex
  • Base64
  • Latin1 (ISO-8859-1)
  • Windows-1251
", + description: "Translates the data between different character encodings.<br><br>Supported charsets are:<ul><li>UTF8</li><li>UTF16</li><li>UTF16LE (little-endian)</li><li>UTF16BE (big-endian)</li><li>Hex</li><li>Base64</li><li>Latin1 (ISO-8859-1)</li><li>Windows-1251</li></ul>", run: CharEnc.run, input_type: "string", output_type: "string", @@ -779,7 +873,7 @@ var OperationConfig = { ] }, "AES Decrypt": { - description: "To successfully decrypt AES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 16 bytes of encrypted material.", + description: "To successfully decrypt AES, you need either:<ul><li>The passphrase</li><li>Or the key and IV</li></ul>The IV should be the first 16 bytes of encrypted material.", run: Cipher.run_aes_dec, input_type: "string", output_type: "string", @@ -826,7 +920,7 @@ var OperationConfig = { ] }, "AES Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.

AES-128, AES-192, and AES-256 are supported. The variant will be chosen based on the size of the key passed in. If a passphrase is used, a 256-bit key will be generated.", + description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.<br><br>AES-128, AES-192, and AES-256 are supported. The variant will be chosen based on the size of the key passed in. If a passphrase is used, a 256-bit key will be generated.", run: Cipher.run_aes_enc, input_type: "string", output_type: "string", @@ -873,7 +967,7 @@ var OperationConfig = { ] }, "DES Decrypt": { - description: "To successfully decrypt DES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 8 bytes of encrypted material.", + description: "To successfully decrypt DES, you need either:<ul><li>The passphrase</li><li>Or the key and IV</li></ul>The IV should be the first 8 bytes of encrypted material.", run: Cipher.run_des_dec, input_type: "string", output_type: "string", @@ -920,7 +1014,7 @@ var OperationConfig = { ] }, "DES Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.", + description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>DES is a previously dominant algorithm for encryption, and was published as an official U.S. Federal Information Processing Standard (FIPS). It is now considered to be insecure due to its small key size.", run: Cipher.run_des_enc, input_type: "string", output_type: "string", @@ -967,7 +1061,7 @@ var OperationConfig = { ] }, "Triple DES Decrypt": { - description: "To successfully decrypt Triple DES, you need either:
  • The passphrase
  • Or the key and IV
The IV should be the first 8 bytes of encrypted material.", + description: "To successfully decrypt Triple DES, you need either:<ul><li>The passphrase</li><li>Or the key and IV</li></ul>The IV should be the first 8 bytes of encrypted material.", run: Cipher.run_triple_des_dec, input_type: "string", output_type: "string", @@ -1014,7 +1108,7 @@ var OperationConfig = { ] }, "Triple DES Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Triple DES applies DES three times to each block to increase key size.", + description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>Triple DES applies DES three times to each block to increase key size.", run: Cipher.run_triple_des_enc, input_type: "string", output_type: "string", @@ -1109,7 +1203,7 @@ var OperationConfig = { ] }, "Rabbit Decrypt": { - description: "To successfully decrypt Rabbit, you need either:
  • The passphrase
  • Or the key and IV (This is currently broken. You need the key and salt at the moment.)
The IV should be the first 8 bytes of encrypted material.", + description: "To successfully decrypt Rabbit, you need either:<ul><li>The passphrase</li><li>Or the key and IV (This is currently broken. You need the key and salt at the moment.)</li></ul>The IV should be the first 8 bytes of encrypted material.", run: Cipher.run_rabbit_dec, input_type: "string", output_type: "string", @@ -1156,7 +1250,7 @@ var OperationConfig = { ] }, "Rabbit Encrypt": { - description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.

Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2 year process where 22 designs were evaluated.", + description: "Input: Either enter a passphrase (which will be used to derive a key using the OpenSSL KDF) or both the key and IV.<br><br>Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2 year process where 22 designs were evaluated.", run: Cipher.run_rabbit_enc, input_type: "string", output_type: "string", @@ -1260,7 +1354,7 @@ var OperationConfig = { ] }, "Derive PBKDF2 key": { - description: "PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

Enter your passphrase as the input and then set the relevant options to generate a key.", + description: "PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>Enter your passphrase as the input and then set the relevant options to generate a key.", run: Cipher.run_pbkdf2, input_type: "string", output_type: "string", @@ -1293,7 +1387,7 @@ var OperationConfig = { ] }, "Derive EVP key": { - description: "EVP is a password-based key derivation function used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

Enter your passphrase as the input and then set the relevant options to generate a key.", + description: "EVP is a password-based key derivation function used extensively in OpenSSL. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.<br><br>A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.<br><br>Enter your passphrase as the input and then set the relevant options to generate a key.", run: Cipher.run_evpkdf, input_type: "string", output_type: "string", @@ -1405,7 +1499,7 @@ var OperationConfig = { args: [] }, "Format MAC addresses": { - description: "Displays given MAC addresses in multiple different formats.

Expects addresses in a list separated by newlines, spaces or commas.

WARNING: There are no validity checks.", + description: "Displays given MAC addresses in multiple different formats.<br><br>Expects addresses in a list separated by newlines, spaces or commas.<br><br>WARNING: There are no validity checks.", run: MAC.run_format, input_type: "string", output_type: "string", @@ -1451,7 +1545,7 @@ var OperationConfig = { ] }, "Remove whitespace": { - description: "Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.

This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.", + description: "Optionally removes all spaces, carriage returns, line feeds, tabs and form feeds from the input data.<br><br>This operation also supports the removal of full stops which are sometimes used to represent non-printable bytes in ASCII output.", run: Tidy.run_remove_whitespace, input_type: "string", output_type: "string", @@ -1489,7 +1583,7 @@ var OperationConfig = { ] }, "Remove null bytes": { - description: "Removes all null bytes (0x00) from the input.", + description: "Removes all null bytes (<code>0x00</code>) from the input.", run: Tidy.run_remove_nulls, input_type: "byte_array", output_type: "byte_array", @@ -1578,7 +1672,7 @@ var OperationConfig = { ] }, "Sort": { - description: "Alphabetically sorts strings separated by the specified delimiter.

The IP address option supports IPv4 only.", + description: "Alphabetically sorts strings separated by the specified delimiter.<br><br>The IP address option supports IPv4 only.", run: SeqUtils.run_sort, input_type: "string", output_type: "string", @@ -1642,7 +1736,7 @@ var OperationConfig = { args: [] }, "Find / Replace": { - description: "Replaces all occurrences of the first string with the second.

The three match options are only relevant to regex search strings.", + description: "Replaces all occurrences of the first string with the second.<br><br>The three match options are only relevant to regex search strings.", run: StrUtils.run_find_replace, manual_bake: true, input_type: "string", @@ -1738,7 +1832,7 @@ var OperationConfig = { ] }, "Extract IP addresses": { - description: "Extracts all IPv4 and IPv6 addresses.

Warning: Given a string 710.65.0.456, this will match 10.65.0.45 so always check the original input!", + description: "Extracts all IPv4 and IPv6 addresses.<br><br>Warning: Given a string <code>710.65.0.456</code>, this will match <code>10.65.0.45</code> so always check the original input!", run: Extract.run_ip, input_type: "string", output_type: "string", @@ -1805,7 +1899,7 @@ var OperationConfig = { ] }, "Extract domains": { - description: "Extracts domain names with common Top-Level Domains (TLDs).
Note that this will not include paths. Use Extract URLs to find entire URLs.", + description: "Extracts domain names with common Top-Level Domains (TLDs).<br>Note that this will not include paths. Use <strong>Extract URLs</strong> to find entire URLs.", run: Extract.run_domains, input_type: "string", output_type: "string", @@ -1818,7 +1912,7 @@ var OperationConfig = { ] }, "Extract file paths": { - description: "Extracts anything that looks like a Windows or UNIX file path.

Note that if UNIX is selected, there will likely be a lot of false positives.", + description: "Extracts anything that looks like a Windows or UNIX file path.<br><br>Note that if UNIX is selected, there will likely be a lot of false positives.", run: Extract.run_file_paths, input_type: "string", output_type: "string", @@ -1841,7 +1935,7 @@ var OperationConfig = { ] }, "Extract dates": { - description: "Extracts dates in the following formats
  • yyyy-mm-dd
  • dd/mm/yyyy
  • mm/dd/yyyy
Dividers can be any of /, -, . or space", + description: "Extracts dates in the following formats<ul><li><code>yyyy-mm-dd</code></li><li><code>dd/mm/yyyy</code></li><li><code>mm/dd/yyyy</code></li></ul>Dividers can be any of /, -, . or space", run: Extract.run_dates, input_type: "string", output_type: "string", @@ -1894,7 +1988,7 @@ var OperationConfig = { ] }, "From UNIX Timestamp": { - description: "Converts a UNIX timestamp to a datetime string.

e.g. 978346800 becomes Mon 1 January 2001 11:00:00 UTC", + description: "Converts a UNIX timestamp to a datetime string.<br><br>e.g. <code>978346800</code> becomes <code>Mon 1 January 2001 11:00:00 UTC</code>", run: DateTime.run_from_unix_timestamp, input_type: "number", output_type: "string", @@ -1907,7 +2001,7 @@ var OperationConfig = { ] }, "To UNIX Timestamp": { - description: "Parses a datetime string and returns the corresponding UNIX timestamp.

e.g. Mon 1 January 2001 11:00:00 UTC becomes 978346800", + description: "Parses a datetime string and returns the corresponding UNIX timestamp.<br><br>e.g. <code>Mon 1 January 2001 11:00:00 UTC</code> becomes <code>978346800</code>", run: DateTime.run_to_unix_timestamp, input_type: "string", output_type: "number", @@ -1920,7 +2014,7 @@ var OperationConfig = { ] }, "Translate DateTime Format": { - description: "Parses a datetime string in one format and re-writes it in another.

Run with no input to see the relevant format string examples.", + description: "Parses a datetime string in one format and re-writes it in another.<br><br>Run with no input to see the relevant format string examples.", run: DateTime.run_translate_format, input_type: "string", output_type: "html", @@ -1954,7 +2048,7 @@ var OperationConfig = { ] }, "Parse DateTime": { - description: "Parses a DateTime string in your specified format and displays it in whichever timezone you choose with the following information:
  • Date
  • Time
  • Period (AM/PM)
  • Timezone
  • UTC offset
  • Daylight Saving Time
  • Leap year
  • Days in this month
  • Day of year
  • Week number
  • Quarter
Run with no input to see format string examples if required.", + description: "Parses a DateTime string in your specified format and displays it in whichever timezone you choose with the following information:<ul><li>Date</li><li>Time</li><li>Period (AM/PM)</li><li>Timezone</li><li>UTC offset</li><li>Daylight Saving Time</li><li>Leap year</li><li>Days in this month</li><li>Day of year</li><li>Week number</li><li>Quarter</li></ul>Run with no input to see format string examples if required.", run: DateTime.run_parse, input_type: "string", output_type: "html", @@ -2195,7 +2289,7 @@ var OperationConfig = { args: [] }, "Zip": { - description: "Compresses data using the PKZIP algorithm with the given filename.

No support for multiple files at this time.", + description: "Compresses data using the PKZIP algorithm with the given filename.<br><br>No support for multiple files at this time.", run: Compress.run_pkzip, input_type: "byte_array", output_type: "byte_array", @@ -2258,7 +2352,7 @@ var OperationConfig = { args: [] }, "Generic Code Beautify": { - description: "Attempts to pretty print C-style languages such as C, C++, C#, Java, PHP, JavaScript etc.

This will not do a perfect job, and the resulting code may not work any more. This operation is designed purely to make obfuscated or minified code more easy to read and understand.

Things which will not work properly:
  • For loop formatting
  • Do-While loop formatting
  • Switch/Case indentation
  • Certain bit shift operators
", + description: "Attempts to pretty print C-style languages such as C, C++, C#, Java, PHP, JavaScript etc.<br><br>This will not do a perfect job, and the resulting code may not work any more. This operation is designed purely to make obfuscated or minified code more easy to read and understand.<br><br>Things which will not work properly:<ul><li>For loop formatting</li><li>Do-While loop formatting</li><li>Switch/Case indentation</li><li>Certain bit shift operators</li></ul>", run: Code.run_generic_beautify, input_type: "string", output_type: "string", @@ -2432,14 +2526,14 @@ var OperationConfig = { args: [] }, "MD5": { - description: "MD5 (Message-Digest 5) is a widely used hash function. It has been used in a variety of security applications and is also commonly used to check the integrity of files.

However, MD5 is not collision resistant and it isn't suitable for applications like SSL/TLS certificates or digital signatures that rely on this property.", + description: "MD5 (Message-Digest 5) is a widely used hash function. It has been used in a variety of security applications and is also commonly used to check the integrity of files.<br><br>However, MD5 is not collision resistant and it isn't suitable for applications like SSL/TLS certificates or digital signatures that rely on this property.", run: Hash.run_md5, input_type: "string", output_type: "string", args: [] }, "SHA1": { - description: "The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.

However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.", + description: "The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.<br><br>However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.", run: Hash.run_sha1, input_type: "string", output_type: "string", @@ -2487,7 +2581,7 @@ var OperationConfig = { ] }, "RIPEMD-160": { - description: "RIPEMD (RACE Integrity Primitives Evaluation Message Digest) is a family of cryptographic hash functions developed in Leuven, Belgium, by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996.

RIPEMD was based upon the design principles used in MD4, and is similar in performance to the more popular SHA-1.

RIPEMD-160 is an improved, 160-bit version of the original RIPEMD, and the most common version in the family.", + description: "RIPEMD (RACE Integrity Primitives Evaluation Message Digest) is a family of cryptographic hash functions developed in Leuven, Belgium, by Hans Dobbertin, Antoon Bosselaers and Bart Preneel at the COSIC research group at the Katholieke Universiteit Leuven, and first published in 1996.<br><br>RIPEMD was based upon the design principles used in MD4, and is similar in performance to the more popular SHA-1.<br><br>RIPEMD-160 is an improved, 160-bit version of the original RIPEMD, and the most common version in the family.", run: Hash.run_ripemd160, input_type: "string", output_type: "string", @@ -2512,21 +2606,21 @@ var OperationConfig = { ] }, "Fletcher-16 Checksum": { - description: "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.

The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.", + description: "The Fletcher checksum is an algorithm for computing a position-dependent checksum devised by John Gould Fletcher at Lawrence Livermore Labs in the late 1970s.<br><br>The objective of the Fletcher checksum was to provide error-detection properties approaching those of a cyclic redundancy check but with the lower computational effort associated with summation techniques.", run: Checksum.run_fletcher16, input_type: "byte_array", output_type: "string", args: [] }, "Adler-32 Checksum": { - description: "Adler-32 is a checksum algorithm which was invented by Mark Adler in 1995, and is a modification of the Fletcher checksum. Compared to a cyclic redundancy check of the same length, it trades reliability for speed (preferring the latter).

Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32.", + description: "Adler-32 is a checksum algorithm which was invented by Mark Adler in 1995, and is a modification of the Fletcher checksum. Compared to a cyclic redundancy check of the same length, it trades reliability for speed (preferring the latter).<br><br>Adler-32 is more reliable than Fletcher-16, and slightly less reliable than Fletcher-32.", run: Checksum.run_adler32, input_type: "byte_array", output_type: "string", args: [] }, "CRC-32 Checksum": { - description: "A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.

The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function of Ethernet and many other standards is the work of several researchers and was published in 1975.", + description: "A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data.<br><br>The CRC was invented by W. Wesley Peterson in 1961; the 32-bit CRC function of Ethernet and many other standards is the work of several researchers and was published in 1975.", run: Checksum.run_crc32, input_type: "byte_array", output_type: "string", @@ -2573,7 +2667,7 @@ var OperationConfig = { args: [] }, "Parse X.509 certificate": { - description: "X.509 is an ITU-T standard for a public key infrastructure (PKI) and Privilege Management Infrastructure (PMI). It is commonly involved with SSL/TLS security.

This operation displays the contents of a certificate in a human readable format, similar to the openssl command line tool.", + description: "X.509 is an ITU-T standard for a public key infrastructure (PKI) and Privilege Management Infrastructure (PMI). It is commonly involved with SSL/TLS security.<br><br>This operation displays the contents of a certificate in a human readable format, similar to the openssl command line tool.", run: PublicKey.run_parse_x509, input_type: "string", output_type: "string", @@ -2620,7 +2714,7 @@ var OperationConfig = { args: [] }, "Parse ASN.1 hex string": { - description: "Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.

This operation parses arbitrary ASN.1 data and presents the resulting tree.", + description: "Abstract Syntax Notation One (ASN.1) is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data in telecommunications and computer networking.<br><br>This operation parses arbitrary ASN.1 data and presents the resulting tree.", run: PublicKey.run_parse_asn1_hex_string, input_type: "string", output_type: "string", @@ -2638,14 +2732,14 @@ var OperationConfig = { ] }, "Detect File Type": { - description: "Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.

Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.", + description: "Attempts to guess the MIME (Multipurpose Internet Mail Extensions) type of the data based on 'magic bytes'.<br><br>Currently supports the following file types: 7z, amr, avi, bmp, bz2, class, cr2, crx, dex, dmg, doc, elf, eot, epub, exe, flac, flv, gif, gz, ico, iso, jpg, jxr, m4a, m4v, mid, mkv, mov, mp3, mp4, mpg, ogg, otf, pdf, png, ppt, ps, psd, rar, rtf, sqlite, swf, tar, tar.z, tif, ttf, utf8, vmdk, wav, webm, webp, wmv, woff, woff2, xls, xz, zip.", run: FileType.run_detect, input_type: "byte_array", output_type: "string", args: [] }, "Scan for Embedded Files": { - description: "Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.

WARNING: Files over about 100KB in size will take a VERY long time to process.", + description: "Scans the data for potential embedded files by looking for magic bytes at all offsets. This operation is prone to false positives.<br><br>WARNING: Files over about 100KB in size will take a VERY long time to process.", run: FileType.run_scan_for_embedded_files, input_type: "byte_array", output_type: "string", @@ -2658,7 +2752,7 @@ var OperationConfig = { ] }, "Expand alphabet range": { - description: "Expand an alphabet range string into a list of the characters in that range.

e.g. a-z becomes abcdefghijklmnopqrstuvwxyz.", + description: "Expand an alphabet range string into a list of the characters in that range.<br><br>e.g. <code>a-z</code> becomes <code>abcdefghijklmnopqrstuvwxyz</code>.", run: SeqUtils.run_expand_alph_range, input_type: "string", output_type: "string", @@ -2704,7 +2798,7 @@ var OperationConfig = { ] }, "Parse UNIX file permissions": { - description: "Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.

Input should be in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.", + description: "Given a UNIX/Linux file permission string in octal or textual format, this operation explains which permissions are granted to which user groups.<br><br>Input should be in either octal (e.g. <code>755</code>) or textual (e.g. <code>drwxr-xr-x</code>) format.", run: OS.run_parse_unix_perms, input_type: "string", output_type: "string", @@ -2756,7 +2850,7 @@ var OperationConfig = { ] }, "Parse escaped string": { - description: "Replaces escaped characters with the bytes they represent.

e.g.Hello\\nWorld becomes Hello
World
", + description: "Replaces escaped characters with the bytes they represent.<br><br>e.g.<code>Hello\\nWorld</code> becomes <code>Hello<br>World</code>", run: StrUtils.run_parse_escaped_string, input_type: "string", output_type: "string", @@ -2770,17 +2864,153 @@ var OperationConfig = { args: [] }, "Parse colour code": { - description: "Converts a colour code in a standard format to other standard formats and displays the colour itself.

Example inputs
  • #d9edf7
  • rgba(217,237,247,1)
  • hsla(200,65%,91%,1)
  • cmyk(0.12, 0.04, 0.00, 0.03)
", + description: "Converts a colour code in a standard format to other standard formats and displays the colour itself.<br><br><strong>Example inputs</strong><ul><li><code>#d9edf7</code></li><li><code>rgba(217,237,247,1)</code></li><li><code>hsla(200,65%,91%,1)</code></li><li><code>cmyk(0.12, 0.04, 0.00, 0.03)</code></li></ul>", run: HTML.run_parse_colour_code, input_type: "string", output_type: "html", args: [] }, "Generate UUID": { - description: "Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).

A version 4 UUID relies on random numbers, in this case generated using window.crypto if available and falling back to Math.random if not.", + description: "Generates an RFC 4122 version 4 compliant Universally Unique Identifier (UUID), also known as a Globally Unique Identifier (GUID).<br><br>A version 4 UUID relies on random numbers, in this case generated using <code>window.crypto</code> if available and falling back to <code>Math.random</code> if not.", run: UUID.run_generate_v4, input_type: "string", output_type: "string", args: [] } -}; \ No newline at end of file +};
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/core_Chef.js.html b/docs/core_Chef.js.html new file mode 100755 index 00000000..8577bab6 --- /dev/null +++ b/docs/core_Chef.js.html @@ -0,0 +1,351 @@ + + + + + + + CyberChef Source: core/Chef.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: core/Chef.js

+ +
+
+
/**
+ * The main controller for CyberChef.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @class
+ */
+var Chef = function() {
+    this.dish = new Dish();
+};
+
+
+/**
+ * Runs the recipe over the input.
+ *
+ * @param {string} input_text - The input data as a string
+ * @param {Object[]} recipe_config - The recipe configuration object
+ * @param {Object} options - The options object storing various user choices
+ * @param {boolean} options.attemp_highlight - Whether or not to attempt highlighting
+ * @param {number} progress - The position in the recipe to start from
+ * @param {number} [step] - The number of operations to execute
+ *
+ * @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.options - The app options object (which may have been changed)
+ * @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 = function(input_text, recipe_config, options, progress, step) {
+    var start_time  = new Date().getTime(),
+        recipe      = new Recipe(recipe_config),
+        contains_fc = recipe.contains_flow_control(),
+        error       = false;
+    
+    // Reset attempt_highlight flag
+    if (options.hasOwnProperty("attempt_highlight")) {
+        options.attempt_highlight = true;
+    }
+    
+    if (contains_fc) options.attempt_highlight = false;
+    
+    // Clean up progress
+    if (progress >= recipe_config.length) {
+        progress = 0;
+    }
+    
+    if (step) {
+        // Unset breakpoint on this step
+        recipe.set_breakpoint(progress, false);
+        // Set breakpoint on next step
+        recipe.set_breakpoint(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 && contains_fc) {
+        recipe.remove_breaks_up_to(progress);
+        progress = 0;
+    }
+    
+    // If starting from scratch, load data
+    if (progress === 0) {
+        this.dish.set(input_text, Dish.STRING);
+    }
+
+    try {
+        progress = recipe.execute(this.dish, progress);
+    } catch (err) {
+        // We can't throw the error from here as we will return in the finally block and ignore it
+        // so we return the error in the result instead.
+        error = err;
+        progress = err.progress;
+    } finally {
+        return {
+            result: this.dish.type == Dish.HTML ?
+                this.dish.get(Dish.HTML) :
+                this.dish.get(Dish.STRING),
+            type: Dish.enum_lookup(this.dish.type),
+            progress: progress,
+            options: options,
+            duration: new Date().getTime() - start_time,
+            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[]} recipe_config - The recipe configuration object
+ * @returns {number} The time it took to run the silent bake in milliseconds.
+*/
+Chef.prototype.silent_bake = function(recipe_config) {
+    var start_time = new Date().getTime(),
+        recipe     = new Recipe(recipe_config),
+        dish       = new Dish("", Dish.STRING);
+        
+    try {
+        recipe.execute(dish);
+    } catch(err) {
+        // Suppress all errors
+    }
+    return new Date().getTime() - start_time;
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/core_Dish.js.html b/docs/core_Dish.js.html new file mode 100755 index 00000000..5a249a0a --- /dev/null +++ b/docs/core_Dish.js.html @@ -0,0 +1,433 @@ + + + + + + + CyberChef Source: core/Dish.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: core/Dish.js

+ +
+
+
/**
+ * The data being operated on by each operation.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @class
+ * @param {byte_array|string|number} value - The value of the input data.
+ * @param {number} type - The data type of value, see Dish enums.
+ */
+var 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;
+
+
+/**
+ * Returns the data type enum for the given type string.
+ *
+ * @static
+ * @param {string} type_str - The name of the data type.
+ * @returns {number} The data type enum value.
+ */
+Dish.type_enum = function(type_str) {
+    switch (type_str) {
+        case "byte_array":
+        case "Byte array":
+            return Dish.BYTE_ARRAY;
+        case "string":
+        case "String":
+            return Dish.STRING;
+        case "number":
+        case "Number":
+            return Dish.NUMBER;
+        case "html":
+        case "HTML":
+            return Dish.HTML;
+        default:
+            throw "Invalid data type string. No matching enum.";
+    }
+};
+
+
+/**
+ * Returns the data type string for the given type enum.
+ *
+ * @static
+ * @param {string} type_enum - The enum value of the data type.
+ * @returns {number} The data type as a string.
+ */
+Dish.enum_lookup = function(type_enum) {
+    switch (type_enum) {
+        case Dish.BYTE_ARRAY:
+            return "byte_array";
+        case Dish.STRING:
+            return "string";
+        case Dish.NUMBER:
+            return "number";
+        case Dish.HTML:
+            return "html";
+        default:
+            throw "Invalid data type enum. No matching type.";
+    }
+};
+
+
+/**
+ * Sets the data value and type and then validates them.
+ *
+ * @param {byte_array|string|number} value - The value of the input data.
+ * @param {number} type - The data type of value, see Dish enums.
+ */
+Dish.prototype.set = function(value, type) {
+    this.value = value;
+    this.type  = type;
+    
+    if (!this.valid()) {
+        var sample = Utils.truncate(JSON.stringify(this.value), 13);
+        throw "Data is not a valid " + Dish.enum_lookup(type) + ": " + sample;
+    }
+};
+
+
+/**
+ * Returns the value of the data in the type format specified.
+ *
+ * @param {number} type - The data type of value, see Dish enums.
+ * @returns {byte_array|string|number} The value of the output data.
+ */
+Dish.prototype.get = function(type) {
+    if (this.type != type) {
+        this.translate(type);
+    }
+    return this.value;
+};
+
+
+/**
+ * Translates the data to the given type format.
+ *
+ * @param {number} to_type - The data type of value, see Dish enums.
+ */
+Dish.prototype.translate = function(to_type) {
+    // Convert data to intermediate byte_array type
+    switch (this.type) {
+        case Dish.STRING:
+            this.value = this.value ? Utils.str_to_byte_array(this.value) : [];
+            this.type = Dish.BYTE_ARRAY;
+            break;
+        case Dish.NUMBER:
+            this.value = typeof this.value == "number" ? Utils.str_to_byte_array(this.value.toString()) : [];
+            this.type = Dish.BYTE_ARRAY;
+            break;
+        case Dish.HTML:
+            this.value = this.value ? Utils.str_to_byte_array(Utils.strip_html_tags(this.value, true)) : [];
+            this.type = Dish.BYTE_ARRAY;
+            break;
+        default:
+            break;
+    }
+    
+    // Convert from byte_array to to_type
+    switch (to_type) {
+        case Dish.STRING:
+        case Dish.HTML:
+            this.value = this.value ? Utils.byte_array_to_utf8(this.value) : "";
+            this.type = Dish.STRING;
+            break;
+        case Dish.NUMBER:
+            this.value = this.value ? parseFloat(Utils.byte_array_to_utf8(this.value)) : 0;
+            this.type = Dish.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 (var 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:
+            if (typeof this.value == "string") {
+                return true;
+            }
+            return false;
+        case Dish.NUMBER:
+            if (typeof this.value == "number") {
+                return true;
+            }
+            return false;
+        default:
+            return false;
+    }
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/core_FlowControl.js.html b/docs/core_FlowControl.js.html new file mode 100755 index 00000000..9fbecdaa --- /dev/null +++ b/docs/core_FlowControl.js.html @@ -0,0 +1,402 @@ + + + + + + + CyberChef Source: core/FlowControl.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: core/FlowControl.js

+ +
+
+
/**
+ * Flow Control operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var FlowControl = {
+
+    /**
+     * @constant
+     * @default
+     */
+    FORK_DELIM: "\\n",
+    /**
+     * @constant
+     * @default
+     */
+    MERGE_DELIM: "\\n",
+    
+    /**
+     * 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.op_list - The list of operations in the recipe.
+     * @returns {Object} The updated state of the recipe.
+     */
+    run_fork: function(state) {
+        var op_list     = state.op_list,
+            input_type  = op_list[state.progress].input_type,
+            output_type = op_list[state.progress].output_type,
+            input       = state.dish.get(input_type),
+            ings        = op_list[state.progress].get_ing_values(),
+            split_delim = ings[0],
+            merge_delim = ings[1],
+            sub_op_list = [],
+            inputs      = [];
+        
+        if (input)
+            inputs = input.split(split_delim);
+        
+        // Create sub_op_list for each tranche to operate on
+        // (all remaining operations unless we encounter a Merge)
+        for (var i = state.progress + 1; i < op_list.length; i++) {
+            if (op_list[i].name == "Merge" && !op_list[i].is_disabled()) {
+                break;
+            } else {
+                sub_op_list.push(op_list[i]);
+            }
+        }
+        
+        var recipe = new Recipe(),
+            output = "",
+            progress;
+            
+        recipe.add_operations(sub_op_list);
+        
+        // Run recipe over each tranche
+        for (i = 0; i < inputs.length; i++) {
+            var dish = new Dish(inputs[i], input_type);
+            progress = recipe.execute(dish, 0);
+            output += dish.get(output_type) + merge_delim;
+        }
+        
+        state.dish.set(output, output_type);
+        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.op_list - The list of operations in the recipe.
+     * @returns {Object} The updated state of the recipe.
+     */
+    run_merge: function(state) {
+        // No need to actually do anything here. The fork operation will
+        // merge when it sees this operation.
+        return state;
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    JUMP_NUM: 0,
+    /**
+     * @constant
+     * @default
+     */
+    MAX_JUMPS: 10,
+    
+    /**
+     * 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.op_list - The list of operations in the recipe.
+     * @param {number} state.num_jumps - The number of jumps taken so far.
+     * @returns {Object} The updated state of the recipe.
+     */
+    run_jump: function(state) {
+        var ings      = state.op_list[state.progress].get_ing_values(),
+            jump_num  = ings[0],
+            max_jumps = ings[1];
+        
+        if (state.num_jumps >= max_jumps) {
+            throw "Reached maximum jumps, sorry!";
+        }
+        
+        state.progress += jump_num;
+        state.num_jumps++;
+        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.op_list - The list of operations in the recipe.
+     * @param {number} state.num_jumps - The number of jumps taken so far.
+     * @returns {Object} The updated state of the recipe.
+     */
+    run_cond_jump: function(state) {
+        var ings      = state.op_list[state.progress].get_ing_values(),
+            dish      = state.dish,
+            regex_str = ings[0],
+            jump_num  = ings[1],
+            max_jumps = ings[2];
+        
+        if (state.num_jumps >= max_jumps) {
+            throw "Reached maximum jumps, sorry!";
+        }
+        
+        if (regex_str !== "" && dish.get(Dish.STRING).search(regex_str) > -1) {
+            state.progress += jump_num;
+            state.num_jumps++;
+        }
+        
+        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.op_list - The list of operations in the recipe.
+     * @returns {Object} The updated state of the recipe.
+     */
+    run_return: function(state) {
+        state.progress = state.op_list.length;
+        return state;
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/core_Ingredient.js.html b/docs/core_Ingredient.js.html new file mode 100755 index 00000000..3c94d658 --- /dev/null +++ b/docs/core_Ingredient.js.html @@ -0,0 +1,317 @@ + + + + + + + CyberChef Source: core/Ingredient.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: core/Ingredient.js

+ +
+
+
/**
+ * The arguments to operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @class
+ * @param {Object} ingredient_config
+ */
+var Ingredient = function(ingredient_config) {
+    this.name  = "";
+    this.type  = "";
+    this.value = null;
+    
+    if (ingredient_config) {
+        this._parse_config(ingredient_config);
+    }
+};
+
+
+/**
+ * Reads and parses the given config.
+ *
+ * @private
+ * @param {Object} ingredient_config
+ */
+Ingredient.prototype._parse_config = function(ingredient_config) {
+    this.name = ingredient_config.name;
+    this.type = ingredient_config.type;
+};
+
+
+/**
+ * Returns the value of the Ingredient as it should be displayed in a recipe config.
+ *
+ * @returns {*}
+ */
+Ingredient.prototype.get_config = function() {
+    return this.value;
+};
+
+
+/**
+ * Sets the value of the Ingredient.
+ *
+ * @param {*} value
+ */
+Ingredient.prototype.set_value = 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) {
+    switch (type) {
+        case "binary_string":
+        case "binary_short_string":
+        case "editable_option":
+            return Utils.parse_escaped_chars(data);
+        case "byte_array":
+            if (typeof data == "string") {
+                data = data.replace(/\s+/g, '');
+                return Utils.hex_to_byte_array(data);
+            } else {
+                return data;
+            }
+            break;
+        case "number":
+            var number = parseFloat(data);
+            if (isNaN(number)) {
+                var sample = Utils.truncate(data.toString(), 10);
+                throw "Invalid ingredient value. Not a number: " + sample;
+            }
+            return number;
+        default:
+            return data;
+    }
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/core_Operation.js.html b/docs/core_Operation.js.html new file mode 100755 index 00000000..14c3e885 --- /dev/null +++ b/docs/core_Operation.js.html @@ -0,0 +1,388 @@ + + + + + + + CyberChef Source: core/Operation.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: core/Operation.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} operation_name
+ * @param {Object} operation_config
+ */
+var Operation = function(operation_name, operation_config) {
+    this.name              = operation_name;
+    this.description       = "";
+    this.input_type        = -1;
+    this.output_type       = -1;
+    this.run               = null;
+    this.highlight         = null;
+    this.highlight_reverse = null;
+    this.breakpoint        = false;
+    this.disabled          = false;
+    this.ing_list          = [];
+    
+    if (operation_config) {
+        this._parse_config(operation_config);
+    }
+};
+
+
+/**
+ * Reads and parses the given config.
+ *
+ * @private
+ * @param {Object} operation_config
+ */
+Operation.prototype._parse_config = function(operation_config) {
+    this.description       = operation_config.description;
+    this.input_type        = Dish.type_enum(operation_config.input_type);
+    this.output_type       = Dish.type_enum(operation_config.output_type);
+    this.run               = operation_config.run;
+    this.highlight         = operation_config.highlight;
+    this.highlight_reverse = operation_config.highlight_reverse;
+    this.flow_control      = operation_config.flow_control;
+
+    for (var a = 0; a < operation_config.args.length; a++) {
+        var ingredient_config = operation_config.args[a];
+        var ingredient = new Ingredient(ingredient_config);
+        this.add_ingredient(ingredient);
+    }
+};
+
+
+/**
+ * Returns the value of the Operation as it should be displayed in a recipe config.
+ *
+ * @returns {Object}
+ */
+Operation.prototype.get_config = function() {
+    var ingredient_config = [];
+    
+    for (var o = 0; o < this.ing_list.length; o++) {
+        ingredient_config.push(this.ing_list[o].get_config());
+    }
+    
+    var operation_config = {
+        "op": this.name,
+        "args": ingredient_config
+    };
+    
+    return operation_config;
+};
+
+
+/**
+ * Adds a new Ingredient to this Operation.
+ *
+ * @param {Ingredient} ingredient
+ */
+Operation.prototype.add_ingredient = function(ingredient) {
+    this.ing_list.push(ingredient);
+};
+
+
+/**
+ * Set the Ingredient values for this Operation.
+ *
+ * @param {Object[]} ing_values
+ */
+Operation.prototype.set_ing_values = function(ing_values) {
+    for (var i = 0; i < ing_values.length; i++) {
+        this.ing_list[i].set_value(ing_values[i]);
+    }
+};
+
+
+/**
+ * Get the Ingredient values for this Operation.
+ *
+ * @returns {Object[]}
+ */
+Operation.prototype.get_ing_values = function() {
+    var ing_values = [];
+    for (var i = 0; i < this.ing_list.length; i++) {
+        ing_values.push(this.ing_list[i].value);
+    }
+    return ing_values;
+};
+
+
+/**
+ * Set whether this Operation has a breakpoint.
+ *
+ * @param {boolean} value
+ */
+Operation.prototype.set_breakpoint = function(value) {
+    this.breakpoint = !!value;
+};
+
+
+/**
+ * Returns true if this Operation has a breakpoint set.
+ *
+ * @returns {boolean}
+ */
+Operation.prototype.is_breakpoint = function() {
+    return this.breakpoint;
+};
+
+
+/**
+ * Set whether this Operation is disabled.
+ *
+ * @param {boolean} value
+ */
+Operation.prototype.set_disabled = function(value) {
+    this.disabled = !!value;
+};
+
+
+/**
+ * Returns true if this Operation is disabled.
+ *
+ * @returns {boolean}
+ */
+Operation.prototype.is_disabled = function() {
+    return this.disabled;
+};
+
+
+/**
+ * Returns true if this Operation is a flow control.
+ *
+ * @returns {boolean}
+ */
+Operation.prototype.is_flow_control = function() {
+    return this.flow_control;
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/core_Recipe.js.html b/docs/core_Recipe.js.html new file mode 100755 index 00000000..6c5cf4a8 --- /dev/null +++ b/docs/core_Recipe.js.html @@ -0,0 +1,446 @@ + + + + + + + CyberChef Source: core/Recipe.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: core/Recipe.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} recipe_config
+ */
+var Recipe = function(recipe_config) {
+    this.op_list = [];
+    
+    if (recipe_config) {
+        this._parse_config(recipe_config);
+    }
+};
+
+
+/**
+ * Reads and parses the given config.
+ *
+ * @private
+ * @param {Object} recipe_config
+ */
+Recipe.prototype._parse_config = function(recipe_config) {
+    for (var c = 0; c < recipe_config.length; c++) {
+        var operation_name = recipe_config[c].op;
+        var operation_config = OperationConfig[operation_name];
+        var operation = new Operation(operation_name, operation_config);
+        operation.set_ing_values(recipe_config[c].args);
+        operation.set_breakpoint(recipe_config[c].breakpoint);
+        operation.set_disabled(recipe_config[c].disabled);
+        this.add_operation(operation);
+    }
+};
+
+
+/**
+ * Returns the value of the Recipe as it should be displayed in a recipe config.
+ *
+ * @returns {*}
+ */
+Recipe.prototype.get_config = function() {
+    var recipe_config = [];
+    
+    for (var o = 0; o < this.op_list.length; o++) {
+        recipe_config.push(this.op_list[o].get_config());
+    }
+    
+    return recipe_config;
+};
+
+
+/**
+ * Adds a new Operation to this Recipe.
+ *
+ * @param {Operation} operation
+ */
+Recipe.prototype.add_operation = function(operation) {
+    this.op_list.push(operation);
+};
+
+
+/**
+ * Adds a list of Operations to this Recipe.
+ *
+ * @param {Operation[]} operations
+ */
+Recipe.prototype.add_operations = function(operations) {
+    this.op_list = this.op_list.concat(operations);
+};
+
+
+/**
+ * Set a breakpoint on a specified Operation.
+ *
+ * @param {number} position - The index of the Operation
+ * @param {boolean} value
+ */
+Recipe.prototype.set_breakpoint = function(position, value) {
+    try {
+        this.op_list[position].set_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
+ */
+Recipe.prototype.remove_breaks_up_to = function(pos) {
+    for (var i = 0; i < pos; i++) {
+        this.op_list[i].set_breakpoint(false);
+    }
+};
+
+
+/**
+ * Returns true if there is an Flow Control Operation in this Recipe.
+ *
+ * @returns {boolean}
+ */
+Recipe.prototype.contains_flow_control = function() {
+    for (var i = 0; i < this.op_list.length; i++) {
+        if (this.op_list[i].is_flow_control()) 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} [start_index=0] - The index to start searching from
+ * @returns (number}
+ */
+Recipe.prototype.last_op_index = function(start_index) {
+    var i = start_index + 1 || 0,
+        op;
+        
+    for (; i < this.op_list.length; i++) {
+        op = this.op_list[i];
+        if (op.is_disabled()) return i-1;
+        if (op.is_breakpoint()) return i-1;
+    }
+    
+    return i-1;
+};
+
+
+/**
+ * Executes each operation in the recipe over the given Dish.
+ *
+ * @param {Dish} dish
+ * @param {number} [start_from=0] - The index of the Operation to start executing from
+ * @returns {number} - The final progress through the recipe
+ */
+Recipe.prototype.execute = function(dish, start_from) {
+    start_from = start_from || 0;
+    var op, input, output, num_jumps = 0;
+    
+    for (var i = start_from; i < this.op_list.length; i++) {
+        op = this.op_list[i];
+        if (op.is_disabled()) {
+            continue;
+        }
+        if (op.is_breakpoint()) {
+            return i;
+        }
+        
+        try {
+            input = dish.get(op.input_type);
+            
+            if (op.is_flow_control()) {
+                // Package up the current state
+                var state = {
+                    "progress" : i,
+                    "dish"     : dish,
+                    "op_list"  : this.op_list,
+                    "num_jumps" : num_jumps
+                };
+                
+                state = op.run(state);
+                i = state.progress;
+                num_jumps = state.num_jumps;
+            } else {
+                output = op.run(input, op.get_ing_values());
+                dish.set(output, op.output_type);
+            }
+        } catch (err) {
+            var e = typeof err == "string" ? { message: err } : err;
+
+            e.progress = i;
+            e.display_str = op.name + " - ";
+            if (e.fileName) {
+                e.display_str += e.name + " in " + e.fileName +
+                    " on line " + e.lineNumber +
+                    ".<br><br>Message: " + e.message;
+            } else {
+                e.display_str += e.message;
+            }
+            
+            throw e;
+        }
+    }
+    
+    return this.op_list.length;
+};
+
+
+/**
+ * Returns the recipe configuration in string format.
+ *
+ * @returns {string}
+ */
+Recipe.prototype.to_string = function() {
+    return JSON.stringify(this.get_config());
+};
+
+
+/**
+ * Creates a Recipe from a given configuration string.
+ *
+ * @param {string} recipe_str
+ */
+Recipe.prototype.from_string = function(recipe_str) {
+    var recipe_config = JSON.parse(recipe_str);
+    this._parse_config(recipe_config);
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/core/Utils.js b/docs/core_Utils.js.html similarity index 76% rename from src/js/core/Utils.js rename to docs/core_Utils.js.html index 2e52517b..1b303230 100755 --- a/src/js/core/Utils.js +++ b/docs/core_Utils.js.html @@ -1,4 +1,98 @@ -/* globals CryptoJS, moment */ + + + + + + + CyberChef Source: core/Utils.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: core/Utils.js

+ +
+
+
/* globals CryptoJS, moment */
 
 /**
  * Utility functions for use in operations, the core framework and the stage.
@@ -65,8 +159,8 @@ var Utils = {
     pad_left: function(str, max, chr) {
         chr = chr || "0";
         var start_index = chr.length - (max - str.length);
-        start_index = start_index < 0 ? 0 : start_index;
-        return str.length < max ?
+        start_index = start_index < 0 ? 0 : start_index;
+        return str.length < max ?
             Utils.pad_left(chr.slice(start_index, chr.length) + str, max, chr) : str;
     },
 
@@ -88,7 +182,7 @@ var Utils = {
      */
     pad_right: function(str, max, chr) {
         chr = chr || " ";
-        return str.length < max ?
+        return str.length < max ?
             Utils.pad_right(str + chr.slice(0, max-str.length), max, chr) : str;
     },
 
@@ -175,7 +269,7 @@ var Utils = {
      * @returns {string}
      */
     printable: function(str, preserve_ws) {
-        if (window && window.app && !window.app.options.treat_as_utf8) {
+        if (window && window.app && !window.app.options.treat_as_utf8) {
             str = Utils.byte_array_to_chars(Utils.str_to_byte_array(str));
         }
         
@@ -241,19 +335,19 @@ var Utils = {
     expand_alph_range: function(alph_str) {
         var alph_arr = [];
         
-        for (var i = 0; i < alph_str.length; i++) {
-            if (i < alph_str.length - 2 &&
-                alph_str[i+1] == "-" &&
+        for (var i = 0; i < alph_str.length; i++) {
+            if (i < alph_str.length - 2 &&
+                alph_str[i+1] == "-" &&
                 alph_str[i] != "\\") {
                 var start = Utils.ord(alph_str[i]),
                     end = Utils.ord(alph_str[i+2]);
                     
-                for (var j = start; j <= end; j++) {
+                for (var j = start; j <= end; j++) {
                     alph_arr.push(Utils.chr(j));
                 }
                 i += 2;
-            } else if (i < alph_str.length - 2 &&
-                alph_str[i] == "\\" &&
+            } else if (i < alph_str.length - 2 &&
+                alph_str[i] == "\\" &&
                 alph_str[i+1] == "-") {
                 alph_arr.push("-");
                 i++;
@@ -280,7 +374,7 @@ var Utils = {
         if (!hex_str) return [];
         hex_str = hex_str.replace(/\s+/g, '');
         var byte_array = [];
-        for (var i = 0; i < hex_str.length; i += 2) {
+        for (var i = 0; i < hex_str.length; i += 2) {
             byte_array.push(parseInt(hex_str.substr(i, 2), 16));
         }
         return byte_array;
@@ -300,7 +394,7 @@ var Utils = {
     byte_array_to_hex: function(byte_array) {
         if (!byte_array) return "";
         var hex_str = "";
-        for (var i = 0; i < byte_array.length; i++) {
+        for (var i = 0; i < byte_array.length; i++) {
             hex_str += Utils.hex(byte_array[i]) + " ";
         }
         return hex_str.slice(0, hex_str.length-1);
@@ -397,8 +491,8 @@ var Utils = {
         try {
             // Try to output data as UTF-8 string
             var words = [];
-            for (var i = 0; i < byte_array.length; i++) {
-                words[i >>> 2] |= byte_array[i] << (24 - (i % 4) * 8);
+            for (var i = 0; i < byte_array.length; i++) {
+                words[i >>> 2] |= byte_array[i] << (24 - (i % 4) * 8);
             }
             var word_array = new CryptoJS.lib.WordArray.init(words, byte_array.length),
                 str = CryptoJS.enc.Utf8.stringify(word_array);
@@ -429,7 +523,7 @@ var Utils = {
     byte_array_to_chars: function(byte_array) {
         if (!byte_array) return "";
         var str = "";
-        for (var i = 0; i < byte_array.length;) {
+        for (var i = 0; i < byte_array.length;) {
             str += String.fromCharCode(byte_array[i++]);
         }
         return str;
@@ -447,13 +541,13 @@ var Utils = {
      * Utils.word_array_to_byte_array(CryptoJS.enc.Hex.parse("54657374"));
      */
     word_array_to_byte_array: function(word_array) {
-        if (word_array.sigBytes <= 0) return [];
+        if (word_array.sigBytes <= 0) return [];
         
         var words = word_array.words,
             byte_array = [];
             
-        for (var i = 0; i < word_array.sigBytes; i++) {
-            byte_array.push((words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff);
+        for (var i = 0; i < word_array.sigBytes; i++) {
+            byte_array.push((words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff);
         }
         
         return byte_array;
@@ -546,7 +640,7 @@ var Utils = {
     unicode_to_win1251: function(unic_str) {
         var res = [];
         
-        for (var i = 0; i < unic_str.length; i++) {
+        for (var i = 0; i < unic_str.length; i++) {
             var ord = unic_str.charCodeAt(i);
             if (!(ord in Utils.UNIC_WIN1251_MAP))
                 throw "Character '" + unic_str.charAt(i) + "' isn't supported by Windows-1251";
@@ -570,7 +664,7 @@ var Utils = {
     win1251_to_unicode: function(win1251_str) {
         var res = [];
         
-        for (var i = 0; i < win1251_str.length; i++) {
+        for (var i = 0; i < win1251_str.length; i++) {
             var ord = win1251_str.charCodeAt(i);
             if (!(ord in Utils.WIN1251_UNIC_MAP))
                 throw "Character '" + win1251_str.charAt(i) + "' isn't supported by Windows-1251";
@@ -609,15 +703,15 @@ var Utils = {
             enc1, enc2, enc3, enc4,
             i = 0;
 
-        while (i < data.length) {
+        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;
+            enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
+            enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
+            enc4 = chr3 & 63;
 
             if (isNaN(chr2)) {
                 enc3 = enc4 = 64;
@@ -668,11 +762,11 @@ var Utils = {
             i = 0;
         
         if (remove_non_alph_chars) {
-            var re = new RegExp("[^" + alphabet.replace(/[\[\]\\\-^$]/g, "\\$&") + "]", "g");
+            var re = new RegExp("[^" + alphabet.replace(/[\[\]\\\-^$]/g, "\\$&") + "]", "g");
             data = data.replace(re, "");
         }
 
-        while (i < data.length) {
+        while (i < data.length) {
             enc1 = alphabet.indexOf(data.charAt(i++));
             enc2 = alphabet.indexOf(data.charAt(i++) || "=");
             enc3 = alphabet.indexOf(data.charAt(i++) || "=");
@@ -682,9 +776,9 @@ var Utils = {
             enc3 = enc3 == -1 ? 64 : enc3;
             enc4 = enc4 == -1 ? 64 : enc4;
 
-            chr1 = (enc1 << 2) | (enc2 >> 4);
-            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
-            chr3 = ((enc3 & 3) << 6) | enc4;
+            chr1 = (enc1 << 2) | (enc2 >> 4);
+            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
+            chr3 = ((enc3 & 3) << 6) | enc4;
 
             output.push(chr1);
 
@@ -722,7 +816,7 @@ var Utils = {
         padding = padding || 2;
         var output = "";
         
-        for (var i = 0; i < data.length; i++) {
+        for (var i = 0; i < data.length; i++) {
             output += Utils.pad(data[i].toString(16), padding) + delim;
         }
         
@@ -752,9 +846,9 @@ var Utils = {
         
         var output = [];
         
-        for (var i = 0; i < data.length; i++) {
+        for (var i = 0; i < data.length; i++) {
             output.push((data[i] >>> 4).toString(16));
-            output.push((data[i] & 0x0f).toString(16));
+            output.push((data[i] & 0x0f).toString(16));
         }
         
         return output.join("");
@@ -785,7 +879,7 @@ var Utils = {
         }
         
         var output = [];
-        for (var i = 0; i < data.length; i += byte_len) {
+        for (var i = 0; i < data.length; i += byte_len) {
             output.push(parseInt(data.substr(i, byte_len), 16));
         }
         return output;
@@ -811,7 +905,7 @@ var Utils = {
             line = [],
             lines = [];
             
-        for (var i = 0; i < data.length; i++) {
+        for (var i = 0; i < data.length; i++) {
             b = data[i];
             if (ignore_next) {
                 cell += b;
@@ -819,14 +913,14 @@ var Utils = {
             } else if (b == "\\") {
                 cell += b;
                 ignore_next = true;
-            } else if (b == "\"" && !in_string) {
+            } else if (b == "\"" && !in_string) {
                 in_string = true;
-            } else if (b == "\"" && in_string) {
+            } else if (b == "\"" && in_string) {
                 in_string = false;
-            } else if (b == "," && !in_string) {
+            } else if (b == "," && !in_string) {
                 line.push(cell);
                 cell = "";
-            } else if ((b == "\n" || b == "\r") && !in_string) {
+            } else if ((b == "\n" || b == "\r") && !in_string) {
                 line.push(cell);
                 cell = "";
                 lines.push(line);
@@ -854,13 +948,13 @@ var Utils = {
      *
      * @example
      * // returns "Test"
-     * Utils.strip_html_tags("
Test
"); + * Utils.strip_html_tags("<div>Test</div>"); */ strip_html_tags: function(html_str, remove_script_and_style) { if (remove_script_and_style) { - html_str = html_str.replace(/<(script|style)[^>]*>.*<\/(script|style)>/gmi, ""); + html_str = html_str.replace(/<(script|style)[^>]*>.*<\/(script|style)>/gmi, ""); } - return html_str.replace(/<[^>\n]+>/g, ""); + return html_str.replace(/<[^>\n]+>/g, ""); }, @@ -871,11 +965,11 @@ var Utils = { * @returns string * * @example - * // return "A <script> tag" - * Utils.escape_html("A + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/fonts/glyphicons-halflings-regular.eot b/docs/fonts/glyphicons-halflings-regular.eot new file mode 100755 index 00000000..b93a4953 Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.eot differ diff --git a/docs/fonts/glyphicons-halflings-regular.svg b/docs/fonts/glyphicons-halflings-regular.svg new file mode 100755 index 00000000..94fb5490 --- /dev/null +++ b/docs/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.ttf b/docs/fonts/glyphicons-halflings-regular.ttf new file mode 100755 index 00000000..1413fc60 Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.ttf differ diff --git a/docs/fonts/glyphicons-halflings-regular.woff b/docs/fonts/glyphicons-halflings-regular.woff new file mode 100755 index 00000000..9e612858 Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.woff differ diff --git a/docs/fonts/glyphicons-halflings-regular.woff2 b/docs/fonts/glyphicons-halflings-regular.woff2 new file mode 100755 index 00000000..64539b54 Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/docs/global.html b/docs/global.html new file mode 100755 index 00000000..e5e88ea6 --- /dev/null +++ b/docs/global.html @@ -0,0 +1,1402 @@ + + + + + + + CyberChef Global + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Global

+
+ +
+ +

+ +

+ + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ +
+ +
+
+

<constant> Categories :Array.<CatConf>

+ + +
+
+ +
+

Categories of operations.

+
+ + + +
Type:
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

<constant> OperationConfig :Object.<string, OpConf>

+ + +
+
+ +
+

Operation configuration objects.

+
+ + + +
Type:
+
    +
  • + +Object.<string, OpConf> + + + +
  • +
+ + + +
+ + + + + + + + + + + + + + + + + + + +
Author:
+
+
    +
  • <p>n1474335 [n1474335@gmail.com]</p>
  • +
+
+ + + + + + + + +
License:
+
+
    +
  • Apache-2.0
  • +
+
+ + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +

Methods

+ +
+ +
+
+

main()

+ + +
+
+ + +
+

Main function used to build the CyberChef web app.

+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +

Type Definitions

+ +
+ +
+
+

CatConf

+ + +
+
+ +
+

Type definition for a CatConf.

+
+ + + +
Type:
+
    +
  • + +Object + + + +
  • +
+ + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + + +

The display name for the category

ops + + +Array.<string> + + + + +

A list of the operations to be included in this category

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

OpConf

+ + +
+
+ +
+

Type definition for an OpConf.

+
+ + + +
Type:
+
    +
  • + +Object + + + +
  • +
+ + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
description + + +html + + + + + + + + +

A description of the operation with optional HTML tags

run + + +function + + + + + + + + +

The function which can be called the run the operation

input_type + + +string + + + + + + + + +
output_type + + +string + + + + + + + + +
highlight + + +function +| + +boolean + + + + + + + <optional>
+ + + +

A function to calculate the highlight offset, or true
if the offset does not change

highlight_reverse + + +function +| + +boolean + + + + + + + <optional>
+ + + +

A function to calculate the highlight offset
in reverse, or true if the offset does not change

flow_control + + +boolean + + + + + + + <optional>
+ + + +

True if the operation is for Flow Control

args + + +Array.<ArgConf> + + + + + + + <optional>
+ + + +

A list of configuration objects for the arguments

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ + + +
+
+

ArgConf

+ + +
+
+ +
+

Type definition for an ArgConf.

+
+ + + +
Type:
+
    +
  • + +Object + + + +
  • +
+ + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeArgumentDescription
name + + +string + + + + + + + + +

The display name of the argument

type + + +string + + + + + + + + +

The data type of the argument

value + + +* + + + + + + + + +
disable_args + + +Array.<number> + + + + + + + <optional>
+ + + +

A list of the indices of the operation's arguments which
should be toggled on or off when this argument is changed

disabled + + +boolean + + + + + + + <optional>
+ + + +

Whether or not this argument starts off disabled

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + +
+ +
+ + + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/img/glyphicons-halflings-white.png b/docs/img/glyphicons-halflings-white.png new file mode 100755 index 00000000..3bf6484a Binary files /dev/null and b/docs/img/glyphicons-halflings-white.png differ diff --git a/docs/img/glyphicons-halflings.png b/docs/img/glyphicons-halflings.png new file mode 100755 index 00000000..a9969993 Binary files /dev/null and b/docs/img/glyphicons-halflings.png differ diff --git a/docs/index.html b/docs/index.html new file mode 100755 index 00000000..1e7dbd69 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,322 @@ + + + + + + + CyberChef Index + + + + + + + + + + + + + +
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+

CyberChef

####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 creating hexdumps, simple encoding like XOR or Base64, more complex encryption like AES, DES and Blowfish, data compression and decompression, calculating hashes and checksums, IPv6 and X.509 parsing, 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 and the code has not been peer-reviewed for compliance with a formal specification.

+

Live demo

CyberChef is still under active development. As a result, it shouldn't be considered a finished product. There is still testing and bug fixing to do, new features to be added and additional documentation to write. Please contribute!

+

Cryptographic operations in CyberChef should not be relied upon to provide security in any situation. No guarantee is offered for their correctness.

+

A live demo can be found here - have fun!
Note: Use Chrome or Firefox, see the Browser Support section below for details.

+

How it works

There are four main areas in CyberChef:

+
    +
  1. The input box in the top right, where you can paste, type or drag the data you want to operate on.
  2. +
  3. The output box in the bottom right, where the outcome of the specified processing will be displayed.
  4. +
  5. The operations list on the far left, where you can find all the operations that CyberChef is capable of in categorised lists, or by searching.
  6. +
  7. The recipe area in the middle, where you drag the operations that you want to use and specify arguments and options.
  8. +
+

You can use as many operations as you like in simple or complex ways. Some examples are as follows:

+ +

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.
    • +
    +
  • +
  • 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).
    • +
    • If any bake takes longer than 200 milliseconds, auto bake will be switched off automatically to prevent further performance issues.
    • +
    +
  • +
  • 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.
    • +
    +
  • +
  • Save and load recipes
      +
    • If you come up with an awesome recipe that you know you’ll want to use again, just click save and add it to your local storage. It'll be waiting for you next time you visit CyberChef.
    • +
    • You can also copy a URL which includes your recipe and input which can be shared with others.
    • +
    +
  • +
  • Search
      +
    • If you know the name of the operation you want or a word associated with it, start typing it into the search field and any matching operations will immediately be shown.
    • +
    +
  • +
  • Highlighting +
  • +
  • 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 (note that files larger than about 500kb may cause your browser to hang or even crash due to the way that browsers handle large amounts of textual data).
    • +
    +
  • +
  • CyberChef is entirely client-side
      +
    • It should be noted that none of your input or recipe configuration 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 desktop.
    • +
    +
  • +
+

Browser support

CyberChef works well in modern versions of Google Chrome and Mozilla Firefox.

+

To aid in the efficient development of new features and operations, there has been no attempt to maintain support for any version of Microsoft Internet Explorer.

+

Microsoft Edge is currently unsupported, but if anyone would like to contribute compatibility fixes, they would be appreciated.

+

Contributing

An installation walkthrough, how-to guides for adding new operations, descriptions of the repository structure, available data types and coding conventions can all be found in the project wiki pages.

+
+
+ + + + + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html new file mode 100755 index 00000000..72426bc8 --- /dev/null +++ b/docs/namespaces.list.html @@ -0,0 +1,925 @@ + + + + + + + CyberChef Namespaces + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Namespaces

+
+ +
+ +

+ +

+ + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
Chef
+
+ +
Dish
+
+ +
Ingredient
+
+ +
Operation
+
+ +
Recipe
+
+ +
ControlsWaiter
+
+ +
HTMLApp
+
+ +
HTMLCategory
+
+ +
HTMLIngredient
+
+ +
HTMLOperation
+
+ +
HighlighterWaiter
+
+ +
InputWaiter
+
+ +
Manager
+
+ +
OperationsWaiter
+
+ +
OptionsWaiter
+
+ +
OutputWaiter
+
+ +
RecipeWaiter
+
+ +
SeasonalWaiter
+
+ +
WindowWaiter
+
+
+ + + + + +

Namespaces

+ +
+
FlowControl
+
+ +
Utils
+
+ +
Base
+
+ +
Base64
+
+ +
BitwiseOp
+
+ +
ByteRepr
+
+ +
CharEnc
+
+ +
Checksum
+
+ +
Cipher
+
+ +
Code
+
+ +
Compress
+
+ +
Convert
+
+ +
DateTime
+
+ +
Endian
+
+ +
Entropy
+
+ +
Extract
+
+ +
FileType
+
+ +
HTML
+
+ +
HTTP
+
+ +
Hash
+
+ +
Hexdump
+
+ +
IP
+
+ +
JS
+
+ +
MAC
+
+ +
Numberwang
+
+ +
OS
+
+ +
PublicKey
+
+ +
Punycode
+
+ +
QuotedPrintable
+
+ +
Rotate
+
+ +
SeqUtils
+
+ +
StrUtils
+
+ +
Tidy
+
+ +
URL_
+
+ +
UUID
+
+ +
Unicode
+
+
+ + + + + + + + + +

Events

+ +
+ +
+
+

appstart

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+

operationadd

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

operationremove

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

oplistcreate

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ + + +
+
+

statechange

+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ +
+ + + + + + + +
+ + + + + + + + + +
Listeners of This Event:
+ + + + + + + + +
+ +
+ +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/operations_Base.js.html b/docs/operations_Base.js.html new file mode 100755 index 00000000..a041c780 --- /dev/null +++ b/docs/operations_Base.js.html @@ -0,0 +1,283 @@ + + + + + + + CyberChef Source: operations/Base.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Base.js

+ +
+
+
/**
+ * Numerical base operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Base = {
+
+    /**
+     * @constant
+     * @default
+     */
+    DEFAULT_RADIX: 36,
+    
+    /**
+     * To Base operation.
+     *
+     * @param {number} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to: function(input, args) {
+        if (!input) {
+            throw ("Error: Input must be a number");
+        }
+        var radix = args[0] || Base.DEFAULT_RADIX;
+        if (radix < 2 || radix > 36) {
+            throw "Error: Radix argument must be between 2 and 36";
+        }
+        return input.toString(radix);
+    },
+    
+    
+    /**
+     * From Base operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {number}
+     */
+    run_from: function(input, args) {
+        var radix = args[0] || Base.DEFAULT_RADIX;
+        if (radix < 2 || radix > 36) {
+            throw "Error: Radix argument must be between 2 and 36";
+        }
+        return parseInt(input.replace(/\s/g, ""), radix);
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Base64.js.html b/docs/operations_Base64.js.html new file mode 100755 index 00000000..41a242c7 --- /dev/null +++ b/docs/operations_Base64.js.html @@ -0,0 +1,572 @@ + + + + + + + CyberChef Source: operations/Base64.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Base64.js

+ +
+
+
/**
+ * Base64 operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Base64 = {
+
+    /**
+     * @constant
+     * @default
+     */
+    ALPHABET: "A-Za-z0-9+/=",
+    /**
+     * @constant
+     * @default
+     */
+    ALPHABET_OPTIONS: [
+        {name: "Standard: A-Za-z0-9+/=", value: "A-Za-z0-9+/="},
+        {name: "URL safe: 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: 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+/="},
+    ],
+
+    /**
+     * To Base64 operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to: function(input, args) {
+        var alphabet = args[0] || Base64.ALPHABET;
+        return Utils.to_base64(input, alphabet);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_NON_ALPH_CHARS: true,
+    
+    /**
+     * From Base64 operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_from: function(input, args) {
+        var alphabet = args[0] || Base64.ALPHABET,
+            remove_non_alph_chars = args[1];
+        
+        return Utils.from_base64(input, alphabet, "byte_array", remove_non_alph_chars);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    BASE32_ALPHABET: "A-Z2-7=",
+    
+    /**
+     * To Base32 operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to_32: function(input, args) {
+        if (!input) return "";
+        
+        var alphabet = args[0] ?
+                Utils.expand_alph_range(args[0]).join("") : "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",
+            output = "",
+            chr1, chr2, chr3, chr4, chr5,
+            enc1, enc2, enc3, enc4, enc5, enc6, enc7, enc8,
+            i = 0;
+
+        while (i < input.length) {
+            chr1 = input[i++];
+            chr2 = input[i++];
+            chr3 = input[i++];
+            chr4 = input[i++];
+            chr5 = input[i++];
+
+            enc1 = chr1 >> 3;
+            enc2 = ((chr1 & 7) << 2) | (chr2 >> 6);
+            enc3 = (chr2 >> 1) & 31;
+            enc4 = ((chr2 & 1) << 4) | (chr3 >> 4);
+            enc5 = ((chr3 & 15) << 1) | (chr4 >> 7);
+            enc6 = (chr4 >> 2) & 63;
+            enc7 = ((chr4 & 3) << 3) | (chr5 >> 5);
+            enc8 = chr5 & 31;
+
+            if (isNaN(chr2)) {
+                enc3 = enc4 = enc5 = enc6 = enc7 = enc8 = 32;
+            } else if (isNaN(chr3)) {
+                enc5 = enc6 = enc7 = enc8 = 32;
+            } else if (isNaN(chr4)) {
+                enc6 = enc7 = enc8 = 32;
+            } else if (isNaN(chr5)) {
+                enc8 = 32;
+            }
+            
+            output += alphabet.charAt(enc1) + alphabet.charAt(enc2) + alphabet.charAt(enc3) +
+                alphabet.charAt(enc4) + alphabet.charAt(enc5) + alphabet.charAt(enc6) +
+                alphabet.charAt(enc7) + alphabet.charAt(enc8);
+        }
+        
+        return output;
+    },
+    
+    
+    /**
+     * From Base32 operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_from_32: function(input, args) {
+        if (!input) return [];
+        
+        var alphabet = args[0] ?
+                Utils.expand_alph_range(args[0]).join("") : "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",
+            remove_non_alph_chars = args[0];
+        
+        var output = [],
+            chr1, chr2, chr3, chr4, chr5,
+            enc1, enc2, enc3, enc4, enc5, enc6, enc7, enc8,
+            i = 0;
+        
+        if (remove_non_alph_chars) {
+            var re = new RegExp("[^" + alphabet.replace(/[\]\\\-^]/g, "\\$&") + "]", "g");
+            input = input.replace(re, "");
+        }
+
+        while (i < input.length) {
+            enc1 = alphabet.indexOf(input.charAt(i++));
+            enc2 = alphabet.indexOf(input.charAt(i++) || "=");
+            enc3 = alphabet.indexOf(input.charAt(i++) || "=");
+            enc4 = alphabet.indexOf(input.charAt(i++) || "=");
+            enc5 = alphabet.indexOf(input.charAt(i++) || "=");
+            enc6 = alphabet.indexOf(input.charAt(i++) || "=");
+            enc7 = alphabet.indexOf(input.charAt(i++) || "=");
+            enc8 = alphabet.indexOf(input.charAt(i++) || "=");
+
+            chr1 = (enc1 << 3) | (enc2 >> 2);
+            chr2 = ((enc2 & 3) << 6) | (enc3 << 1) | (enc4 >> 4);
+            chr3 = ((enc4 & 15) << 4) | (enc5 >> 1);
+            chr4 = ((enc5 & 1) << 7) | (enc6 << 2) | (enc7 >> 3);
+            chr5 = ((enc7 & 7) << 5) | enc8;
+
+            output.push(chr1);
+            if (enc2 & 3 !== 0 || enc3 !== 32) output.push(chr2);
+            if (enc4 & 15 !== 0 || enc5 !== 32) output.push(chr3);
+            if (enc5 & 1 !== 0 || enc6 !== 32) output.push(chr4);
+            if (enc7 & 7 !== 0 || enc8 !== 32) output.push(chr5);
+        }
+        
+        return output;
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    SHOW_IN_BINARY: false,
+    /**
+     * @constant
+     * @default
+     */
+    OFFSETS_SHOW_VARIABLE: true,
+    
+    /**
+     * Show Base64 offsets operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {html}
+     */
+    run_offsets: function(input, args) {
+        var alphabet = args[0] || Base64.ALPHABET,
+            show_variable = args[1],
+            offset0 = Utils.to_base64(input, alphabet),
+            offset1 = Utils.to_base64([0].concat(input), alphabet),
+            offset2 = Utils.to_base64([0, 0].concat(input), alphabet),
+            len0 = offset0.indexOf("="),
+            len1 = offset1.indexOf("="),
+            len2 = offset2.indexOf("="),
+            script = "<script type='application/javascript'>$('[data-toggle=\"tooltip\"]').tooltip()</script>",
+            static_section = "",
+            padding = "";
+        
+        if (input.length < 1) {
+            return "Please enter a string.";
+        }
+        
+        // Highlight offset 0
+        if (len0 % 4 == 2) {
+            static_section = offset0.slice(0, -3);
+            offset0 = "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64(static_section, alphabet).slice(0, -2) + "'>" +
+                static_section + "</span>" +
+                "<span class='hlgreen'>" + offset0.substr(offset0.length - 3, 1) + "</span>" +
+                "<span class='hlred'>" + offset0.substr(offset0.length - 2) + "</span>";
+        } else if (len0 % 4 == 3) {
+            static_section = offset0.slice(0, -2);
+            offset0 = "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64(static_section, alphabet).slice(0, -1) + "'>" +
+                static_section + "</span>" +
+                "<span class='hlgreen'>" + offset0.substr(offset0.length - 2, 1) + "</span>" +
+                "<span class='hlred'>" + offset0.substr(offset0.length - 1) + "</span>";
+        } else {
+            static_section = offset0;
+            offset0 = "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64(static_section, alphabet) + "'>" +
+                static_section + "</span>";
+        }
+        
+        if (!show_variable) {
+            offset0 = static_section;
+        }
+        
+        
+        // Highlight offset 1
+        padding = "<span class='hlred'>" + offset1.substr(0, 1) + "</span>" +
+            "<span class='hlgreen'>" + offset1.substr(1, 1) + "</span>";
+        offset1 = offset1.substr(2);
+        if (len1 % 4 == 2) {
+            static_section = offset1.slice(0, -3);
+            offset1 = padding + "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64("AA" + static_section, alphabet).slice(1, -2) + "'>" +
+                static_section + "</span>" +
+                "<span class='hlgreen'>" + offset1.substr(offset1.length - 3, 1) + "</span>" +
+                "<span class='hlred'>" + offset1.substr(offset1.length - 2) + "</span>";
+        } else if (len1 % 4 == 3) {
+            static_section = offset1.slice(0, -2);
+             offset1 = padding + "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64("AA" + static_section, alphabet).slice(1, -1) + "'>" +
+                static_section + "</span>" +
+                "<span class='hlgreen'>" + offset1.substr(offset1.length - 2, 1) + "</span>" +
+                "<span class='hlred'>" + offset1.substr(offset1.length - 1) + "</span>";
+        } else {
+            static_section = offset1;
+            offset1 = padding +  "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64("AA" + static_section, alphabet).slice(1) + "'>" +
+                static_section + "</span>";
+        }
+        
+        if (!show_variable) {
+            offset1 = static_section;
+        }
+        
+        // Highlight offset 2
+        padding = "<span class='hlred'>" + offset2.substr(0, 2) + "</span>" +
+            "<span class='hlgreen'>" + offset2.substr(2, 1) + "</span>";
+        offset2 = offset2.substr(3);
+        if (len2 % 4 == 2) {
+            static_section = offset2.slice(0, -3);
+            offset2 = padding + "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64("AAA" + static_section, alphabet).slice(2, -2) + "'>" +
+                static_section + "</span>" +
+                "<span class='hlgreen'>" + offset2.substr(offset2.length - 3, 1) + "</span>" +
+                "<span class='hlred'>" + offset2.substr(offset2.length - 2) + "</span>";
+        } else if (len2 % 4 == 3) {
+            static_section = offset2.slice(0, -2);
+            offset2 = padding + "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64("AAA" + static_section, alphabet).slice(2, -2) + "'>" +
+                static_section + "</span>" +
+                "<span class='hlgreen'>" + offset2.substr(offset2.length - 2, 1) + "</span>" +
+                "<span class='hlred'>" + offset2.substr(offset2.length - 1) + "</span>";
+        } else {
+            static_section = offset2;
+            offset2 = padding +  "<span data-toggle='tooltip' data-placement='top' title='" + 
+                Utils.from_base64("AAA" + static_section, alphabet).slice(2) + "'>" +
+                static_section + "</span>";
+        }
+        
+        if (!show_variable) {
+            offset2 = static_section;
+        }
+        
+        return (show_variable ? "Characters highlighted in <span class='hlgreen'>green</span> could change if the input is surrounded by more data." +
+            "\nCharacters highlighted in <span class='hlred'>red</span> are for padding purposes only." +
+            "\nUnhighlighted characters are <span data-toggle='tooltip' data-placement='top' title='Tooltip on left'>static</span>." +
+            "\nHover over the static sections to see what they decode to on their own.\n" +
+            "\nOffset 0: " + offset0 +
+            "\nOffset 1: " + offset1 +
+            "\nOffset 2: " + offset2 +
+            script :
+            offset0 + "\n" + offset1 + "\n" + offset2);
+    },
+    
+    
+    /**
+     * Highlight to Base64
+     *
+     * @param {Object[]} pos
+     * @param {number} pos[].start
+     * @param {number} pos[].end
+     * @param {Object[]} args
+     * @returns {Object[]} pos
+     */
+    highlight_to: function(pos, args) {
+        pos[0].start = Math.floor(pos[0].start / 3 * 4);
+        pos[0].end = Math.ceil(pos[0].end / 3 * 4);
+        return pos;
+    },
+    
+    /**
+     * Highlight from Base64
+     *
+     * @param {Object[]} pos
+     * @param {number} pos[].start
+     * @param {number} pos[].end
+     * @param {Object[]} args
+     * @returns {Object[]} pos
+     */
+    highlight_from: function(pos, args) {
+        pos[0].start = Math.ceil(pos[0].start / 4 * 3);
+        pos[0].end = Math.floor(pos[0].end / 4 * 3);
+        return pos;
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_BitwiseOp.js.html b/docs/operations_BitwiseOp.js.html new file mode 100755 index 00000000..834325bb --- /dev/null +++ b/docs/operations_BitwiseOp.js.html @@ -0,0 +1,530 @@ + + + + + + + CyberChef Source: operations/BitwiseOp.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/BitwiseOp.js

+ +
+
+
/* globals CryptoJS */
+
+/**
+ * Bitwise operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var BitwiseOp = {
+
+    /**
+     * Runs bitwise operations across the input data.
+     *
+     * @private
+     * @param {byte_array} input
+     * @param {byte_array} key
+     * @param {function} func - The bitwise calculation to carry out
+     * @param {boolean} null_preserving
+     * @param {boolean} differential
+     * @returns {byte_array}
+     */
+    _bit_op: function (input, key, func, null_preserving, differential) {
+        if (!key || !key.length) key = [0];
+        var result = [],
+            x = null,
+            k = null,
+            o = null;
+        
+        for (var i = 0; i < input.length; i++) {
+            k = key[i % key.length];
+            o = input[i];
+            x = null_preserving && (o === 0 || o == k) ? o : func(o, k);
+            result.push(x);
+            if (differential && !(null_preserving && (o === 0 || o == k))) {
+                key[i % key.length] = x;
+            }
+        }
+        
+        return result;
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    XOR_PRESERVE_NULLS: false,
+    /**
+     * @constant
+     * @default
+     */
+    XOR_DIFFERENTIAL: false,
+    /**
+     * @constant
+     * @default
+     */
+    KEY_FORMAT: ["Hex", "Base64", "UTF8", "UTF16", "UTF16LE", "UTF16BE", "Latin1"],
+    
+    /**
+     * XOR operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_xor: function (input, args) {
+        var key = Utils.format[args[0].option].parse(args[0].string || ""),
+            null_preserving = args[1],
+            differential = args[2];
+        
+        key = Utils.word_array_to_byte_array(key);
+            
+        return BitwiseOp._bit_op(input, key, BitwiseOp._xor, null_preserving, differential);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    XOR_BRUTE_KEY_LENGTH: ["1", "2"],
+    /**
+     * @constant
+     * @default
+     */
+    XOR_BRUTE_SAMPLE_LENGTH: 100,
+    /**
+     * @constant
+     * @default
+     */
+    XOR_BRUTE_SAMPLE_OFFSET: 0,
+    /**
+     * @constant
+     * @default
+     */
+    XOR_BRUTE_PRINT_KEY: true,
+    /**
+     * @constant
+     * @default
+     */
+    XOR_BRUTE_OUTPUT_HEX: false,
+    
+    /**
+     * XOR Brute Force operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_xor_brute: function (input, args) {
+        var key_length = parseInt(args[0], 10),
+            sample_length = args[1],
+            sample_offset = args[2],
+            null_preserving = args[3],
+            differential = args[4],
+            crib = args[5],
+            print_key = args[6],
+            output_hex = args[7],
+            regex;
+        
+        var output = "",
+            result,
+            result_utf8;
+        
+        input = input.slice(sample_offset, sample_offset + sample_length);
+        
+        if (crib !== "") {
+            regex = new RegExp(crib, "im");
+        }
+        
+        
+        for (var key = 1, l = Math.pow(256, key_length); key < l; key++) {
+            result = BitwiseOp._bit_op(input, Utils.hex_to_byte_array(key.toString(16)), BitwiseOp._xor, null_preserving, differential);
+            result_utf8 = Utils.byte_array_to_utf8(result);
+            if (crib !== "" && result_utf8.search(regex) === -1) continue;
+            if (print_key) output += "Key = " + Utils.hex(key, (2*key_length)) + ": ";
+            if (output_hex)
+                output += Utils.byte_array_to_hex(result) + "\n";
+            else
+                output += Utils.printable(result_utf8, false) + "\n";
+            if (print_key) output += "\n";
+        }
+        return output;
+    },
+    
+    
+    /**
+     * NOT operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_not: function (input, args) {
+        return BitwiseOp._bit_op(input, null, BitwiseOp._not);
+    },
+    
+    
+    /**
+     * AND operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_and: function (input, args) {
+        var key = Utils.format[args[0].option].parse(args[0].string || "");
+        key = Utils.word_array_to_byte_array(key);
+        
+        return BitwiseOp._bit_op(input, key, BitwiseOp._and);
+    },
+    
+    
+    /**
+     * OR operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_or: function (input, args) {
+        var key = Utils.format[args[0].option].parse(args[0].string || "");
+        key = Utils.word_array_to_byte_array(key);
+        
+        return BitwiseOp._bit_op(input, key, BitwiseOp._or);
+    },
+    
+    
+    /**
+     * ADD operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_add: function (input, args) {
+        var key = Utils.format[args[0].option].parse(args[0].string || "");
+        key = Utils.word_array_to_byte_array(key);
+        
+        return BitwiseOp._bit_op(input, key, BitwiseOp._add);
+    },
+    
+    
+    /**
+     * SUB operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_sub: function (input, args) {
+        var key = Utils.format[args[0].option].parse(args[0].string || "");
+        key = Utils.word_array_to_byte_array(key);
+        
+        return BitwiseOp._bit_op(input, key, BitwiseOp._sub);
+    },
+    
+    
+    /**
+     * XOR bitwise calculation.
+     *
+     * @private
+     * @param {number} operand
+     * @param {number} key
+     * @returns {number}
+     */
+    _xor: function (operand, key) {
+        return operand ^ key;
+    },
+    
+    
+    /**
+     * NOT bitwise calculation.
+     *
+     * @private
+     * @param {number} operand
+     * @returns {number}
+     */
+    _not: function (operand, _) {
+        return ~operand & 0xff;
+    },
+    
+    
+    /**
+     * AND bitwise calculation.
+     *
+     * @private
+     * @param {number} operand
+     * @param {number} key
+     * @returns {number}
+     */
+    _and: function (operand, key) {
+        return operand & key;
+    },
+    
+    
+    /**
+     * OR bitwise calculation.
+     *
+     * @private
+     * @param {number} operand
+     * @param {number} key
+     * @returns {number}
+     */
+    _or: function (operand, key) {
+        return operand | key;
+    },
+
+    
+    /**
+     * ADD bitwise calculation.
+     *
+     * @private
+     * @param {number} operand
+     * @param {number} key
+     * @returns {number}
+     */
+    _add: function (operand, key) {
+        return (operand + key) % 256;
+    },
+
+    
+    /**
+     * SUB bitwise calculation.
+     *
+     * @private
+     * @param {number} operand
+     * @param {number} key
+     * @returns {number}
+     */
+    _sub: function (operand, key) {
+        var result = operand - key;
+        return (result < 0) ? 256 + result : result;
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/operations/ByteRepr.js b/docs/operations_ByteRepr.js.html similarity index 50% rename from src/js/operations/ByteRepr.js rename to docs/operations_ByteRepr.js.html index 13a4b8a7..d66299d2 100755 --- a/src/js/operations/ByteRepr.js +++ b/docs/operations_ByteRepr.js.html @@ -1,4 +1,98 @@ -/* globals app */ + + + + + + + CyberChef Source: operations/ByteRepr.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/ByteRepr.js

+ +
+
+
/* globals app */
 
 /**
  * Byte representation operations.
@@ -73,18 +167,18 @@ var ByteRepr = {
             padding = 2,
             ordinal;
             
-        if (base < 2 || base > 36) {
+        if (base < 2 || base > 36) {
             throw "Error: Base argument must be between 2 and 36";
         }
             
-        for (var i = 0; i < input.length; i++) {
+        for (var i = 0; i < input.length; i++) {
             ordinal = Utils.ord(input[i]);
             
             if (base == 16) {
-                if (ordinal < 256) padding = 2;
-                else if (ordinal < 65536) padding = 4;
-                else if (ordinal < 16777216) padding = 6;
-                else if (ordinal < 4294967296) padding = 8;
+                if (ordinal < 256) padding = 2;
+                else if (ordinal < 65536) padding = 4;
+                else if (ordinal < 16777216) padding = 6;
+                else if (ordinal < 4294967296) padding = 8;
                 else padding = 2;
                 
                 if (padding > 2) app.options.attempt_highlight = false;
@@ -113,7 +207,7 @@ var ByteRepr = {
             bites = input.split(delim),
             i = 0;
             
-        if (base < 2 || base > 36) {
+        if (base < 2 || base > 36) {
             throw "Error: Base argument must be between 2 and 36";
         }
         
@@ -123,15 +217,15 @@ var ByteRepr = {
         
         // Split into groups of 2 if the whole string is concatenated and 
         // too long to be a single character
-        if (bites.length == 1 && input.length > 17) {
+        if (bites.length == 1 && input.length > 17) {
             bites = [];
-            for (i = 0; i < input.length; i += 2) {
+            for (i = 0; i < input.length; i += 2) {
                 bites.push(input.slice(i, i+2));
             }
         }
         
         var latin1 = "";
-        for (i = 0; i < bites.length; i++) {
+        for (i = 0; i < bites.length; i++) {
             latin1 += Utils.chr(parseInt(bites[i], base));
         }
         return Utils.str_to_byte_array(latin1);
@@ -217,7 +311,7 @@ var ByteRepr = {
         if (byte_str[byte_str.length-1] === "")
             byte_str = byte_str.slice(0, byte_str.length-1);
         
-        for (var i = 0; i < byte_str.length; i++) {
+        for (var i = 0; i < byte_str.length; i++) {
             output[i] = parseInt(byte_str[i]);
         }
         return output;
@@ -236,7 +330,7 @@ var ByteRepr = {
             output = "",
             padding = 8;
             
-        for (var i = 0; i < input.length; i++) {
+        for (var i = 0; i < input.length; i++) {
             output += Utils.pad(input[i].toString(2), padding) + delim;
         }
         
@@ -263,7 +357,7 @@ var ByteRepr = {
         
         var output = [];
         var byte_len = 8;
-        for (var i = 0; i < input.length; i += byte_len) {
+        for (var i = 0; i < input.length; i += byte_len) {
             output.push(parseInt(input.substr(i, byte_len), 2));
         }
         return output;
@@ -335,9 +429,9 @@ var ByteRepr = {
             in_hex = false,
             convert_spaces = convert == "Only special chars including spaces",
             b;
-        for (var i = 0; i < input.length; i++) {
+        for (var i = 0; i < input.length; i++) {
             b = input[i];
-            if ((b == 32 && convert_spaces) || (b < 48 && b != 32) || (b > 57 && b < 65) || (b > 90 && b < 97) || b > 122) {
+            if ((b == 32 && convert_spaces) || (b < 48 && b != 32) || (b > 57 && b < 65) || (b > 90 && b < 97) || b > 122) {
                 if (!in_hex) {
                     output += "|";
                     in_hex = true;
@@ -368,27 +462,164 @@ var ByteRepr = {
         var output = [], m, i = 0;
         while (!!(m = regex.exec(input))) {
             // Add up to match
-            for (; i < m.index;)
+            for (; i < m.index;)
                 output.push(Utils.ord(input[i++]));
             
             // Add match
             var bytes = Utils.from_hex(m[1]);
             if (bytes) {
-                for (var a = 0; a < bytes.length;)
+                for (var a = 0; a < bytes.length;)
                     output.push(bytes[a++]);
             } else {
                 // Not valid hex, print as normal
-                for (; i < regex.lastIndex;)
+                for (; i < regex.lastIndex;)
                     output.push(Utils.ord(input[i++]));
             }
             
             i = regex.lastIndex;
         }
         // Add all after final match
-        for (; i < input.length;)
+        for (; i < input.length;)
             output.push(Utils.ord(input[i++]));
         
         return output;
     },
 
 };
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_CharEnc.js.html b/docs/operations_CharEnc.js.html new file mode 100755 index 00000000..f797177a --- /dev/null +++ b/docs/operations_CharEnc.js.html @@ -0,0 +1,277 @@ + + + + + + + CyberChef Source: operations/CharEnc.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/CharEnc.js

+ +
+
+
/* globals CryptoJS */
+
+/**
+ * Character encoding operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var CharEnc = {
+
+    /**
+     * @constant
+     * @default
+     */
+    IO_FORMAT: ["UTF8", "UTF16", "UTF16LE", "UTF16BE", "Latin1", "Windows-1251", "Hex", "Base64"],
+    
+    /**
+     * Text encoding operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run: function(input, args) {
+        var input_format = args[0],
+            output_format = args[1];
+            
+        if (input_format == "Windows-1251") {
+            input = Utils.win1251_to_unicode(input);
+            input = CryptoJS.enc.Utf8.parse(input);
+        } else {
+            input = Utils.format[input_format].parse(input);
+        }
+        
+        if (output_format == "Windows-1251") {
+            input = CryptoJS.enc.Utf8.stringify(input);
+            return Utils.unicode_to_win1251(input);
+        } else {
+            return Utils.format[output_format].stringify(input);
+        }
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Checksum.js.html b/docs/operations_Checksum.js.html new file mode 100755 index 00000000..495298fc --- /dev/null +++ b/docs/operations_Checksum.js.html @@ -0,0 +1,361 @@ + + + + + + + CyberChef Source: operations/Checksum.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Checksum.js

+ +
+
+
/**
+ * Checksum operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Checksum = {
+
+    /**
+     * Fletcher-16 Checksum operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_fletcher16: function(input, args) {
+        var a = 0,
+            b = 0;
+        
+        for (var i = 0; i < input.length; i++) {
+            a = (a + input[i]) % 0xff;
+            b = (b + a) % 0xff;
+        }
+        
+        return Utils.hex(((b << 8) | a) >>> 0, 4);
+    },
+    
+    
+    /**
+     * Adler-32 Checksum operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_adler32: function(input, args) {
+        var MOD_ADLER = 65521,
+            a = 1,
+            b = 0;
+        
+        for (var i = 0; i < input.length; i++) {
+            a += input[i];
+            b += a;
+        }
+        
+        a %= MOD_ADLER;
+        b %= MOD_ADLER;
+        
+        return Utils.hex(((b << 16) | a) >>> 0, 8);
+    },
+    
+    
+    /**
+     * CRC-32 Checksum operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_crc32: function(input, args) {
+        var crc_table = window.crc_table || (window.crc_table = Checksum._gen_crc_table()),
+            crc = 0 ^ (-1);
+        
+        for (var i = 0; i < input.length; i++) {
+            crc = (crc >>> 8) ^ crc_table[(crc ^ input[i]) & 0xff];
+        }
+        
+        return Utils.hex((crc ^ (-1)) >>> 0);
+    },
+    
+    
+    /**
+     * TCP/IP Checksum operation.
+     *
+     * @author GCHQ Contributor [1]
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     *
+     * @example
+     * // returns '3f2c'
+     * Checksum.run_tcp_ip([0x45,0x00,0x00,0x87,0xa3,0x1b,0x40,0x00,0x40,0x06,
+     *                      0x00,0x00,0xac,0x11,0x00,0x04,0xac,0x11,0x00,0x03])
+     *
+     * // returns 'a249'
+     * Checksum.run_tcp_ip([0x45,0x00,0x01,0x11,0x3f,0x74,0x40,0x00,0x40,0x06,
+     *                      0x00,0x00,0xac,0x11,0x00,0x03,0xac,0x11,0x00,0x04])
+     */
+    run_tcp_ip: function(input, args) {
+        var csum = 0;
+        
+        for (var i = 0; i < input.length; i++) {
+            if(i % 2 === 0) {
+                csum += (input[i] << 8);
+            } else {
+                csum += input[i];
+            }
+        }
+
+        csum = (csum >> 16) + (csum & 0xffff);
+
+        return Utils.hex(0xffff - csum);
+    },
+    
+    
+    /**
+     * Generates a CRC table for use with CRC checksums.
+     *
+     * @private
+     * @returns {array}
+     */
+    _gen_crc_table: function() {
+        var c,
+            crc_table = [];
+        
+        for (var n = 0; n < 256; n++) {
+            c = n;
+            for (var k = 0; k < 8; k++) {
+                c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
+            }
+            crc_table[n] = c;
+        }
+        
+        return crc_table;
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/operations/Cipher.js b/docs/operations_Cipher.js.html similarity index 58% rename from src/js/operations/Cipher.js rename to docs/operations_Cipher.js.html index 94193546..8f4bb854 100755 --- a/src/js/operations/Cipher.js +++ b/docs/operations_Cipher.js.html @@ -1,4 +1,98 @@ -/* globals CryptoJS, blowfish */ + + + + + + + CyberChef Source: operations/Cipher.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Cipher.js

+ +
+
+
/* globals CryptoJS, blowfish */
 
 /**
  * Cipher operations.
@@ -427,3 +521,140 @@ CryptoJS.kdf.OpenSSL.execute = function (password, keySize, ivSize, salt) {
     // Return params
     return CryptoJS.lib.CipherParams.create({ key: key, iv: iv, salt: salt });
 };
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Code.js.html b/docs/operations_Code.js.html new file mode 100755 index 00000000..e1159c94 --- /dev/null +++ b/docs/operations_Code.js.html @@ -0,0 +1,536 @@ + + + + + + + CyberChef Source: operations/Code.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Code.js

+ +
+
+
/* globals prettyPrintOne, vkbeautify */
+
+/**
+ * Code operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Code = {
+    
+    /**
+     * @constant
+     * @default
+     */
+    LANGUAGES: ["default-code", "default-markup", "bash", "bsh", "c", "cc", "coffee", "cpp", "cs", "csh", "cv", "cxx", "cyc", "htm", "html", "in.tag", "java", "javascript", "js", "json", "m", "mxml", "perl", "pl", "pm", "py", "python", "rb", "rc", "rs", "ruby", "rust", "sh", "uq.val", "xhtml", "xml", "xsl"],
+    /**
+     * @constant
+     * @default
+     */
+    LINE_NUMS: false,
+    
+    /**
+     * Syntax highlighter operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {html}
+     */
+    run_syntax_highlight: function(input, args) {
+        var language = args[0],
+            line_nums = args[1];
+        return "<code class='prettyprint'>" + prettyPrintOne(Utils.escape_html(input), language, line_nums) + "</code>";
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    BEAUTIFY_INDENT: "\\t",
+    
+    /**
+     * XML Beautify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_xml_beautify: function(input, args) {
+        var indent_str = args[0];
+        return vkbeautify.xml(input, indent_str);
+    },
+    
+    
+    /**
+     * JSON Beautify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_json_beautify: function(input, args) {
+        var indent_str = args[0];
+        return vkbeautify.json(input, indent_str);
+    },
+    
+    
+    /**
+     * CSS Beautify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_css_beautify: function(input, args) {
+        var indent_str = args[0];
+        return vkbeautify.css(input, indent_str);
+    },
+    
+    
+    /**
+     * SQL Beautify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_sql_beautify: function(input, args) {
+        var indent_str = args[0];
+        return vkbeautify.sql(input, indent_str);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    PRESERVE_COMMENTS: false,
+    
+    /**
+     * XML Minify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_xml_minify: function(input, args) {
+        var preserve_comments = args[0];
+        return vkbeautify.xmlmin(input, preserve_comments);
+    },
+    
+    
+    /**
+     * JSON Minify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_json_minify: function(input, args) {
+        return vkbeautify.jsonmin(input);
+    },
+    
+    
+    /**
+     * CSS Minify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_css_minify: function(input, args) {
+        var preserve_comments = args[0];
+        return vkbeautify.cssmin(input, preserve_comments);
+    },
+    
+    
+    /**
+     * SQL Minify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_sql_minify: function(input, args) {
+        return vkbeautify.sqlmin(input);
+    },
+    
+    
+    /**
+     * Generic Code Beautify operation.
+     *
+     * Yeeeaaah...
+     *
+     * I'm not proud of this code, but seriously, try writing a generic lexer and parser that
+     * correctly generates an AST for multiple different languages. I have tried, and I can tell
+     * you it's pretty much impossible.
+     * 
+     * This basically works. That'll have to be good enough. It's not meant to produce working code,
+     * just slightly more readable code.
+     * 
+     * Things that don't work:
+     *  - For loop formatting
+     *  - Do-While loop formatting
+     *  - Switch/Case indentation
+     *  - Bit shift operators
+     *
+     * @author n1474335 [n1474335@gmail.com]
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_generic_beautify: function(input, args) {
+        var code = input,
+            t = 0,
+            preserved_tokens = [],
+            m;
+        
+        // Remove strings
+        var sstrings = /'([^'\\]|\\.)*'/g;
+        while (!!(m = sstrings.exec(code))) {
+            code = preserve_token(code, m, t++);
+            sstrings.lastIndex = m.index;
+        }
+            
+        var dstrings = /"([^"\\]|\\.)*"/g;
+        while (!!(m = dstrings.exec(code))) {
+            code = preserve_token(code, m, t++);
+            dstrings.lastIndex = m.index;
+        }
+        
+        // Remove comments
+        var scomments = /\/\/[^\n\r]*/g;
+        while (!!(m = scomments.exec(code))) {
+            code = preserve_token(code, m, t++);
+            scomments.lastIndex = m.index;
+        }
+            
+        var mcomments = /\/\*[\s\S]*?\*\//gm;
+        while (!!(m = mcomments.exec(code))) {
+            code = preserve_token(code, m, t++);
+            mcomments.lastIndex = m.index;
+        }
+        
+        var hcomments = /(^|\n)#[^\n\r#]+/g;
+        while (!!(m = hcomments.exec(code))) {
+            code = preserve_token(code, m, t++);
+            hcomments.lastIndex = m.index;
+        }
+            
+        // Remove regexes
+        var regexes = /\/.*?[^\\]\/[gim]{0,3}/gi;
+        while (!!(m = regexes.exec(code))) {
+            code = preserve_token(code, m, t++);
+            regexes.lastIndex = m.index;
+        }
+        
+        // Create newlines after ;
+        code = code.replace(/;/g, ";\n");
+        
+        // Create newlines after { and around }
+        code = code.replace(/{/g, "{\n");
+        code = code.replace(/}/g, "\n}\n");
+        
+        // Remove carriage returns
+        code = code.replace(/\r/g, "");
+        
+        // Remove all indentation
+        code = code.replace(/^\s+/g, "");
+        code = code.replace(/\n\s+/g, "\n");
+        
+        // Remove trailing spaces
+        code = code.replace(/\s*$/g, "");
+        
+        // Remove newlines before {
+        code = code.replace(/\n{/g, "{");
+        
+        // Indent
+        var i = 0,
+            level = 0;
+        while (i < code.length) {
+            switch(code[i]) {
+                case "{":
+                    level++;
+                    break;
+                case "\n":
+                    if (i+1 >= code.length) break;
+                    
+                    if (code[i+1] == "}") level--;
+                    var indent = (level >= 0) ? Array(level*4+1).join(" ") : "";
+                        
+                    code = code.substring(0, i+1) + indent + code.substring(i+1);
+                    if (level > 0) i += level*4;
+                    break;
+            }
+            i++;
+        }
+
+        // Add strategic spaces
+        code = code.replace(/\s*([!<>=+-/*]?)=\s*/g, " $1= ");
+        code = code.replace(/\s*<([=]?)\s*/g, " <$1 ");
+        code = code.replace(/\s*>([=]?)\s*/g, " >$1 ");
+        code = code.replace(/([^+])\+([^+=])/g, "$1 + $2");
+        code = code.replace(/([^-])-([^-=])/g, "$1 - $2");
+        code = code.replace(/([^*])\*([^*=])/g, "$1 * $2");
+        code = code.replace(/([^/])\/([^/=])/g, "$1 / $2");
+        code = code.replace(/\s*,\s*/g, ", ");
+        code = code.replace(/\s*{/g, " {");
+        code = code.replace(/}\n/g, "}\n\n");
+        
+        // Just... don't look at this
+        code = code.replace(/(if|for|while|with|elif|elseif)\s*\(([^\n]*)\)\s*\n([^{])/gim, "$1 ($2)\n    $3");
+        code = code.replace(/(if|for|while|with|elif|elseif)\s*\(([^\n]*)\)([^{])/gim, "$1 ($2) $3");
+        code = code.replace(/else\s*\n([^{])/gim, "else\n    $1");
+        code = code.replace(/else\s+([^{])/gim, "else $1");
+        
+        // Remove strategic spaces
+        code = code.replace(/\s+;/g, ";");
+        code = code.replace(/\{\s+\}/g, "{}");
+        code = code.replace(/\[\s+\]/g, "[]");
+        code = code.replace(/}\s*(else|catch|except|finally|elif|elseif|else if)/gi, "} $1");
+        
+        
+        // Replace preserved tokens
+        var ptokens = /###preserved_token(\d+)###/g;
+        while (!!(m = ptokens.exec(code))) {
+            var ti = parseInt(m[1]);
+            code = code.substring(0, m.index) + preserved_tokens[ti] + code.substring(m.index + m[0].length);
+            ptokens.lastIndex = m.index;
+        }
+
+        return code;
+        
+        function preserve_token(str, match, t) {
+            preserved_tokens[t] = match[0];
+            return str.substring(0, match.index) +
+                "###preserved_token" + t + "###" +
+                str.substring(match.index + match[0].length);
+        }
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Compress.js.html b/docs/operations_Compress.js.html new file mode 100755 index 00000000..269e8ab4 --- /dev/null +++ b/docs/operations_Compress.js.html @@ -0,0 +1,580 @@ + + + + + + + CyberChef Source: operations/Compress.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Compress.js

+ +
+
+
/* globals Zlib, bzip2 */
+
+/**
+ * Compression operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Compress = {
+
+    /**
+     * @constant
+     * @default
+     */
+    COMPRESSION_TYPE: ["Dynamic Huffman Coding", "Fixed Huffman Coding", "None (Store)"],
+    /**
+     * @constant
+     * @default
+     */
+    INFLATE_BUFFER_TYPE: ["Adaptive", "Block"],
+    /**
+     * @constant
+     * @default
+     */
+    COMPRESSION_METHOD: ["Deflate", "None (Store)"],
+    /**
+     * @constant
+     * @default
+     */
+    OS: ["MSDOS", "Unix", "Macintosh"],
+    /**
+     * @constant
+     * @default
+     */
+    RAW_COMPRESSION_TYPE_LOOKUP: {
+        "Fixed Huffman Coding"   : Zlib.RawDeflate.CompressionType.FIXED,
+        "Dynamic Huffman Coding" : Zlib.RawDeflate.CompressionType.DYNAMIC,
+        "None (Store)"           : Zlib.RawDeflate.CompressionType.NONE,
+    },
+    
+    /**
+     * Raw Deflate operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_raw_deflate: function(input, args) {
+        var deflate = new Zlib.RawDeflate(input, {
+            compressionType: Compress.RAW_COMPRESSION_TYPE_LOOKUP[args[0]]
+        });
+        return Array.prototype.slice.call(deflate.compress());
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    INFLATE_INDEX: 0,
+    /**
+     * @constant
+     * @default
+     */
+    INFLATE_BUFFER_SIZE: 0,
+    /**
+     * @constant
+     * @default
+     */
+    INFLATE_RESIZE: false,
+    /**
+     * @constant
+     * @default
+     */
+    INFLATE_VERIFY: false,
+    /**
+     * @constant
+     * @default
+     */
+    RAW_BUFFER_TYPE_LOOKUP: {
+        "Adaptive"  : Zlib.RawInflate.BufferType.ADAPTIVE,
+        "Block"     : Zlib.RawInflate.BufferType.BLOCK,
+    },
+    
+    /**
+     * Raw Inflate operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_raw_inflate: function(input, args) {
+        // Deal with character encoding issues
+        input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input));
+        var inflate = new Zlib.RawInflate(input, {
+                index: args[0],
+                bufferSize: args[1],
+                bufferType: Compress.RAW_BUFFER_TYPE_LOOKUP[args[2]],
+                resize: args[3],
+                verify: args[4]
+            }),
+            result = Array.prototype.slice.call(inflate.decompress());
+        
+        // Raw Inflate somethimes messes up and returns nonsense like this:
+        // ]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]....]...
+        // e.g. Input data of [8b, 1d, dc, 44]
+        // Look for the first two square brackets:
+        if (result.length > 158 && result[0] == 93 && result[5] == 93) {
+            // If the first two square brackets are there, check that the others
+            // are also there. If they are, throw an error. If not, continue.
+            var valid = false;
+            for (var i = 0; i < 155; i += 5) {
+                if (result[i] != 93) {
+                    valid = true;
+                }
+            }
+            
+            if (!valid) {
+                throw "Error: Unable to inflate data";
+            }
+        }
+        // Trust me, this is the easiest way...
+        return result;
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    ZLIB_COMPRESSION_TYPE_LOOKUP: {
+        "Fixed Huffman Coding"   : Zlib.Deflate.CompressionType.FIXED,
+        "Dynamic Huffman Coding" : Zlib.Deflate.CompressionType.DYNAMIC,
+        "None (Store)"           : Zlib.Deflate.CompressionType.NONE,
+    },
+    
+    /**
+     * Zlib Deflate operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_zlib_deflate: function(input, args) {
+        var deflate = new Zlib.Deflate(input, {
+            compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[0]]
+        });
+        return Array.prototype.slice.call(deflate.compress());
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    ZLIB_BUFFER_TYPE_LOOKUP: {
+        "Adaptive" : Zlib.Inflate.BufferType.ADAPTIVE,
+        "Block"    : Zlib.Inflate.BufferType.BLOCK,
+    },
+    
+    /**
+     * Zlib Inflate operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_zlib_inflate: function(input, args) {
+        // Deal with character encoding issues
+        input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input));
+        var inflate = new Zlib.Inflate(input, {
+                index: args[0],
+                bufferSize: args[1],
+                bufferType: Compress.ZLIB_BUFFER_TYPE_LOOKUP[args[2]],
+                resize: args[3],
+                verify: args[4]
+            });
+        return Array.prototype.slice.call(inflate.decompress());
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    GZIP_CHECKSUM: false,
+    
+    /**
+     * Gzip operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_gzip: function(input, args) {
+        var filename = args[1],
+            comment = args[2],
+            options = {
+                deflateOptions: {
+                    compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[0]]
+                },
+                flags: {
+                    fhcrc: args[3]
+                }
+            };
+        
+        if (filename.length) {
+            options.flags.fname = true;
+            options.filename = filename;
+        }
+        if (comment.length) {
+            options.flags.fcommenct = true;
+            options.comment = comment;
+        }
+        
+        var gzip = new Zlib.Gzip(input, options);
+        return Array.prototype.slice.call(gzip.compress());
+    },
+    
+    
+    /**
+     * Gunzip operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_gunzip: function(input, args) {
+        // Deal with character encoding issues
+        input = Utils.str_to_byte_array(Utils.byte_array_to_utf8(input));
+        var gunzip = new Zlib.Gunzip(input);
+        return Array.prototype.slice.call(gunzip.decompress());
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    PKZIP_FILENAME: "file.txt",
+    /**
+     * @constant
+     * @default
+     */
+    ZIP_COMPRESSION_METHOD_LOOKUP: {
+        "Deflate"      : Zlib.Zip.CompressionMethod.DEFLATE,
+        "None (Store)" : Zlib.Zip.CompressionMethod.STORE
+    },
+    /**
+     * @constant
+     * @default
+     */
+    ZIP_OS_LOOKUP: {
+        "MSDOS"     : Zlib.Zip.OperatingSystem.MSDOS,
+        "Unix"      : Zlib.Zip.OperatingSystem.UNIX,
+        "Macintosh" : Zlib.Zip.OperatingSystem.MACINTOSH
+    },
+    
+    /**
+     * Zip operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_pkzip: function(input, args) {
+        var password = Utils.str_to_byte_array(args[2]),
+            options = {
+                filename: Utils.str_to_byte_array(args[0]),
+                comment: Utils.str_to_byte_array(args[1]),
+                compressionMethod: Compress.ZIP_COMPRESSION_METHOD_LOOKUP[args[3]],
+                os: Compress.ZIP_OS_LOOKUP[args[4]],
+                deflateOption: {
+                    compressionType: Compress.ZLIB_COMPRESSION_TYPE_LOOKUP[args[5]]
+                },
+            },
+            zip = new Zlib.Zip();
+            
+        if (password.length)
+            zip.setPassword(password);
+        zip.addFile(input, options);
+        return Array.prototype.slice.call(zip.compress());
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    PKUNZIP_VERIFY: false,
+    
+    /**
+     * Unzip operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_pkunzip: function(input, args) {
+        var options = {
+                password: Utils.str_to_byte_array(args[0]),
+                verify: args[1]
+            },
+            file = "",
+            unzip = new Zlib.Unzip(input, options),
+            filenames = unzip.getFilenames(),
+            output = "<div style='padding: 5px;'>" + filenames.length + " file(s) found</div>\n";
+            
+        output += "<div class='panel-group' id='zip-accordion' role='tablist' aria-multiselectable='true'>";
+        
+        window.uzip = unzip;
+        for (var i = 0; i < filenames.length; i++) {
+            file = Utils.byte_array_to_utf8(unzip.decompress(filenames[i]));
+            output += "<div class='panel panel-default'>" +
+                "<div class='panel-heading' role='tab' id='heading" + i + "'>" +
+                "<h4 class='panel-title'>" +
+                "<a class='collapsed' role='button' data-toggle='collapse' data-parent='#zip-accordion' href='#collapse" + i +
+                "' aria-expanded='true' aria-controls='collapse" + i + "'>" +
+                filenames[i] + "<span class='pull-right'>" + file.length.toLocaleString() + " bytes</span></a></h4></div>" +
+                "<div id='collapse" + i + "' class='panel-collapse collapse' role='tabpanel' aria-labelledby='heading" + i + "'>" +
+                "<div class='panel-body'>" +
+                Utils.escape_html(file) + "</div></div></div>";
+        }
+        
+        return output + "</div>";
+    },
+    
+    
+    /**
+     * Bzip2 Decompress operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_bzip2_decompress: function(input, args) {
+        var compressed = new Uint8Array(input),
+            bzip2_reader,
+            plain = "";
+            
+        bzip2_reader = bzip2.array(compressed);
+        plain = bzip2.simple(bzip2_reader);
+        return plain;
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/operations/Convert.js b/docs/operations_Convert.js.html similarity index 66% rename from src/js/operations/Convert.js rename to docs/operations_Convert.js.html index e47ca684..b34b09b8 100755 --- a/src/js/operations/Convert.js +++ b/docs/operations_Convert.js.html @@ -1,4 +1,98 @@ -/** + + + + + + + CyberChef Source: operations/Convert.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Convert.js

+ +
+
+
/**
  * Unit conversion operations.
  *
  * @author n1474335 [n1474335@gmail.com]
@@ -410,3 +504,140 @@ var Convert = {
     },
     
 };
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_DateTime.js.html b/docs/operations_DateTime.js.html new file mode 100755 index 00000000..d9604be7 --- /dev/null +++ b/docs/operations_DateTime.js.html @@ -0,0 +1,685 @@ + + + + + + + CyberChef Source: operations/DateTime.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/DateTime.js

+ +
+
+
/* globals moment */
+
+/**
+ * Date and time operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var DateTime = {
+    
+    /**
+     * @constant
+     * @default
+     */
+    UNITS: ["Seconds (s)", "Milliseconds (ms)", "Microseconds (μs)", "Nanoseconds (ns)"],
+    
+    /**
+     * From UNIX Timestamp operation.
+     *
+     * @param {number} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_from_unix_timestamp: function(input, args) {
+        var units = args[0],
+            d;
+        
+        input = parseFloat(input);
+        
+        if (units == "Seconds (s)") {
+            d = moment.unix(input);
+            return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
+        } else if (units == "Milliseconds (ms)") {
+            d = moment(input);
+            return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss.SSS") + " UTC";
+        } else if (units == "Microseconds (μs)") {
+            d = moment(input / 1000);
+            return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss.SSS") + " UTC";
+        } else if (units == "Nanoseconds (ns)") {
+            d = moment(input / 1000000);
+            return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss.SSS") + " UTC";
+        } else {
+            throw "Unrecognised unit";
+        }
+    },
+    
+    
+    /**
+     * To UNIX Timestamp operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {number}
+     */
+    run_to_unix_timestamp: function(input, args) {
+        var units = args[0],
+            d = moment(input);
+        
+        if (units == "Seconds (s)") {
+            return d.unix();
+        } else if (units == "Milliseconds (ms)") {
+            return d.valueOf();
+        } else if (units == "Microseconds (μs)") {
+            return d.valueOf() * 1000;
+        } else if (units == "Nanoseconds (ns)") {
+            return d.valueOf() * 1000000;
+        } else {
+            throw "Unrecognised unit";
+        }
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    DATETIME_FORMATS: [
+        {
+            name: "Standard date and time",
+            value: "DD/MM/YYYY HH:mm:ss"
+        },
+        {
+            name: "American-style date and time",
+            value: "MM/DD/YYYY HH:mm:ss"
+        },
+        {
+            name: "International date and time",
+            value: "YYYY-MM-DD HH:mm:ss"
+        },
+        {
+            name: "Verbose date and time",
+            value: "dddd Do MMMM YYYY HH:mm:ss Z z"
+        },
+        {
+            name: "UNIX timestamp (seconds)",
+            value: "X"
+        },
+        {
+            name: "UNIX timestamp offset (milliseconds)",
+            value: "x"
+        },
+        {
+            name: "Automatic",
+            value: ""
+        },
+    ],
+    /**
+     * @constant
+     * @default
+     */
+    INPUT_FORMAT_STRING: "DD/MM/YYYY HH:mm:ss",
+    /**
+     * @constant
+     * @default
+     */
+    OUTPUT_FORMAT_STRING: "dddd Do MMMM YYYY HH:mm:ss Z z",
+    /**
+     * @constant
+     * @default
+     */
+    TIMEZONES: ["UTC"].concat(moment.tz.names()),
+    
+    /**
+     * Translate DateTime Format operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {html}
+     */
+    run_translate_format: function(input, args) {
+        var input_format = args[1],
+            input_timezone = args[2],
+            output_format = args[3],
+            output_timezone = args[4],
+            date;
+
+        try {
+            date = moment.tz(input, input_format, input_timezone);
+            if (!date || date.format() == "Invalid date") throw Error;
+        } catch(err) {
+            return "Invalid format.\n\n" + DateTime.FORMAT_EXAMPLES;
+        }
+        
+        return date.tz(output_timezone).format(output_format);
+    },
+    
+    
+    /**
+     * Parse DateTime operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {html}
+     */
+    run_parse: function(input, args) {
+        var input_format = args[1],
+            input_timezone = args[2],
+            date,
+            output = "";
+            
+        try {
+            date = moment.tz(input, input_format, input_timezone);
+            if (!date || date.format() == "Invalid date") throw Error;
+        } catch(err) {
+            return "Invalid format.\n\n" + DateTime.FORMAT_EXAMPLES;
+        }
+        
+        output += "Date: " + date.format("dddd Do MMMM YYYY") +
+            "\nTime: " + date.format("HH:mm:ss") +
+            "\nPeriod: " + date.format("A") +
+            "\nTimezone: " + date.format("z") +
+            "\nUTC offset: " + date.format("ZZ") +
+            "\n\nDaylight Saving Time: " + date.isDST() +
+            "\nLeap year: " + date.isLeapYear() +
+            "\nDays in this month: " + date.daysInMonth() +
+            "\n\nDay of year: " + date.dayOfYear() +
+            "\nWeek number: " + date.weekYear() +
+            "\nQuarter: " + date.quarter();
+        
+        return output;
+    },
+    
+    
+    /**
+     * @constant
+     */
+    FORMAT_EXAMPLES: "Format string tokens:\n\n\
+<table class='table table-striped table-hover table-condensed table-bordered' style='font-family: sans-serif'>\
+  <thead>\
+    <tr>\
+      <th>Category</th>\
+      <th>Token</th>\
+      <th>Output</th>\
+    </tr>\
+  </thead>\
+  <tbody>\
+    <tr>\
+      <td><b>Month</b></td>\
+      <td>M</td>\
+      <td>1 2 ... 11 12</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>Mo</td>\
+      <td>1st 2nd ... 11th 12th</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>MM</td>\
+      <td>01 02 ... 11 12</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>MMM</td>\
+      <td>Jan Feb ... Nov Dec</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>MMMM</td>\
+      <td>January February ... November December</td>\
+    </tr>\
+    <tr>\
+      <td><b>Quarter</b></td>\
+      <td>Q</td>\
+      <td>1 2 3 4</td>\
+    </tr>\
+    <tr>\
+      <td><b>Day of Month</b></td>\
+      <td>D</td>\
+      <td>1 2 ... 30 31</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>Do</td>\
+      <td>1st 2nd ... 30th 31st</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>DD</td>\
+      <td>01 02 ... 30 31</td>\
+    </tr>\
+    <tr>\
+      <td><b>Day of Year</b></td>\
+      <td>DDD</td>\
+      <td>1 2 ... 364 365</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>DDDo</td>\
+      <td>1st 2nd ... 364th 365th</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>DDDD</td>\
+      <td>001 002 ... 364 365</td>\
+    </tr>\
+    <tr>\
+      <td><b>Day of Week</b></td>\
+      <td>d</td>\
+      <td>0 1 ... 5 6</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>do</td>\
+      <td>0th 1st ... 5th 6th</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>dd</td>\
+      <td>Su Mo ... Fr Sa</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>ddd</td>\
+      <td>Sun Mon ... Fri Sat</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>dddd</td>\
+      <td>Sunday Monday ... Friday Saturday</td>\
+    </tr>\
+    <tr>\
+      <td><b>Day of Week (Locale)</b></td>\
+      <td>e</td>\
+      <td>0 1 ... 5 6</td>\
+    </tr>\
+    <tr>\
+      <td><b>Day of Week (ISO)</b></td>\
+      <td>E</td>\
+      <td>1 2 ... 6 7</td>\
+    </tr>\
+    <tr>\
+      <td><b>Week of Year</b></td>\
+      <td>w</td>\
+      <td>1 2 ... 52 53</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>wo</td>\
+      <td>1st 2nd ... 52nd 53rd</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>ww</td>\
+      <td>01 02 ... 52 53</td>\
+    </tr>\
+    <tr>\
+      <td><b>Week of Year (ISO)</b></td>\
+      <td>W</td>\
+      <td>1 2 ... 52 53</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>Wo</td>\
+      <td>1st 2nd ... 52nd 53rd</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>WW</td>\
+      <td>01 02 ... 52 53</td>\
+    </tr>\
+    <tr>\
+      <td><b>Year</b></td>\
+      <td>YY</td>\
+      <td>70 71 ... 29 30</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>YYYY</td>\
+      <td>1970 1971 ... 2029 2030</td>\
+    </tr>\
+    <tr>\
+      <td><b>Week Year</b></td>\
+      <td>gg</td>\
+      <td>70 71 ... 29 30</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>gggg</td>\
+      <td>1970 1971 ... 2029 2030</td>\
+    </tr>\
+    <tr>\
+      <td><b>Week Year (ISO)</b></td>\
+      <td>GG</td>\
+      <td>70 71 ... 29 30</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>GGGG</td>\
+      <td>1970 1971 ... 2029 2030</td>\
+    </tr>\
+    <tr>\
+      <td><b>AM/PM</b></td>\
+      <td>A</td>\
+      <td>AM PM</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>a</td>\
+      <td>am pm</td>\
+    </tr>\
+    <tr>\
+      <td><b>Hour</b></td>\
+      <td>H</td>\
+      <td>0 1 ... 22 23</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>HH</td>\
+      <td>00 01 ... 22 23</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>h</td>\
+      <td>1 2 ... 11 12</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>hh</td>\
+      <td>01 02 ... 11 12</td>\
+    </tr>\
+    <tr>\
+      <td><b>Minute</b></td>\
+      <td>m</td>\
+      <td>0 1 ... 58 59</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>mm</td>\
+      <td>00 01 ... 58 59</td>\
+    </tr>\
+    <tr>\
+      <td><b>Second</b></td>\
+      <td>s</td>\
+      <td>0 1 ... 58 59</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>ss</td>\
+      <td>00 01 ... 58 59</td>\
+    </tr>\
+    <tr>\
+      <td><b>Fractional Second</b></td>\
+      <td>S</td>\
+      <td>0 1 ... 8 9</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>SS</td>\
+      <td>00 01 ... 98 99</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>SSS</td>\
+      <td>000 001 ... 998 999</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>SSSS ... SSSSSSSSS</td>\
+      <td>000[0..] 001[0..] ... 998[0..] 999[0..]</td>\
+    </tr>\
+    <tr>\
+      <td><b>Timezone</b></td>\
+      <td>z or zz</td>\
+      <td>EST CST ... MST PST</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>Z</td>\
+      <td>-07:00 -06:00 ... +06:00 +07:00</td>\
+    </tr>\
+    <tr>\
+      <td></td>\
+      <td>ZZ</td>\
+      <td>-0700 -0600 ... +0600 +0700</td>\
+    </tr>\
+    <tr>\
+      <td><b>Unix Timestamp</b></td>\
+      <td>X</td>\
+      <td>1360013296</td>\
+    </tr>\
+    <tr>\
+      <td><b>Unix Millisecond Timestamp</b></td>\
+      <td>x</td>\
+      <td>1360013296123</td>\
+    </tr>\
+  </tbody>\
+</table>",
+
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Endian.js.html b/docs/operations_Endian.js.html new file mode 100755 index 00000000..564605ae --- /dev/null +++ b/docs/operations_Endian.js.html @@ -0,0 +1,325 @@ + + + + + + + CyberChef Source: operations/Endian.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Endian.js

+ +
+
+
/**
+ * Endian operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Endian = {
+    
+    /**
+     * @constant
+     * @default
+     */
+    DATA_FORMAT: ["Hex", "Raw"],
+    /**
+     * @constant
+     * @default
+     */
+    WORD_LENGTH: 4,
+    /**
+     * @constant
+     * @default
+     */
+    PAD_INCOMPLETE_WORDS: true,
+    
+    /**
+     * Swap endianness operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_swap_endianness: function(input, args) {
+        var data_format = args[0],
+            word_length = args[1],
+            pad_incomplete_words = args[2],
+            data = [],
+            result = [],
+            words = [],
+            i = 0,
+            j = 0;
+            
+        if (word_length <= 0) {
+            return "Word length must be greater than 0";
+        }
+            
+        // Convert input to raw data based on specified data format
+        switch (data_format) {
+            case "Hex":
+                data = Utils.from_hex(input);
+                break;
+            case "Raw":
+                data = Utils.str_to_byte_array(input);
+                break;
+            default:
+                data = input;
+        }
+        
+        // Split up into words
+        for (i = 0; i < data.length; i += word_length) {
+            var word = data.slice(i, i + word_length);
+            
+            // Pad word if too short
+            if (pad_incomplete_words && word.length < word_length){
+                for (j = word.length; j < word_length; j++) {
+                    word.push(0);
+                }
+            }
+            
+            words.push(word);
+        }
+        
+        // Swap endianness and flatten
+        for (i = 0; i < words.length; i++) {
+            j = words[i].length;
+            while (j--) {
+                result.push(words[i][j]);
+            }
+        }
+        
+        // Convert data back to specified data format
+        switch (data_format) {
+            case "Hex":
+                return Utils.to_hex(result);
+            case "Raw":
+                return Utils.byte_array_to_utf8(result);
+            default:
+                return result;
+        }
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Entropy.js.html b/docs/operations_Entropy.js.html new file mode 100755 index 00000000..0af1b1f0 --- /dev/null +++ b/docs/operations_Entropy.js.html @@ -0,0 +1,397 @@ + + + + + + + CyberChef Source: operations/Entropy.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Entropy.js

+ +
+
+
/**
+ * Entropy operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Entropy = {
+    
+    /**
+     * @constant
+     * @default
+     */
+    CHUNK_SIZE: 1000,
+    
+    /**
+     * Entropy operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {html}
+     */
+    run_entropy: function(input, args) {
+        var chunk_size = args[0],
+            output = "",
+            entropy = Entropy._calc_entropy(input);
+        
+        output += "Shannon entropy: " + entropy + "\n" +
+            "<br><canvas id='chart-area'></canvas><br>\n" +
+            "- 0 represents no randomness (i.e. all the bytes in the data have the same value) whereas 8, the maximum, represents a completely random string.\n" +
+            "- Standard English text usually falls somewhere between 3.5 and 5.\n" +
+            "- Properly encrypted or compressed data of a reasonable length should have an entropy of over 7.5.\n\n" +
+            "The following results show the entropy of chunks of the input data. Chunks with particularly high entropy could suggest encrypted or compressed sections.\n\n" +
+            "<br><script>\
+                var canvas = document.getElementById('chart-area'),\
+                    parent_rect = canvas.parentNode.getBoundingClientRect(),\
+                    entropy = " + entropy + ",\
+                    height = parent_rect.height * 0.25;\
+                \
+                canvas.width = parent_rect.width * 0.95;\
+                canvas.height = height > 150 ? 150 : height;\
+                \
+                CanvasComponents.draw_scale_bar(canvas, entropy, 8, [\
+                    {\
+                        label: 'English text',\
+                        min: 3.5,\
+                        max: 5\
+                    },{\
+                        label: 'Encrypted/compressed',\
+                        min: 7.5,\
+                        max: 8\
+                    }\
+                ]);\
+            </script>";
+        
+        var chunk_entropy = 0;
+        if (chunk_size !== 0) {
+            for (var i = 0; i < input.length; i += chunk_size) {
+                chunk_entropy = Entropy._calc_entropy(input.slice(i, i+chunk_size));
+                output += "Bytes " + i + " to " + (i+chunk_size) + ": " + chunk_entropy + "\n";
+            }
+        } else {
+            output += "Chunk size cannot be 0.";
+        }
+        
+        return output;
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    FREQ_ZEROS: false,
+    
+    /**
+     * Frequency distribution operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {html}
+     */
+    run_freq_distrib: function (input, args) {
+        if (!input.length) return "No data";
+        
+        var distrib = new Array(256),
+            percentages = new Array(256),
+            len = input.length,
+            show_zeroes = args[0];
+        
+        // Initialise distrib to 0
+        for (var i = 0; i < 256; i++) {
+            distrib[i] = 0;
+        }
+        
+        // Count bytes
+        for (i = 0; i < len; i++) {
+            distrib[input[i]]++;
+        }
+        
+        // Calculate percentages
+        var repr = 0;
+        for (i = 0; i < 256; i++) {
+            if (distrib[i] > 0) repr++;
+            percentages[i] = distrib[i] / len * 100;
+        }
+        
+        // Print
+        var output = "<canvas id='chart-area'></canvas><br>" +
+            "Total data length: " + len +
+            "\nNumber of bytes represented: " + repr +
+            "\nNumber of bytes not represented: " + (256-repr) +
+            "\n\nByte   Percentage\n" +
+            "<script>\
+                var canvas = document.getElementById('chart-area'),\
+                    parent_rect = canvas.parentNode.getBoundingClientRect(),\
+                    scores = " + JSON.stringify(percentages) + ";\
+                \
+                canvas.width = parent_rect.width * 0.95;\
+                canvas.height = parent_rect.height * 0.9;\
+                \
+                CanvasComponents.draw_bar_chart(canvas, scores, 'Byte', 'Frequency %', 16, 6);\
+            </script>";
+                
+        for (i = 0; i < 256; i++) {
+            if (distrib[i] || show_zeroes) {
+                output += " " + Utils.hex(i, 2) + "    (" +
+                        Utils.pad_right(percentages[i].toFixed(2).replace(".00", "") + "%)", 8) +
+                        Array(Math.ceil(percentages[i])+1).join("|") + "\n";
+            }
+        }
+        
+        return output;
+    },
+    
+    
+    /**
+     * Calculates the Shannon entropy for a given chunk of data.
+     *
+     * @private
+     * @param {byte_array} data
+     * @returns {number}
+     */
+    _calc_entropy: function(data) {
+        var prob = [],
+            uniques = data.unique(),
+            str = Utils.byte_array_to_chars(data);
+            
+        for (var i = 0; i < uniques.length; i++) {
+            prob.push(str.count(Utils.chr(uniques[i])) / data.length);
+        }
+        
+        var entropy = 0,
+            p;
+            
+        for (i = 0; i < prob.length; i++) {
+            p = prob[i];
+            entropy += p * Math.log(p) / Math.log(2);
+        }
+        
+        return -entropy;
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Extract.js.html b/docs/operations_Extract.js.html new file mode 100755 index 00000000..10822a64 --- /dev/null +++ b/docs/operations_Extract.js.html @@ -0,0 +1,528 @@ + + + + + + + CyberChef Source: operations/Extract.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Extract.js

+ +
+
+
/**
+ * Identifier extraction operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Extract = {
+
+    /**
+     * Runs search operations across the input data using refular expressions.
+     *
+     * @private
+     * @param {string} input
+     * @param {RegExp} search_regex
+     * @param {RegExp} remove_regex - A regular expression defining results to remove from the
+     *      final list
+     * @param {boolean} include_total - Whether or not to include the total number of results
+     * @returns {string}
+     */
+    _search: function(input, search_regex, remove_regex, include_total) {
+        var output = "",
+            total = 0,
+            match;
+            
+        while (!!(match = search_regex.exec(input))) {
+            if (remove_regex && remove_regex.test(match[0]))
+                continue;
+            total++;
+            output += match[0] + "\n";
+        }
+        
+        if (include_total)
+            output = "Total found: " + total + "\n\n" + output;
+            
+        return output;
+    },
+
+
+    /**
+     * @constant
+     * @default
+     */
+    MIN_STRING_LEN: 3,
+    /**
+     * @constant
+     * @default
+     */
+    DISPLAY_TOTAL: false,
+    
+    /**
+     * Strings operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_strings: function(input, args) {
+        var min_len = args[0] || Extract.MIN_STRING_LEN,
+            display_total = args[1],
+            strings = "[A-Z\\d/\\-:.,_$%'\"()<>= !\\[\\]{}@]",
+            regex = new RegExp(strings + "{" + min_len + ",}", "ig");
+            
+        return Extract._search(input, regex, null, display_total);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    INCLUDE_IPV4: true,
+    /**
+     * @constant
+     * @default
+     */
+    INCLUDE_IPV6: false,
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_LOCAL: false,
+    
+    /**
+     * Extract IP addresses operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_ip: function(input, args) {
+        var include_ipv4  = args[0],
+            include_ipv6  = args[1],
+            remove_local  = args[2],
+            display_total = args[3],
+            ipv4 = "(?:(?:\\d|[01]?\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d|\\d)(?:\\/\\d{1,2})?",
+            ipv6 = "((?=.*::)(?!.*::.+::)(::)?([\\dA-F]{1,4}:(:|\\b)|){5}|([\\dA-F]{1,4}:){6})((([\\dA-F]{1,4}((?!\\3)::|:\\b|(?![\\dA-F])))|(?!\\2\\3)){2}|(((2[0-4]|1\\d|[1-9])?\\d|25[0-5])\\.?\\b){4})",
+            ips  = "";
+        
+        if (include_ipv4 && include_ipv6) {
+            ips = ipv4 + "|" + ipv6;
+        } else if (include_ipv4) {
+            ips = ipv4;
+        } else if (include_ipv6) {
+            ips = ipv6;
+        }
+        
+        if (ips) {
+            var regex = new RegExp(ips, "ig");
+            
+            if (remove_local) {
+                var ten = "10\\..+",
+                    oneninetwo = "192\\.168\\..+",
+                    oneseventwo = "172\\.(?:1[6-9]|2\\d|3[01])\\..+",
+                    onetwoseven = "127\\..+",
+                    remove_regex = new RegExp("^(?:" + ten + "|" + oneninetwo +
+                        "|" + oneseventwo + "|" + onetwoseven + ")");
+                        
+                return Extract._search(input, regex, remove_regex, display_total);
+            } else {
+                return Extract._search(input, regex, null, display_total);
+            }
+        } else {
+            return "";
+        }
+    },
+    
+    
+    /**
+     * Extract email addresses operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_email: function(input, args) {
+        var display_total = args[0],
+            regex = /\w[-.\w]*@[-\w]+(?:\.[-\w]+)*\.[A-Z]{2,4}/ig;
+            
+        return Extract._search(input, regex, null, display_total);
+    },
+    
+    
+    /**
+     * Extract MAC addresses operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_mac: function(input, args) {
+        var display_total = args[0],
+            regex = /[A-F\d]{2}(?:[:-][A-F\d]{2}){5}/ig;
+            
+        return Extract._search(input, regex, null, display_total);
+    },
+    
+    
+    /**
+     * Extract URLs operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_urls: function(input, args) {
+        var display_total = args[0],
+            protocol = "[A-Z]+://",
+            hostname = "[-\\w]+(?:\\.\\w[-\\w]*)+",
+            port = ":\\d+",
+            path = "/[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]*";
+            
+        path += "(?:[.!,?]+[^.!,?;\"'<>()\\[\\]{}\\s\\x7F-\\xFF]+)*";
+        var regex = new RegExp(protocol + hostname + "(?:" + port +
+            ")?(?:" + path + ")?", "ig");
+        return Extract._search(input, regex, null, display_total);
+    },
+    
+    
+    /**
+     * Extract domains operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_domains: function(input, args) {
+        var display_total = args[0],
+            protocol = "https?://",
+            hostname = "[-\\w\\.]+",
+            tld = "\\.(?:com|net|org|biz|info|co|uk|onion|int|mobi|name|edu|gov|mil|eu|ac|ae|af|de|ca|ch|cn|cy|es|gb|hk|il|in|io|tv|me|nl|no|nz|ro|ru|tr|us|az|ir|kz|uz|pk)+",
+            regex = new RegExp("(?:" + protocol + ")?" + hostname + tld, "ig");
+        
+        return Extract._search(input, regex, null, display_total);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    INCLUDE_WIN_PATH: true,
+    /**
+     * @constant
+     * @default
+     */
+    INCLUDE_UNIX_PATH: true,
+    
+    /**
+     * Extract file paths operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_file_paths: function(input, args) {
+        var include_win_path = args[0],
+            include_unix_path = args[1],
+            display_total = args[2],
+            win_drive = "[A-Z]:\\\\",
+            win_name = "[A-Z\\d][A-Z\\d\\- '_\\(\\)]{0,61}",
+            win_ext = "[A-Z\\d]{1,6}",
+            win_path = win_drive + "(?:" + win_name + "\\\\?)*" + win_name +
+                "(?:\\." + win_ext + ")?",
+            unix_path = "(?:/[A-Z\\d.][A-Z\\d\\-.]{0,61})+",
+            file_paths = "";
+        
+        if (include_win_path && include_unix_path) {
+            file_paths = win_path + "|" + unix_path;
+        } else if (include_win_path) {
+            file_paths = win_path;
+        } else if (include_unix_path) {
+            file_paths = unix_path;
+        }
+        
+        if (file_paths) {
+            var regex = new RegExp(file_paths, "ig");
+            return Extract._search(input, regex, null, display_total);
+        } else {
+            return "";
+        }
+    },
+    
+    
+    /**
+     * Extract dates operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_dates: function(input, args) {
+        var display_total = args[0],
+            date1 = "(?:19|20)\\d\\d[- /.](?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])", // yyyy-mm-dd
+            date2 = "(?:0[1-9]|[12][0-9]|3[01])[- /.](?:0[1-9]|1[012])[- /.](?:19|20)\\d\\d", // dd/mm/yyyy
+            date3 = "(?:0[1-9]|1[012])[- /.](?:0[1-9]|[12][0-9]|3[01])[- /.](?:19|20)\\d\\d", // mm/dd/yyyy
+            regex = new RegExp(date1 + "|" + date2 + "|" + date3, "ig");
+            
+        return Extract._search(input, regex, null, display_total);
+    },
+    
+    
+    /**
+     * Extract all identifiers operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_all_idents: function(input, args) {
+        var output = "";
+        output += "IP addresses\n";
+        output += Extract.run_ip(input, [true, true, false]);
+        
+        output += "\nEmail addresses\n";
+        output += Extract.run_email(input, []);
+        
+        output += "\nMAC addresses\n";
+        output += Extract.run_mac(input, []);
+        
+        output += "\nURLs\n";
+        output += Extract.run_urls(input, []);
+        
+        output += "\nDomain names\n";
+        output += Extract.run_domains(input, []);
+        
+        output += "\nFile paths\n";
+        output += Extract.run_file_paths(input, [true, true]);
+        
+        output += "\nDates\n";
+        output += Extract.run_dates(input, []);
+        return output;
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_FileType.js.html b/docs/operations_FileType.js.html new file mode 100755 index 00000000..73f353ee --- /dev/null +++ b/docs/operations_FileType.js.html @@ -0,0 +1,757 @@ + + + + + + + CyberChef Source: operations/FileType.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/FileType.js

+ +
+
+
/**
+ * File type operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var FileType = {
+
+    /**
+     * Detect File Type operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_detect: function(input, args) {
+        var type = FileType._magic_type(input);
+        
+        if (!type) {
+            return "Unknown file type. Have you tried checking the entropy of this data to determine whether it might be encrypted or compressed?";
+        } else {
+            var output = "File extension: " + type.ext + "\n" +
+                "MIME type:      " + type.mime;
+            
+            if (type.desc && type.desc.length) {
+                output += "\nDescription:    " + type.desc;
+            }
+            
+            return output;
+        }
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    IGNORE_COMMON_BYTE_SEQUENCES: true,
+    
+    /**
+     * Scan for Embedded Files operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_scan_for_embedded_files: function(input, args) {
+        var output = "Scanning data for 'magic bytes' which may indicate embedded files. The following results may be false positives and should not be treat as reliable. Any suffiently long file is likely to contain these magic bytes coincidentally.\n",
+            type,
+            ignore_common = args[0],
+            common_exts = ["ico", "ttf", ""],
+            num_found = 0,
+            num_common_found = 0;
+            
+        for (var i = 0; i < input.length; i++) {
+            type = FileType._magic_type(input.slice(i));
+            if (type) {
+                if (ignore_common && common_exts.indexOf(type.ext) > -1) {
+                    num_common_found++;
+                    continue;
+                }
+                num_found++;
+                output += "\nOffset " + i + " (0x" + Utils.hex(i) + "):\n" +
+                    "  File extension: " + type.ext + "\n" +
+                    "  MIME type:      " + type.mime + "\n";
+                    
+                if (type.desc && type.desc.length) {
+                    output += "  Description:    " + type.desc + "\n";
+                }
+            }
+        }
+        
+        if (num_found === 0) {
+            output += "\nNo embedded files were found.";
+        }
+        
+        if (num_common_found > 0) {
+            output += "\n\n" + num_common_found;
+            output += num_common_found == 1 ?
+                " file type was detected that has a common byte sequence. This is likely to be a false positive." :
+                " file types were detected that have common byte sequences. These are likely to be false positives."; 
+            output += " Run this operation with the 'Ignore common byte sequences' option unchecked to see details.";
+        }
+        
+        return output;
+    },
+    
+    
+    /**
+     * Given a buffer, detects magic byte sequences at specific positions and returns the 
+     * extension and mime type.
+     *
+     * @private
+     * @param {byte_array} buf
+     * @returns {Object} type
+     * @returns {string} type.ext - File extension
+     * @returns {string} type.mime - Mime type
+     * @returns {string} [type.desc] - Description
+     */
+    _magic_type: function (buf) {
+        if (!(buf && buf.length > 1)) {
+            return null;
+        }
+
+        if (buf[0] === 0xFF && buf[1] === 0xD8 && buf[2] === 0xFF) {
+            return {
+                ext: 'jpg',
+                mime: 'image/jpeg'
+            };
+        }
+
+        if (buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4E && buf[3] === 0x47) {
+            return {
+                ext: 'png',
+                mime: 'image/png'
+            };
+        }
+
+        if (buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46) {
+            return {
+                ext: 'gif',
+                mime: 'image/gif'
+            };
+        }
+
+        if (buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) {
+            return {
+                ext: 'webp',
+                mime: 'image/webp'
+            };
+        }
+
+        // needs to be before `tif` check
+        if (((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) && buf[8] === 0x43 && buf[9] === 0x52) {
+            return {
+                ext: 'cr2',
+                mime: 'image/x-canon-cr2'
+            };
+        }
+
+        if ((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) {
+            return {
+                ext: 'tif',
+                mime: 'image/tiff'
+            };
+        }
+
+        if (buf[0] === 0x42 && buf[1] === 0x4D) {
+            return {
+                ext: 'bmp',
+                mime: 'image/bmp'
+            };
+        }
+
+        if (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0xBC) {
+            return {
+                ext: 'jxr',
+                mime: 'image/vnd.ms-photo'
+            };
+        }
+
+        if (buf[0] === 0x38 && buf[1] === 0x42 && buf[2] === 0x50 && buf[3] === 0x53) {
+            return {
+                ext: 'psd',
+                mime: 'image/vnd.adobe.photoshop'
+            };
+        }
+
+        // needs to be before `zip` check
+        if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x6D && buf[31] === 0x69 && buf[32] === 0x6D && buf[33] === 0x65 && buf[34] === 0x74 && buf[35] === 0x79 && buf[36] === 0x70 && buf[37] === 0x65 && buf[38] === 0x61 && buf[39] === 0x70 && buf[40] === 0x70 && buf[41] === 0x6C && buf[42] === 0x69 && buf[43] === 0x63 && buf[44] === 0x61 && buf[45] === 0x74 && buf[46] === 0x69 && buf[47] === 0x6F && buf[48] === 0x6E && buf[49] === 0x2F && buf[50] === 0x65 && buf[51] === 0x70 && buf[52] === 0x75 && buf[53] === 0x62 && buf[54] === 0x2B && buf[55] === 0x7A && buf[56] === 0x69 && buf[57] === 0x70) {
+            return {
+                ext: 'epub',
+                mime: 'application/epub+zip'
+            };
+        }
+
+        if (buf[0] === 0x50 && buf[1] === 0x4B && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)) {
+            return {
+                ext: 'zip',
+                mime: 'application/zip'
+            };
+        }
+
+        if (buf[257] === 0x75 && buf[258] === 0x73 && buf[259] === 0x74 && buf[260] === 0x61 && buf[261] === 0x72) {
+            return {
+                ext: 'tar',
+                mime: 'application/x-tar'
+            };
+        }
+
+        if (buf[0] === 0x52 && buf[1] === 0x61 && buf[2] === 0x72 && buf[3] === 0x21 && buf[4] === 0x1A && buf[5] === 0x7 && (buf[6] === 0x0 || buf[6] === 0x1)) {
+            return {
+                ext: 'rar',
+                mime: 'application/x-rar-compressed'
+            };
+        }
+
+        if (buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x8) {
+            return {
+                ext: 'gz',
+                mime: 'application/gzip'
+            };
+        }
+
+        if (buf[0] === 0x42 && buf[1] === 0x5A && buf[2] === 0x68) {
+            return {
+                ext: 'bz2',
+                mime: 'application/x-bzip2'
+            };
+        }
+
+        if (buf[0] === 0x37 && buf[1] === 0x7A && buf[2] === 0xBC && buf[3] === 0xAF && buf[4] === 0x27 && buf[5] === 0x1C) {
+            return {
+                ext: '7z',
+                mime: 'application/x-7z-compressed'
+            };
+        }
+
+        if (buf[0] === 0x78 && buf[1] === 0x01) {
+            return {
+                ext: 'dmg',
+                mime: 'application/x-apple-diskimage'
+            };
+        }
+
+        if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && (buf[3] === 0x18 || buf[3] === 0x20) && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) || (buf[0] === 0x33 && buf[1] === 0x67 && buf[2] === 0x70 && buf[3] === 0x35) || (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[16] === 0x6D && buf[17] === 0x70 && buf[18] === 0x34 && buf[19] === 0x31 && buf[20] === 0x6D && buf[21] === 0x70 && buf[22] === 0x34 && buf[23] === 0x32 && buf[24] === 0x69 && buf[25] === 0x73 && buf[26] === 0x6F && buf[27] === 0x6D)) {
+            return {
+                ext: 'mp4',
+                mime: 'video/mp4'
+            };
+        }
+
+        if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x56)) {
+            return {
+                ext: 'm4v',
+                mime: 'video/x-m4v'
+            };
+        }
+
+        if (buf[0] === 0x4D && buf[1] === 0x54 && buf[2] === 0x68 && buf[3] === 0x64) {
+            return {
+                ext: 'mid',
+                mime: 'audio/midi'
+            };
+        }
+
+        // needs to be before the `webm` check
+        if (buf[31] === 0x6D && buf[32] === 0x61 && buf[33] === 0x74 && buf[34] === 0x72 && buf[35] === 0x6f && buf[36] === 0x73 && buf[37] === 0x6B && buf[38] === 0x61) {
+            return {
+                ext: 'mkv',
+                mime: 'video/x-matroska'
+            };
+        }
+
+        if (buf[0] === 0x1A && buf[1] === 0x45 && buf[2] === 0xDF && buf[3] === 0xA3) {
+            return {
+                ext: 'webm',
+                mime: 'video/webm'
+            };
+        }
+
+        if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x14 && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) {
+            return {
+                ext: 'mov',
+                mime: 'video/quicktime'
+            };
+        }
+
+        if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x41 && buf[9] === 0x56 && buf[10] === 0x49) {
+            return {
+                ext: 'avi',
+                mime: 'video/x-msvideo'
+            };
+        }
+
+        if (buf[0] === 0x30 && buf[1] === 0x26 && buf[2] === 0xB2 && buf[3] === 0x75 && buf[4] === 0x8E && buf[5] === 0x66 && buf[6] === 0xCF && buf[7] === 0x11 && buf[8] === 0xA6 && buf[9] === 0xD9) {
+            return {
+                ext: 'wmv',
+                mime: 'video/x-ms-wmv'
+            };
+        }
+
+        if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x1 && buf[3].toString(16)[0] === 'b') {
+            return {
+                ext: 'mpg',
+                mime: 'video/mpeg'
+            };
+        }
+
+        if ((buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) || (buf[0] === 0xFF && buf[1] === 0xfb)) {
+            return {
+                ext: 'mp3',
+                mime: 'audio/mpeg'
+            };
+        }
+
+        if ((buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x41) || (buf[0] === 0x4D && buf[1] === 0x34 && buf[2] === 0x41 && buf[3] === 0x20)) {
+            return {
+                ext: 'm4a',
+                mime: 'audio/m4a'
+            };
+        }
+
+        if (buf[0] === 0x4F && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) {
+            return {
+                ext: 'ogg',
+                mime: 'audio/ogg'
+            };
+        }
+
+        if (buf[0] === 0x66 && buf[1] === 0x4C && buf[2] === 0x61 && buf[3] === 0x43) {
+            return {
+                ext: 'flac',
+                mime: 'audio/x-flac'
+            };
+        }
+
+        if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && buf[10] === 0x56 && buf[11] === 0x45) {
+            return {
+                ext: 'wav',
+                mime: 'audio/x-wav'
+            };
+        }
+
+        if (buf[0] === 0x23 && buf[1] === 0x21 && buf[2] === 0x41 && buf[3] === 0x4D && buf[4] === 0x52 && buf[5] === 0x0A) {
+            return {
+                ext: 'amr',
+                mime: 'audio/amr'
+            };
+        }
+
+        if (buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) {
+            return {
+                ext: 'pdf',
+                mime: 'application/pdf'
+            };
+        }
+
+        if (buf[0] === 0x4D && buf[1] === 0x5A) {
+            return {
+                ext: 'exe',
+                mime: 'application/x-msdownload'
+            };
+        }
+
+        if ((buf[0] === 0x43 || buf[0] === 0x46) && buf[1] === 0x57 && buf[2] === 0x53) {
+            return {
+                ext: 'swf',
+                mime: 'application/x-shockwave-flash'
+            };
+        }
+
+        if (buf[0] === 0x7B && buf[1] === 0x5C && buf[2] === 0x72 && buf[3] === 0x74 && buf[4] === 0x66) {
+            return {
+                ext: 'rtf',
+                mime: 'application/rtf'
+            };
+        }
+
+        if (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) {
+            return {
+                ext: 'woff',
+                mime: 'application/font-woff'
+            };
+        }
+
+        if (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) {
+            return {
+                ext: 'woff2',
+                mime: 'application/font-woff'
+            };
+        }
+
+        if (buf[34] === 0x4C && buf[35] === 0x50 && ((buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x01) || (buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x00) || (buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02))) {
+            return {
+                ext: 'eot',
+                mime: 'application/octet-stream'
+            };
+        }
+
+        if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) {
+            return {
+                ext: 'ttf',
+                mime: 'application/font-sfnt'
+            };
+        }
+
+        if (buf[0] === 0x4F && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4F && buf[4] === 0x00) {
+            return {
+                ext: 'otf',
+                mime: 'application/font-sfnt'
+            };
+        }
+
+        if (buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) {
+            return {
+                ext: 'ico',
+                mime: 'image/x-icon'
+            };
+        }
+
+        if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x56 && buf[3] === 0x01) {
+            return {
+                ext: 'flv',
+                mime: 'video/x-flv'
+            };
+        }
+
+        if (buf[0] === 0x25 && buf[1] === 0x21) {
+            return {
+                ext: 'ps',
+                mime: 'application/postscript'
+            };
+        }
+
+        if (buf[0] === 0xFD && buf[1] === 0x37 && buf[2] === 0x7A && buf[3] === 0x58 && buf[4] === 0x5A && buf[5] === 0x00) {
+            return {
+                ext: 'xz',
+                mime: 'application/x-xz'
+            };
+        }
+
+        if (buf[0] === 0x53 && buf[1] === 0x51 && buf[2] === 0x4C && buf[3] === 0x69) {
+            return {
+                ext: 'sqlite',
+                mime: 'application/x-sqlite3'
+            };
+        }
+        
+        // Added by n1474335 [n1474335@gmail.com] from here on
+        // ################################################################## //
+        if ((buf[0] === 0x1F && buf[1] === 0x9D) || (buf[0] === 0x1F && buf[1] === 0xA0)) {
+            return {
+                ext: 'z, tar.z',
+                mime: 'application/x-gtar'
+            };
+        }
+        
+        if (buf[0] === 0x7F && buf[1] === 0x45 && buf[2] === 0x4C && buf[3] === 0x46) {
+            return {
+                ext: 'none, axf, bin, elf, o, prx, puff, so',
+                mime: 'application/x-executable',
+                desc: 'Executable and Linkable Format file. No standard file extension.'
+            };
+        }
+        
+        if (buf[0] === 0xCA && buf[1] === 0xFE && buf[2] === 0xBA && buf[3] === 0xBE) {
+            return {
+                ext: 'class',
+                mime: 'application/java-vm'
+            };
+        }
+        
+        if (buf[0] === 0xEF && buf[1] === 0xBB && buf[2] === 0xBF) {
+            return {
+                ext: 'txt',
+                mime: 'text/plain',
+                desc: 'UTF-8 encoded Unicode byte order mark detected, commonly but not exclusively seen in text files.'
+            };
+        }
+        
+        // Must be before Little-endian UTF-16 BOM
+        if (buf[0] === 0xFF && buf[1] === 0xFE && buf[2] === 0x00 && buf[3] === 0x00) {
+            return {
+                ext: '',
+                mime: '',
+                desc: 'Little-endian UTF-32 encoded Unicode byte order mark detected.'
+            };
+        }
+        
+        if (buf[0] === 0xFF && buf[1] === 0xFE) {
+            return {
+                ext: '',
+                mime: '',
+                desc: 'Little-endian UTF-16 encoded Unicode byte order mark detected.'
+            };
+        }
+        
+        if ((buf[0x8001] === 0x43 && buf[0x8002] === 0x44 && buf[0x8003] === 0x30 && buf[0x8004] === 0x30 && buf[0x8005] === 0x31) ||
+            (buf[0x8801] === 0x43 && buf[0x8802] === 0x44 && buf[0x8803] === 0x30 && buf[0x8804] === 0x30 && buf[0x8805] === 0x31) ||
+            (buf[0x9001] === 0x43 && buf[0x9002] === 0x44 && buf[0x9003] === 0x30 && buf[0x9004] === 0x30 && buf[0x9005] === 0x31)) {
+            return {
+                ext: 'iso',
+                mime: 'application/octet-stream',
+                desc: 'ISO 9660 CD/DVD image file'
+            };
+        }
+        
+        if (buf[0] === 0xD0 && buf[1] === 0xCF && buf[2] === 0x11 && buf[3] === 0xE0 && buf[4] === 0xA1 && buf[5] === 0xB1 && buf[6] === 0x1A && buf[7] === 0xE1) {
+            return {
+                ext: 'doc, xls, ppt',
+                mime: 'application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint',
+                desc: 'Microsoft Office documents'
+            };
+        }
+        
+        if (buf[0] === 0x64 && buf[1] === 0x65 && buf[2] === 0x78 && buf[3] === 0x0A && buf[4] === 0x30 && buf[5] === 0x33 && buf[6] === 0x35 && buf[7] === 0x00) {
+            return {
+                ext: 'dex',
+                mime: 'application/octet-stream',
+                desc: 'Dalvik Executable (Android)'
+            };
+        }
+        
+        if (buf[0] === 0x4B && buf[1] === 0x44 && buf[2] === 0x4D) {
+            return {
+                ext: 'vmdk',
+                mime: 'application/vmdk, application/x-virtualbox-vmdk'
+            };
+        }
+        
+        if (buf[0] === 0x43 && buf[1] === 0x72 && buf[2] === 0x32 && buf[3] == 0x34) {
+            return {
+                ext: 'crx',
+                mime: 'application/crx',
+                desc: 'Google Chrome extension or packaged app'
+            };
+        }
+
+        return null;
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_HTML.js.html b/docs/operations_HTML.js.html new file mode 100755 index 00000000..b61d0414 --- /dev/null +++ b/docs/operations_HTML.js.html @@ -0,0 +1,1082 @@ + + + + + + + CyberChef Source: operations/HTML.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/HTML.js

+ +
+
+
/**
+ * HTML operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var HTML = {
+
+    /**
+     * @constant
+     * @default
+     */
+    CONVERT_ALL: false,
+    /**
+     * @constant
+     * @default
+     */
+    CONVERT_OPTIONS: ["Named entities where possible", "Numeric entities", "Hex entities"],
+    
+    /**
+     * To HTML Entity operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to_entity: function(input, args) {
+        var convert_all = args[0],
+            numeric = args[1] == "Numeric entities",
+            hexa = args[1] == "Hex entities";
+        
+        var charcodes = Utils.str_to_charcode(input);
+        var output = "";
+        
+        for (var i = 0; i < charcodes.length; i++) {
+            if (convert_all && numeric) {
+                output += "&#" + charcodes[i] + ";";
+            } else if (convert_all && hexa) {
+                output += "&#x" + Utils.hex(charcodes[i]) + ";";
+            } else if (convert_all) {
+                output += HTML._byte_to_entity[charcodes[i]] || "&#" + charcodes[i] + ";";
+            } else if (numeric) {
+                if (charcodes[i] > 255 || HTML._byte_to_entity.hasOwnProperty(charcodes[i])) {
+                    output += "&#" + charcodes[i] + ";";
+                } else {
+                    output += Utils.chr(charcodes[i]);
+                }
+            } else if (hexa) {
+                if (charcodes[i] > 255 || HTML._byte_to_entity.hasOwnProperty(charcodes[i])) {
+                    output += "&#x" + Utils.hex(charcodes[i]) + ";";
+                } else {
+                    output += Utils.chr(charcodes[i]);
+                }
+            } else {
+                output += HTML._byte_to_entity[charcodes[i]] || (
+                    charcodes[i] > 255 ?
+                        "&#" + charcodes[i] + ";" :
+                        Utils.chr(charcodes[i])
+                );
+            }
+        }
+        return output;
+    },
+    
+    
+    /**
+     * From HTML Entity operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_from_entity: function(input, args) {
+        var regex = /&(#?x?[a-zA-Z0-9]{1,8});/g,
+            output = "",
+            m,
+            i = 0;
+            
+        while (!!(m = regex.exec(input))) {
+            // Add up to match
+            for (; i < m.index;)
+                output += input[i++];
+            
+            // Add match
+            var bite = HTML._entity_to_byte[m[1]];
+            if (bite) {
+                output += Utils.chr(bite);
+            } else if (!bite && m[1][0] == "#" && m[1].length > 1 && /^#\d{1,5}$/.test(m[1])) {
+                // Numeric entity (e.g. &#10;)
+                var num = m[1].slice(1,m[1].length);
+                output += Utils.chr(parseInt(num, 10));
+            } else if (!bite && m[1][0] == "#" && m[1].length > 3 && /^#x[\dA-F]{2,8}$/i.test(m[1])) {
+                // Hex entity (e.g. &#x3A;)
+                var hex = m[1].slice(2,m[1].length);
+                output += Utils.chr(parseInt(hex, 16));
+            } else {
+                // Not a valid entity, print as normal
+                for (; i < regex.lastIndex;)
+                    output += input[i++];
+            }
+            
+            i = regex.lastIndex;
+        }
+        // Add all after final match
+        for (; i < input.length;)
+            output += input[i++];
+        
+        return output;
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_INDENTATION: true,
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_LINE_BREAKS: true,
+    
+    /**
+     * Strip HTML tags operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_strip_tags: function(input, args) {
+        var remove_indentation = args[0],
+            remove_line_breaks = args[1];
+            
+        input = Utils.strip_html_tags(input);
+        
+        if (remove_indentation) {
+            input = input.replace(/\n[ \f\t]+/g, "\n");
+        }
+        
+        if (remove_line_breaks) {
+            input = input.replace(/^\s*\n/, "") // first line
+                         .replace(/(\n\s*){2,}/g, "\n"); // all others
+        }
+        
+        return input;
+    },
+    
+    
+    /**
+     * Parse colour code operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {html}
+     */
+    run_parse_colour_code: function(input, args) {
+        var m = null,
+            r = 0, g = 0, b = 0, a = 1;
+        
+        // Read in the input
+        if (!!(m = input.match(/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i))) {
+            // Hex - #d9edf7
+            r = parseInt(m[1], 16);
+            g = parseInt(m[2], 16);
+            b = parseInt(m[3], 16);
+        } else if (!!(m = input.match(/rgba?\((\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?)(?:,\s?(\d(?:\.\d+)?))?\)/i))) {
+            // RGB or RGBA - rgb(217,237,247) or rgba(217,237,247,1)
+            r = parseFloat(m[1]);
+            g = parseFloat(m[2]);
+            b = parseFloat(m[3]);
+            a = m[4] ? parseFloat(m[4]) : 1;
+        } else if (!!(m = input.match(/hsla?\((\d{1,3}(?:\.\d+)?),\s?(\d{1,3}(?:\.\d+)?)%,\s?(\d{1,3}(?:\.\d+)?)%(?:,\s?(\d(?:\.\d+)?))?\)/i))) {
+            // HSL or HSLA - hsl(200, 65%, 91%) or hsla(200, 65%, 91%, 1)
+            var h_ = parseFloat(m[1]) / 360,
+                s_ = parseFloat(m[2]) / 100,
+                l_ = parseFloat(m[3]) / 100,
+                rgb_ = HTML._hsl_to_rgb(h_, s_, l_);
+            
+            r = rgb_[0];
+            g = rgb_[1];
+            b = rgb_[2];
+            a = m[4] ? parseFloat(m[4]) : 1;
+        } else if (!!(m = input.match(/cmyk\((\d(?:\.\d+)?),\s?(\d(?:\.\d+)?),\s?(\d(?:\.\d+)?),\s?(\d(?:\.\d+)?)\)/i))) {
+            // CMYK - cmyk(0.12, 0.04, 0.00, 0.03)
+            var c_ = parseFloat(m[1]),
+                m_ = parseFloat(m[2]),
+                y_ = parseFloat(m[3]),
+                k_ = parseFloat(m[4]);
+
+            r = Math.round(255 * (1 - c_) * (1 - k_));
+            g = Math.round(255 * (1 - m_) * (1 - k_));
+            b = Math.round(255 * (1 - y_) * (1 - k_));
+        }
+        
+        var hsl_ = HTML._rgb_to_hsl(r, g, b),
+            h = Math.round(hsl_[0] * 360),
+            s = Math.round(hsl_[1] * 100),
+            l = Math.round(hsl_[2] * 100),
+            k = 1 - Math.max(r/255, g/255, b/255),
+            c = (1 - r/255 - k) / (1 - k),
+            m = (1 - g/255 - k) / (1 - k), // jshint ignore:line
+            y = (1 - b/255 - k) / (1 - k);
+            
+        c = isNaN(c) ? "0" : c.toFixed(2);
+        m = isNaN(m) ? "0" : m.toFixed(2);
+        y = isNaN(y) ? "0" : y.toFixed(2);
+        k = k.toFixed(2);
+        
+        var hex = "#" +
+                Utils.pad_left(Math.round(r).toString(16), 2) +
+                Utils.pad_left(Math.round(g).toString(16), 2) +
+                Utils.pad_left(Math.round(b).toString(16), 2),
+            rgb  = "rgb(" + r + ", " + g + ", " + b + ")",
+            rgba = "rgba(" + r + ", " + g + ", " + b + ", " + a + ")",
+            hsl  = "hsl(" + h + ", " + s + "%, " + l + "%)",
+            hsla = "hsla(" + h + ", " + s + "%, " + l + "%, " + a + ")",
+            cmyk = "cmyk(" + c + ", " + m + ", " + y + ", " + k + ")";
+            
+        // Generate output
+        return "<div id='colorpicker' style='display: inline-block'></div>" + 
+            "Hex:  " + hex + "\n" +
+            "RGB:  " + rgb + "\n" +
+            "RGBA: " + rgba + "\n" +
+            "HSL:  " + hsl + "\n" +
+            "HSLA: " + hsla + "\n" +
+            "CMYK: " + cmyk +
+            "<script>\
+                $('#colorpicker').colorpicker({\
+                    format: 'rgba',\
+                    color: '" + rgba + "',\
+                    container: true,\
+                    inline: true,\
+                }).on('changeColor', function(e) {\
+                    var color = e.color.toRGB();\
+                    document.getElementById('input-text').value = 'rgba(' +\
+                        color.r + ', ' + color.g + ', ' + color.b + ', ' + color.a + ')';\
+                    window.app.auto_bake();\
+                });\
+            </script>";
+    },
+    
+    
+    
+    /**
+     * Converts an HSL color value to RGB. Conversion formula
+     * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
+     * Assumes h, s, and l are contained in the set [0, 1] and
+     * returns r, g, and b in the set [0, 255].
+     *
+     * @private
+     * @author Mohsen (http://stackoverflow.com/a/9493060)
+     *
+     * @param {number} h - The hue
+     * @param {number} s - The saturation
+     * @param {number} l - The lightness
+     * @return {Array} The RGB representation
+     */
+    _hsl_to_rgb: function(h, s, l){
+        var r, g, b;
+
+        if (s === 0){
+            r = g = b = l; // achromatic
+        } else {
+            var hue2rgb = function hue2rgb(p, q, t) {
+                if (t < 0) t += 1;
+                if (t > 1) t -= 1;
+                if (t < 1/6) return p + (q - p) * 6 * t;
+                if (t < 1/2) return q;
+                if (t < 2/3) return p + (q - p) * (2/3 - t) * 6;
+                return p;
+            };
+
+            var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+            var p = 2 * l - q;
+            r = hue2rgb(p, q, h + 1/3);
+            g = hue2rgb(p, q, h);
+            b = hue2rgb(p, q, h - 1/3);
+        }
+
+        return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
+    },
+    
+    
+    /**
+     * Converts an RGB color value to HSL. Conversion formula
+     * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
+     * Assumes r, g, and b are contained in the set [0, 255] and
+     * returns h, s, and l in the set [0, 1].
+     *
+     * @private
+     * @author Mohsen (http://stackoverflow.com/a/9493060)
+     *
+     * @param {number} r - The red color value
+     * @param {number} g - The green color value
+     * @param {number} b - The blue color value
+     * @return {Array} The HSL representation
+     */
+    _rgb_to_hsl: function(r, g, b) {
+        r /= 255; g /= 255; b /= 255;
+        var max = Math.max(r, g, b),
+            min = Math.min(r, g, b),
+            h, s, l = (max + min) / 2;
+
+        if (max === min) {
+            h = s = 0; // achromatic
+        } else {
+            var d = max - min;
+            s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+            switch(max) {
+                case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+                case g: h = (b - r) / d + 2; break;
+                case b: h = (r - g) / d + 4; break;
+            }
+            h /= 6;
+        }
+
+        return [h, s, l];
+    },
+    
+    
+    /**
+     * Lookup table to translate byte values to their HTML entity codes.
+     *
+     * @private
+     * @constant
+     */
+    _byte_to_entity: {
+        34 : "&quot;",
+        38 : "&amp;",
+        39 : "&apos;",
+        60 : "&lt;",
+        62 : "&gt;",
+        160 : "&nbsp;",
+        161 : "&iexcl;",
+        162 : "&cent;",
+        163 : "&pound;",
+        164 : "&curren;",
+        165 : "&yen;",
+        166 : "&brvbar;",
+        167 : "&sect;",
+        168 : "&uml;",
+        169 : "&copy;",
+        170 : "&ordf;",
+        171 : "&laquo;",
+        172 : "&not;",
+        173 : "&shy;",
+        174 : "&reg;",
+        175 : "&macr;",
+        176 : "&deg;",
+        177 : "&plusmn;",
+        178 : "&sup2;",
+        179 : "&sup3;",
+        180 : "&acute;",
+        181 : "&micro;",
+        182 : "&para;",
+        183 : "&middot;",
+        184 : "&cedil;",
+        185 : "&sup1;",
+        186 : "&ordm;",
+        187 : "&raquo;",
+        188 : "&frac14;",
+        189 : "&frac12;",
+        190 : "&frac34;",
+        191 : "&iquest;",
+        192 : "&Agrave;",
+        193 : "&Aacute;",
+        194 : "&Acirc;",
+        195 : "&Atilde;",
+        196 : "&Auml;",
+        197 : "&Aring;",
+        198 : "&AElig;",
+        199 : "&Ccedil;",
+        200 : "&Egrave;",
+        201 : "&Eacute;",
+        202 : "&Ecirc;",
+        203 : "&Euml;",
+        204 : "&Igrave;",
+        205 : "&Iacute;",
+        206 : "&Icirc;",
+        207 : "&Iuml;",
+        208 : "&ETH;",
+        209 : "&Ntilde;",
+        210 : "&Ograve;",
+        211 : "&Oacute;",
+        212 : "&Ocirc;",
+        213 : "&Otilde;",
+        214 : "&Ouml;",
+        215 : "&times;",
+        216 : "&Oslash;",
+        217 : "&Ugrave;",
+        218 : "&Uacute;",
+        219 : "&Ucirc;",
+        220 : "&Uuml;",
+        221 : "&Yacute;",
+        222 : "&THORN;",
+        223 : "&szlig;",
+        224 : "&agrave;",
+        225 : "&aacute;",
+        226 : "&acirc;",
+        227 : "&atilde;",
+        228 : "&auml;",
+        229 : "&aring;",
+        230 : "&aelig;",
+        231 : "&ccedil;",
+        232 : "&egrave;",
+        233 : "&eacute;",
+        234 : "&ecirc;",
+        235 : "&euml;",
+        236 : "&igrave;",
+        237 : "&iacute;",
+        238 : "&icirc;",
+        239 : "&iuml;",
+        240 : "&eth;",
+        241 : "&ntilde;",
+        242 : "&ograve;",
+        243 : "&oacute;",
+        244 : "&ocirc;",
+        245 : "&otilde;",
+        246 : "&ouml;",
+        247 : "&divide;",
+        248 : "&oslash;",
+        249 : "&ugrave;",
+        250 : "&uacute;",
+        251 : "&ucirc;",
+        252 : "&uuml;",
+        253 : "&yacute;",
+        254 : "&thorn;",
+        255 : "&yuml;",
+        338 : "&OElig;",
+        339 : "&oelig;",
+        352 : "&Scaron;",
+        353 : "&scaron;",
+        376 : "&Yuml;",
+        402 : "&fnof;",
+        710 : "&circ;",
+        732 : "&tilde;",
+        913 : "&Alpha;",
+        914 : "&Beta;",
+        915 : "&Gamma;",
+        916 : "&Delta;",
+        917 : "&Epsilon;",
+        918 : "&Zeta;",
+        919 : "&Eta;",
+        920 : "&Theta;",
+        921 : "&Iota;",
+        922 : "&Kappa;",
+        923 : "&Lambda;",
+        924 : "&Mu;",
+        925 : "&Nu;",
+        926 : "&Xi;",
+        927 : "&Omicron;",
+        928 : "&Pi;",
+        929 : "&Rho;",
+        931 : "&Sigma;",
+        932 : "&Tau;",
+        933 : "&Upsilon;",
+        934 : "&Phi;",
+        935 : "&Chi;",
+        936 : "&Psi;",
+        937 : "&Omega;",
+        945 : "&alpha;",
+        946 : "&beta;",
+        947 : "&gamma;",
+        948 : "&delta;",
+        949 : "&epsilon;",
+        950 : "&zeta;",
+        951 : "&eta;",
+        952 : "&theta;",
+        953 : "&iota;",
+        954 : "&kappa;",
+        955 : "&lambda;",
+        956 : "&mu;",
+        957 : "&nu;",
+        958 : "&xi;",
+        959 : "&omicron;",
+        960 : "&pi;",
+        961 : "&rho;",
+        962 : "&sigmaf;",
+        963 : "&sigma;",
+        964 : "&tau;",
+        965 : "&upsilon;",
+        966 : "&phi;",
+        967 : "&chi;",
+        968 : "&psi;",
+        969 : "&omega;",
+        977 : "&thetasym;",
+        978 : "&upsih;",
+        982 : "&piv;",
+        8194 : "&ensp;",
+        8195 : "&emsp;",
+        8201 : "&thinsp;",
+        8204 : "&zwnj;",
+        8205 : "&zwj;",
+        8206 : "&lrm;",
+        8207 : "&rlm;",
+        8211 : "&ndash;",
+        8212 : "&mdash;",
+        8216 : "&lsquo;",
+        8217 : "&rsquo;",
+        8218 : "&sbquo;",
+        8220 : "&ldquo;",
+        8221 : "&rdquo;",
+        8222 : "&bdquo;",
+        8224 : "&dagger;",
+        8225 : "&Dagger;",
+        8226 : "&bull;",
+        8230 : "&hellip;",
+        8240 : "&permil;",
+        8242 : "&prime;",
+        8243 : "&Prime;",
+        8249 : "&lsaquo;",
+        8250 : "&rsaquo;",
+        8254 : "&oline;",
+        8260 : "&frasl;",
+        8364 : "&euro;",
+        8465 : "&image;",
+        8472 : "&weierp;",
+        8476 : "&real;",
+        8482 : "&trade;",
+        8501 : "&alefsym;",
+        8592 : "&larr;",
+        8593 : "&uarr;",
+        8594 : "&rarr;",
+        8595 : "&darr;",
+        8596 : "&harr;",
+        8629 : "&crarr;",
+        8656 : "&lArr;",
+        8657 : "&uArr;",
+        8658 : "&rArr;",
+        8659 : "&dArr;",
+        8660 : "&hArr;",
+        8704 : "&forall;",
+        8706 : "&part;",
+        8707 : "&exist;",
+        8709 : "&empty;",
+        8711 : "&nabla;",
+        8712 : "&isin;",
+        8713 : "&notin;",
+        8715 : "&ni;",
+        8719 : "&prod;",
+        8721 : "&sum;",
+        8722 : "&minus;",
+        8727 : "&lowast;",
+        8730 : "&radic;",
+        8733 : "&prop;",
+        8734 : "&infin;",
+        8736 : "&ang;",
+        8743 : "&and;",
+        8744 : "&or;",
+        8745 : "&cap;",
+        8746 : "&cup;",
+        8747 : "&int;",
+        8756 : "&there4;",
+        8764 : "&sim;",
+        8773 : "&cong;",
+        8776 : "&asymp;",
+        8800 : "&ne;",
+        8801 : "&equiv;",
+        8804 : "&le;",
+        8805 : "&ge;",
+        8834 : "&sub;",
+        8835 : "&sup;",
+        8836 : "&nsub;",
+        8838 : "&sube;",
+        8839 : "&supe;",
+        8853 : "&oplus;",
+        8855 : "&otimes;",
+        8869 : "&perp;",
+        8901 : "&sdot;",
+        8942 : "&vellip;",
+        8968 : "&lceil;",
+        8969 : "&rceil;",
+        8970 : "&lfloor;",
+        8971 : "&rfloor;",
+        9001 : "&lang;",
+        9002 : "&rang;",
+        9674 : "&loz;",
+        9824 : "&spades;",
+        9827 : "&clubs;",
+        9829 : "&hearts;",
+        9830 : "&diams;",
+    },
+    
+    
+    /**
+     * Lookup table to translate HTML entity codes to their byte values.
+     *
+     * @private
+     * @constant
+     */
+    _entity_to_byte : {
+        "quot" : 34,
+        "amp" : 38,
+        "apos" : 39,
+        "lt" : 60,
+        "gt" : 62,
+        "nbsp" : 160,
+        "iexcl" : 161,
+        "cent" : 162,
+        "pound" : 163,
+        "curren" : 164,
+        "yen" : 165,
+        "brvbar" : 166,
+        "sect" : 167,
+        "uml" : 168,
+        "copy" : 169,
+        "ordf" : 170,
+        "laquo" : 171,
+        "not" : 172,
+        "shy" : 173,
+        "reg" : 174,
+        "macr" : 175,
+        "deg" : 176,
+        "plusmn" : 177,
+        "sup2" : 178,
+        "sup3" : 179,
+        "acute" : 180,
+        "micro" : 181,
+        "para" : 182,
+        "middot" : 183,
+        "cedil" : 184,
+        "sup1" : 185,
+        "ordm" : 186,
+        "raquo" : 187,
+        "frac14" : 188,
+        "frac12" : 189,
+        "frac34" : 190,
+        "iquest" : 191,
+        "Agrave" : 192,
+        "Aacute" : 193,
+        "Acirc" : 194,
+        "Atilde" : 195,
+        "Auml" : 196,
+        "Aring" : 197,
+        "AElig" : 198,
+        "Ccedil" : 199,
+        "Egrave" : 200,
+        "Eacute" : 201,
+        "Ecirc" : 202,
+        "Euml" : 203,
+        "Igrave" : 204,
+        "Iacute" : 205,
+        "Icirc" : 206,
+        "Iuml" : 207,
+        "ETH" : 208,
+        "Ntilde" : 209,
+        "Ograve" : 210,
+        "Oacute" : 211,
+        "Ocirc" : 212,
+        "Otilde" : 213,
+        "Ouml" : 214,
+        "times" : 215,
+        "Oslash" : 216,
+        "Ugrave" : 217,
+        "Uacute" : 218,
+        "Ucirc" : 219,
+        "Uuml" : 220,
+        "Yacute" : 221,
+        "THORN" : 222,
+        "szlig" : 223,
+        "agrave" : 224,
+        "aacute" : 225,
+        "acirc" : 226,
+        "atilde" : 227,
+        "auml" : 228,
+        "aring" : 229,
+        "aelig" : 230,
+        "ccedil" : 231,
+        "egrave" : 232,
+        "eacute" : 233,
+        "ecirc" : 234,
+        "euml" : 235,
+        "igrave" : 236,
+        "iacute" : 237,
+        "icirc" : 238,
+        "iuml" : 239,
+        "eth" : 240,
+        "ntilde" : 241,
+        "ograve" : 242,
+        "oacute" : 243,
+        "ocirc" : 244,
+        "otilde" : 245,
+        "ouml" : 246,
+        "divide" : 247,
+        "oslash" : 248,
+        "ugrave" : 249,
+        "uacute" : 250,
+        "ucirc" : 251,
+        "uuml" : 252,
+        "yacute" : 253,
+        "thorn" : 254,
+        "yuml" : 255,
+        "OElig" : 338,
+        "oelig" : 339,
+        "Scaron" : 352,
+        "scaron" : 353,
+        "Yuml" : 376,
+        "fnof" : 402,
+        "circ" : 710,
+        "tilde" : 732,
+        "Alpha" : 913,
+        "Beta" : 914,
+        "Gamma" : 915,
+        "Delta" : 916,
+        "Epsilon" : 917,
+        "Zeta" : 918,
+        "Eta" : 919,
+        "Theta" : 920,
+        "Iota" : 921,
+        "Kappa" : 922,
+        "Lambda" : 923,
+        "Mu" : 924,
+        "Nu" : 925,
+        "Xi" : 926,
+        "Omicron" : 927,
+        "Pi" : 928,
+        "Rho" : 929,
+        "Sigma" : 931,
+        "Tau" : 932,
+        "Upsilon" : 933,
+        "Phi" : 934,
+        "Chi" : 935,
+        "Psi" : 936,
+        "Omega" : 937,
+        "alpha" : 945,
+        "beta" : 946,
+        "gamma" : 947,
+        "delta" : 948,
+        "epsilon" : 949,
+        "zeta" : 950,
+        "eta" : 951,
+        "theta" : 952,
+        "iota" : 953,
+        "kappa" : 954,
+        "lambda" : 955,
+        "mu" : 956,
+        "nu" : 957,
+        "xi" : 958,
+        "omicron" : 959,
+        "pi" : 960,
+        "rho" : 961,
+        "sigmaf" : 962,
+        "sigma" : 963,
+        "tau" : 964,
+        "upsilon" : 965,
+        "phi" : 966,
+        "chi" : 967,
+        "psi" : 968,
+        "omega" : 969,
+        "thetasym" : 977,
+        "upsih" : 978,
+        "piv" : 982,
+        "ensp" : 8194,
+        "emsp" : 8195,
+        "thinsp" : 8201,
+        "zwnj" : 8204,
+        "zwj" : 8205,
+        "lrm" : 8206,
+        "rlm" : 8207,
+        "ndash" : 8211,
+        "mdash" : 8212,
+        "lsquo" : 8216,
+        "rsquo" : 8217,
+        "sbquo" : 8218,
+        "ldquo" : 8220,
+        "rdquo" : 8221,
+        "bdquo" : 8222,
+        "dagger" : 8224,
+        "Dagger" : 8225,
+        "bull" : 8226,
+        "hellip" : 8230,
+        "permil" : 8240,
+        "prime" : 8242,
+        "Prime" : 8243,
+        "lsaquo" : 8249,
+        "rsaquo" : 8250,
+        "oline" : 8254,
+        "frasl" : 8260,
+        "euro" : 8364,
+        "image" : 8465,
+        "weierp" : 8472,
+        "real" : 8476,
+        "trade" : 8482,
+        "alefsym" : 8501,
+        "larr" : 8592,
+        "uarr" : 8593,
+        "rarr" : 8594,
+        "darr" : 8595,
+        "harr" : 8596,
+        "crarr" : 8629,
+        "lArr" : 8656,
+        "uArr" : 8657,
+        "rArr" : 8658,
+        "dArr" : 8659,
+        "hArr" : 8660,
+        "forall" : 8704,
+        "part" : 8706,
+        "exist" : 8707,
+        "empty" : 8709,
+        "nabla" : 8711,
+        "isin" : 8712,
+        "notin" : 8713,
+        "ni" : 8715,
+        "prod" : 8719,
+        "sum" : 8721,
+        "minus" : 8722,
+        "lowast" : 8727,
+        "radic" : 8730,
+        "prop" : 8733,
+        "infin" : 8734,
+        "ang" : 8736,
+        "and" : 8743,
+        "or" : 8744,
+        "cap" : 8745,
+        "cup" : 8746,
+        "int" : 8747,
+        "there4" : 8756,
+        "sim" : 8764,
+        "cong" : 8773,
+        "asymp" : 8776,
+        "ne" : 8800,
+        "equiv" : 8801,
+        "le" : 8804,
+        "ge" : 8805,
+        "sub" : 8834,
+        "sup" : 8835,
+        "nsub" : 8836,
+        "sube" : 8838,
+        "supe" : 8839,
+        "oplus" : 8853,
+        "otimes" : 8855,
+        "perp" : 8869,
+        "sdot" : 8901,
+        "vellip" : 8942,
+        "lceil" : 8968,
+        "rceil" : 8969,
+        "lfloor" : 8970,
+        "rfloor" : 8971,
+        "lang" : 9001,
+        "rang" : 9002,
+        "loz" : 9674,
+        "spades" : 9824,
+        "clubs" : 9827,
+        "hearts" : 9829,
+        "diams" : 9830,
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_HTTP.js.html b/docs/operations_HTTP.js.html new file mode 100755 index 00000000..24994d0c --- /dev/null +++ b/docs/operations_HTTP.js.html @@ -0,0 +1,284 @@ + + + + + + + CyberChef Source: operations/HTTP.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/HTTP.js

+ +
+
+
/* globals UAS_parser */
+
+/**
+ * HTTP operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var HTTP = {
+    
+    /**
+     * Strip HTTP headers operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_strip_headers: function(input, args) {
+        var header_end = input.indexOf("\r\n\r\n") +
+            (header_end < 0) ? input.indexOf("\n\n") + 2 : header_end + 4;
+            
+        return (header_end < 2) ? input : input.slice(header_end, input.length);
+    },
+    
+    
+    /**
+     * Parse User Agent operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_parse_user_agent: function(input, args) {
+        var ua = UAS_parser.parse(input);
+        
+        return "Type: " + ua.type + "\n" +
+            "Family: " + ua.uaFamily + "\n" +
+            "Name: " + ua.uaName + "\n" +
+            "URL: " + ua.uaUrl + "\n" +
+            "Company: " + ua.uaCompany + "\n" +
+            "Company URL: " + ua.uaCompanyUrl + "\n\n" +
+            "OS Family: " + ua.osFamily + "\n" +
+            "OS Name: " + ua.osName + "\n" +
+            "OS URL: " + ua.osUrl + "\n" +
+            "OS Company: " + ua.osCompany + "\n" +
+            "OS Company URL: " + ua.osCompanyUrl + "\n" +
+            "Device Type: " + ua.deviceType + "\n";
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/operations/Hash.js b/docs/operations_Hash.js.html similarity index 52% rename from src/js/operations/Hash.js rename to docs/operations_Hash.js.html index 983d2bff..6f8c5ac6 100755 --- a/src/js/operations/Hash.js +++ b/docs/operations_Hash.js.html @@ -1,4 +1,98 @@ -/* globals CryptoJS, Checksum */ + + + + + + + CyberChef Source: operations/Hash.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Hash.js

+ +
+
+
/* globals CryptoJS, Checksum */
 
 /**
  * Hashing operations.
@@ -339,3 +433,140 @@ var Hash = {
     },
     
 };
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Hexdump.js.html b/docs/operations_Hexdump.js.html new file mode 100755 index 00000000..3970234d --- /dev/null +++ b/docs/operations_Hexdump.js.html @@ -0,0 +1,426 @@ + + + + + + + CyberChef Source: operations/Hexdump.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Hexdump.js

+ +
+
+
/* globals app */
+
+/**
+ * Hexdump operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Hexdump = {
+
+    /**
+     * @constant
+     * @default
+     */
+    WIDTH: 16,
+    /**
+     * @constant
+     * @default
+     */
+    UPPER_CASE: false,
+    /**
+     * @constant
+     * @default
+     */
+    INCLUDE_FINAL_LENGTH: false,
+    
+    /**
+     * To Hexdump operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to: function(input, args) {
+        var length = args[0] || Hexdump.WIDTH;
+        var upper_case = args[1];
+        var include_final_length = args[2];
+        
+        var output = "", padding = 2;
+        for (var i = 0; i < input.length; i += length) {
+            var buff = input.slice(i, i+length);
+            var hexa = "";
+            for (var j = 0; j < buff.length; j++) {
+                hexa += Utils.hex(buff[j], padding) + " ";
+            }
+            
+            var line_no = Utils.hex(i, 8);
+            
+            if (upper_case) {
+                hexa = hexa.toUpperCase();
+                line_no = line_no.toUpperCase();
+            }
+            
+            output += line_no + "  " +
+                Utils.pad_right(hexa, (length*(padding+1))) +
+                " |" + Utils.pad_right(Utils.printable(Utils.byte_array_to_chars(buff)), buff.length) + "|\n";
+                
+            if (include_final_length && i+buff.length == input.length) {
+                output += Utils.hex(i+buff.length, 8) + "\n";
+            }
+        }
+        
+        return output.slice(0, -1);
+    },
+    
+    
+    /**
+     * From Hexdump operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_from: function(input, args) {
+        var output = [],
+            regex = /^\s*(?:[\dA-F]{4,16}:?)?\s*((?:[\dA-F]{2}\s){1,8}(?:\s|[\dA-F]{2}-)(?:[\dA-F]{2}\s){1,8}|(?:[\dA-F]{2}\s|[\dA-F]{4}\s)+)/igm,
+            block, line;
+            
+        while (!!(block = regex.exec(input))) {
+            line = Utils.from_hex(block[1].replace(/-/g, " "));
+            for (var i = 0; i < line.length; i++) {
+                output.push(line[i]);
+            }
+        }
+        // Is this a CyberChef hexdump or is it from a different tool?
+        var width = input.indexOf("\n");
+        var w = (width - 13) / 4;
+        // w should be the specified width of the hexdump and therefore a round number
+        if (Math.floor(w) != w || input.indexOf("\r") != -1 || output.indexOf(13) != -1) {
+            app.options.attempt_highlight = false;
+        }
+        return output;
+    },
+    
+    
+    /**
+     * Highlight to hexdump
+     *
+     * @param {Object[]} pos
+     * @param {number} pos[].start
+     * @param {number} pos[].end
+     * @param {Object[]} args
+     * @returns {Object[]} pos
+     */
+    highlight_to: function(pos, args) {
+        // Calculate overall selection
+        var w = args[0] || 16,
+            width = 14 + (w*4),
+            line = Math.floor(pos[0].start / w),
+            offset = pos[0].start % w,
+            start = 0,
+            end = 0;
+            
+        pos[0].start = line*width + 10 + offset*3;
+        
+        line = Math.floor(pos[0].end / w);
+        offset = pos[0].end % w;
+        if (offset === 0) { line--; offset = w; }
+        pos[0].end = line*width + 10 + offset*3 - 1;
+        
+        // Set up multiple selections for bytes
+        var start_line_num = Math.floor(pos[0].start / width);
+        var end_line_num = Math.floor(pos[0].end / width);
+        
+        if (start_line_num == end_line_num) {
+            pos.push(pos[0]);
+        } else {
+            start = pos[0].start;
+            end = (start_line_num+1) * width - w - 5;
+            pos.push({ start: start, end: end });
+            while (end < pos[0].end) {
+                start_line_num++;
+                start = start_line_num * width + 10;
+                end = (start_line_num+1) * width - w - 5;
+                if (end > pos[0].end) end = pos[0].end;
+                pos.push({ start: start, end: end });
+            }
+        }
+        
+        // Set up multiple selections for ASCII
+        var len = pos.length, line_num = 0;
+        start = 0;
+        end = 0;
+        for (var i = 1; i < len; i++) {
+            line_num = Math.floor(pos[i].start / width);
+            start = (((pos[i].start - (line_num * width)) - 10) / 3) + (width - w -2) + (line_num * width);
+            end = (((pos[i].end + 1 - (line_num * width)) - 10) / 3) + (width - w -2) + (line_num * width);
+            pos.push({ start: start, end: end });
+        }
+        return pos;
+    },
+    
+    
+    /**
+     * Highlight from hexdump
+     *
+     * @param {Object[]} pos
+     * @param {number} pos[].start
+     * @param {number} pos[].end
+     * @param {Object[]} args
+     * @returns {Object[]} pos
+     */
+    highlight_from: function(pos, args) {
+        var w = args[0] || 16;
+        var width = 14 + (w*4);
+        
+        var line = Math.floor(pos[0].start / width);
+        var offset = pos[0].start % width;
+        
+        if (offset < 10) { // In line number section
+            pos[0].start = line*w;
+        } else if (offset > 10+(w*3)) { // In ASCII section
+            pos[0].start = (line+1)*w;
+        } else { // In byte section
+            pos[0].start = line*w + Math.floor((offset-10)/3);
+        }
+        
+        line = Math.floor(pos[0].end / width);
+        offset = pos[0].end % width;
+        
+        if (offset < 10) { // In line number section
+            pos[0].end = line*w;
+        } else if (offset > 10+(w*3)) { // In ASCII section
+            pos[0].end = (line+1)*w;
+        } else { // In byte section
+            pos[0].end = line*w + Math.ceil((offset-10)/3);
+        }
+        
+        return pos;
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/operations/IP.js b/docs/operations_IP.js.html similarity index 65% rename from src/js/operations/IP.js rename to docs/operations_IP.js.html index 6a86df00..81391f4d 100755 --- a/src/js/operations/IP.js +++ b/docs/operations_IP.js.html @@ -1,4 +1,98 @@ -/* globals BigInteger */ + + + + + + + CyberChef Source: operations/IP.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/IP.js

+ +
+
+
/* globals BigInteger */
 
 /**
  * Internet Protocol address operations.
@@ -98,39 +192,39 @@ var IP = {
                 // Loopback address
                 output += "\nLoopback address to the local host corresponding to 127.0.0.1/8 in IPv4.";
                 output += "\nLoopback addresses range: ::1/128";
-            } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 &&
-                ipv6[3] === 0 && ipv6[4] === 0 && ipv6[5] === 0xffff) {
+            } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 &&
+                ipv6[3] === 0 && ipv6[4] === 0 && ipv6[5] === 0xffff) {
                 // IPv4-mapped IPv6 address
                 output += "\nIPv4-mapped IPv6 address detected. IPv6 clients will be handled natively by default, and IPv4 clients appear as IPv6 clients at their IPv4-mapped IPv6 address.";
-                output += "\nMapped IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]);
+                output += "\nMapped IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]);
                 output += "\nIPv4-mapped IPv6 addresses range: ::ffff:0:0/96";
-            } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 &&
-                ipv6[3] === 0 && ipv6[4] === 0xffff && ipv6[5] === 0) {
+            } else if (ipv6[0] === 0 && ipv6[1] === 0 && ipv6[2] === 0 &&
+                ipv6[3] === 0 && ipv6[4] === 0xffff && ipv6[5] === 0) {
                 // IPv4-translated address
                 output += "\nIPv4-translated address detected. Used by Stateless IP/ICMP Translation (SIIT). See RFCs 6145 and 6052 for more details.";
-                output += "\nTranslated IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]);
+                output += "\nTranslated IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]);
                 output += "\nIPv4-translated addresses range: ::ffff:0:0:0/96";
             } else if (ipv6[0] === 0x100) {
                 // Discard prefix per RFC 6666
                 output += "\nDiscard prefix detected. This is used when forwarding traffic to a sinkhole router to mitigate the effects of a denial-of-service attack. See RFC 6666 for more details.";
                 output += "\nDiscard range: 100::/64";
-            } else if (ipv6[0] === 0x64 && ipv6[1] === 0xff9b && ipv6[2] === 0 &&
-                ipv6[3] === 0 && ipv6[4] === 0 && ipv6[5] === 0) {
+            } else if (ipv6[0] === 0x64 && ipv6[1] === 0xff9b && ipv6[2] === 0 &&
+                ipv6[3] === 0 && ipv6[4] === 0 && ipv6[5] === 0) {
                 // IPv4/IPv6 translation per RFC 6052
                 output += "\n'Well-Known' prefix for IPv4/IPv6 translation detected. See RFC 6052 for more details.";
-                output += "\nTranslated IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]);
+                output += "\nTranslated IPv4 address: " + IP._ipv4_to_str((ipv6[6] << 16) + ipv6[7]);
                 output += "\n'Well-Known prefix range: 64:ff9b::/96";
-            } else if (ipv6[0] === 0x2001 && ipv6[1] === 0) {
+            } else if (ipv6[0] === 0x2001 && ipv6[1] === 0) {
                 // Teredo tunneling
                 output += "\nTeredo tunneling IPv6 address detected\n";
-                var server_ipv4  = (ipv6[2] << 16) + ipv6[3],
-                    udp_port     = (~ipv6[5]) & 0xffff,
-                    client_ipv4  = ~((ipv6[6] << 16) + ipv6[7]),
-                    flag_cone    = (ipv6[4] >>> 15) & 1,
-                    flag_r       = (ipv6[4] >>> 14) & 1,
-                    flag_random1 = (ipv6[4] >>> 10) & 15,
-                    flag_ug      = (ipv6[4] >>> 8) & 3,
-                    flag_random2 = ipv6[4] & 255;
+                var server_ipv4  = (ipv6[2] << 16) + ipv6[3],
+                    udp_port     = (~ipv6[5]) & 0xffff,
+                    client_ipv4  = ~((ipv6[6] << 16) + ipv6[7]),
+                    flag_cone    = (ipv6[4] >>> 15) & 1,
+                    flag_r       = (ipv6[4] >>> 14) & 1,
+                    flag_random1 = (ipv6[4] >>> 10) & 15,
+                    flag_ug      = (ipv6[4] >>> 8) & 3,
+                    flag_random2 = ipv6[4] & 255;
                 
                 output += "\nServer IPv4 address: " + IP._ipv4_to_str(server_ipv4) +
                     "\nClient IPv4 address: " + IP._ipv4_to_str(client_ipv4) +
@@ -159,26 +253,26 @@ var IP = {
                     
                 output += "\n\tRandom2: " + Utils.bin(flag_random2, 8);
                 
-                if (!flag_r && !flag_ug && flag_random1 && flag_random2) {
+                if (!flag_r && !flag_ug && flag_random1 && flag_random2) {
                     output += "\n\nThis is a valid Teredo address which complies with RFC 4380 and RFC 5991.";
-                } else if (!flag_r && !flag_ug) {
+                } else if (!flag_r && !flag_ug) {
                     output += "\n\nThis is a valid Teredo address which complies with RFC 4380, however it does not comply with RFC 5991 (Teredo Security Updates) as there are no randomised bits in the flag field.";
                 } else {
                     output += "\n\nThis is an invalid Teredo address.";
                 }
                 output += "\n\nTeredo prefix range: 2001::/32";
-            } else if (ipv6[0] === 0x2001 && ipv6[1] === 0x2 && ipv6[2] === 0) {
+            } else if (ipv6[0] === 0x2001 && ipv6[1] === 0x2 && ipv6[2] === 0) {
                 // Benchmarking
                 output += "\nAssigned to the Benchmarking Methodology Working Group (BMWG) for benchmarking IPv6. Corresponds to 198.18.0.0/15 for benchmarking IPv4. See RFC 5180 for more details.";
                 output += "\nBMWG range: 2001:2::/48";
-            } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x10 && ipv6[1] <= 0x1f) {
+            } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x10 && ipv6[1] <= 0x1f) {
                 // ORCHIDv1
                 output += "\nDeprecated, previously ORCHIDv1 (Overlay Routable Cryptographic Hash Identifiers).\nORCHIDv1 range: 2001:10::/28\nORCHIDv2 now uses 2001:20::/28.";
-            } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x20 && ipv6[1] <= 0x2f) {
+            } else if (ipv6[0] == 0x2001 && ipv6[1] >= 0x20 && ipv6[1] <= 0x2f) {
                 // ORCHIDv2
                 output += "\nORCHIDv2 (Overlay Routable Cryptographic Hash Identifiers).\nThese are non-routed IPv6 addresses used for Cryptographic Hash Identifiers.";
                 output += "\nORCHIDv2 range: 2001:20::/28";
-            } else if (ipv6[0] == 0x2001 && ipv6[1] == 0xdb8) {
+            } else if (ipv6[0] == 0x2001 && ipv6[1] == 0xdb8) {
                 // Documentation
                 output += "\nThis is a documentation IPv6 address. This range should be used whenever an example IPv6 address is given or to model networking scenarios. Corresponds to 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 in IPv4.";
                 output += "\nDocumentation range: 2001:db8::/32";
@@ -187,7 +281,7 @@ var IP = {
                 output += "\n6to4 transition IPv6 address detected. See RFC 3056 for more details." +
                     "\n6to4 prefix range: 2002::/16";
                 
-                var v4_addr = IP._ipv4_to_str((ipv6[1] << 16) + ipv6[2]),
+                var v4_addr = IP._ipv4_to_str((ipv6[1] << 16) + ipv6[2]),
                     sla_id = ipv6[3],
                     interface_id_str = ipv6[4].toString(16) + ipv6[5].toString(16) + ipv6[6].toString(16) + ipv6[7].toString(16),
                     interface_id = new BigInteger(interface_id_str, 16);
@@ -196,11 +290,11 @@ var IP = {
                     "\nSLA ID: " + sla_id +
                     "\nInterface ID (base 16): " + interface_id_str +
                     "\nInterface ID (base 10): " + interface_id.toString();
-            } else if (ipv6[0] >= 0xfc00 && ipv6[0] <= 0xfdff) {
+            } else if (ipv6[0] >= 0xfc00 && ipv6[0] <= 0xfdff) {
                 // Unique local address
                 output += "\nThis is a unique local address comparable to the IPv4 private addresses 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. See RFC 4193 for more details.";
                 output += "\nUnique local addresses range: fc00::/7";
-            } else if (ipv6[0] >= 0xfe80 && ipv6[0] <= 0xfebf) {
+            } else if (ipv6[0] >= 0xfe80 && ipv6[0] <= 0xfebf) {
                 // Link-local address
                 output += "\nThis is a link-local address comparable to the auto-configuration addresses 169.254.0.0/16 in IPv4.";
                 output += "\nLink-local addresses range: fe80::/10";
@@ -237,7 +331,7 @@ var IP = {
             j = 0;
             
         
-        for (var i = 0; i < lines.length; i++) {
+        for (var i = 0; i < lines.length; i++) {
             if (lines[i] === "") continue;
             var ba_ip = [];
             
@@ -250,16 +344,16 @@ var IP = {
             switch (in_format) {
                 case "Dotted Decimal":
                     var octets = lines[i].split(".");
-                    for (j = 0; j < octets.length; j++) {
+                    for (j = 0; j < octets.length; j++) {
                         ba_ip.push(parseInt(octets[j], 10));
                     }
                     break;
                 case "Decimal":
                     var decimal = lines[i].toString();
-                    ba_ip.push(decimal >> 24 & 255);
-                    ba_ip.push(decimal >> 16 & 255);
-                    ba_ip.push(decimal >> 8 & 255);
-                    ba_ip.push(decimal & 255);
+                    ba_ip.push(decimal >> 24 & 255);
+                    ba_ip.push(decimal >> 16 & 255);
+                    ba_ip.push(decimal >> 8 & 255);
+                    ba_ip.push(decimal & 255);
                     break;
                 case "Hex":
                     ba_ip = Utils.hex_to_byte_array(lines[i]);
@@ -272,18 +366,18 @@ var IP = {
             switch (out_format) {
                 case "Dotted Decimal":
                     var dd_ip = "";
-                    for (j = 0; j < ba_ip.length; j++) {
+                    for (j = 0; j < ba_ip.length; j++) {
                         dd_ip += ba_ip[j] + ".";
                     }
                     output += dd_ip.slice(0, dd_ip.length-1) + "\n";
                     break;
                 case "Decimal":
-                    var dec_ip = ((ba_ip[0] << 24) | (ba_ip[1] << 16) | (ba_ip[2] << 8) | ba_ip[3]) >>> 0;
+                    var dec_ip = ((ba_ip[0] << 24) | (ba_ip[1] << 16) | (ba_ip[2] << 8) | ba_ip[3]) >>> 0;
                     output += dec_ip.toString() + "\n";
                     break;
                 case "Hex":
                     var hex_ip = "";
-                    for (j = 0; j < ba_ip.length; j++) {
+                    for (j = 0; j < ba_ip.length; j++) {
                         hex_ip += Utils.hex(ba_ip[j]);
                     }
                     output += hex_ip + "\n";
@@ -324,7 +418,7 @@ var IP = {
         var delim = Utils.char_rep[args[0]],
             cidr = args[1],
             only_subnets = args[2],
-            ipv4_mask = cidr < 32 ? ~(0xFFFFFFFF >>> cidr) : 0xFFFFFFFF,
+            ipv4_mask = cidr < 32 ? ~(0xFFFFFFFF >>> cidr) : 0xFFFFFFFF,
             ipv6_mask = IP._gen_ipv6_mask(cidr),
             ips = input.split(delim),
             ipv4_networks = {},
@@ -335,15 +429,15 @@ var IP = {
             network = null,
             network_str = "";
             
-        if (cidr < 0 || cidr > 127) {
+        if (cidr < 0 || cidr > 127) {
             return "CIDR must be less than 32 for IPv4 or 128 for IPv6";
         }
             
         // Parse all IPs and add to network dictionary
-        for (var i = 0; i < ips.length; i++) {
+        for (var i = 0; i < ips.length; i++) {
             if (!!(match = IP.IPv4_REGEX.exec(ips[i]))) {
                 ip = IP._str_to_ipv4(match[1]) >>> 0;
-                network = ip & ipv4_mask;
+                network = ip & ipv4_mask;
                 
                 if (ipv4_networks.hasOwnProperty(network)) {
                     ipv4_networks[network].push(ip);
@@ -355,8 +449,8 @@ var IP = {
                 network = [];
                 network_str = "";
                 
-                for (var j = 0; j < 8; j++) {
-                    network.push(ip[j] & ipv6_mask[j]);
+                for (var j = 0; j < 8; j++) {
+                    network.push(ip[j] & ipv6_mask[j]);
                 }
                 
                 network_str = IP._ipv6_to_str(network, true);
@@ -376,7 +470,7 @@ var IP = {
             output += IP._ipv4_to_str(network) + "/" + cidr + "\n";
             
             if (!only_subnets) {
-                for (i = 0; i < ipv4_networks[network].length; i++) {
+                for (i = 0; i < ipv4_networks[network].length; i++) {
                     output += "  " + IP._ipv4_to_str(ipv4_networks[network][i]) + "\n";
                 }
                 output += "\n";
@@ -390,7 +484,7 @@ var IP = {
             output += network_str + "/" + cidr + "\n";
             
             if (!only_subnets) {
-                for (i = 0; i < ipv6_networks[network_str].length; i++) {
+                for (i = 0; i < ipv6_networks[network_str].length; i++) {
                     output += "  " + IP._ipv6_to_str(ipv6_networks[network_str][i], true) + "\n";
                 }
                 output += "\n";
@@ -423,12 +517,12 @@ var IP = {
             network = IP._str_to_ipv4(cidr[1]),
             cidr_range = parseInt(cidr[2], 10);
             
-        if (cidr_range < 0 || cidr_range > 31) {
+        if (cidr_range < 0 || cidr_range > 31) {
             return "IPv4 CIDR must be less than 32";
         }
         
         var mask = ~(0xFFFFFFFF >>> cidr_range),
-            ip1 = network & mask,
+            ip1 = network & mask,
             ip2 = ip1 | ~mask;
         
         if (include_network_info) {
@@ -463,7 +557,7 @@ var IP = {
             network = IP._str_to_ipv6(cidr[1]),
             cidr_range = parseInt(cidr[cidr.length-1], 10);
             
-        if (cidr_range < 0 || cidr_range > 127) {
+        if (cidr_range < 0 || cidr_range > 127) {
             return "IPv6 CIDR must be less than 128";
         }
         
@@ -473,13 +567,13 @@ var IP = {
             total_diff = "",
             total = new Array(128);
             
-        for (var i = 0; i < 8; i++) {
-            ip1[i] = network[i] & mask[i];
-            ip2[i] = ip1[i] | (~mask[i] & 0x0000FFFF);
+        for (var i = 0; i < 8; i++) {
+            ip1[i] = network[i] & mask[i];
+            ip2[i] = ip1[i] | (~mask[i] & 0x0000FFFF);
             total_diff = (ip2[i] - ip1[i]).toString(2);
             
             if (total_diff != "0") {
-                for (var n = 0; n < total_diff.length; n++) {
+                for (var n = 0; n < total_diff.length; n++) {
                     total[i*16 + 16-(total_diff.length-n)] = total_diff[n];
                 }
             }
@@ -509,12 +603,12 @@ var IP = {
         var mask = new Array(8),
             shift;
             
-        for (var i = 0; i < 8; i++) {
+        for (var i = 0; i < 8; i++) {
             if (cidr > ((i+1)*16)) {
                 mask[i] = 0x0000FFFF;
             } else {
                 shift = cidr-(i*16);
-                if (shift < 0) shift = 0;
+                if (shift < 0) shift = 0;
                 mask[i] = ~((0x0000FFFF >>> shift) | 0xFFFF0000);
             }
         }
@@ -547,12 +641,12 @@ var IP = {
         while (diff !== 0) {
             diff >>= 1;
             cidr--;
-            mask = (mask << 1) | 1;
+            mask = (mask << 1) | 1;
         }
         
         mask = ~mask >>> 0;
-        var network = ip1 & mask,
-            sub_ip1 = network & mask,
+        var network = ip1 & mask,
+            sub_ip1 = network & mask,
             sub_ip2 = sub_ip1 | ~mask;
         
         if (include_network_info) {
@@ -567,7 +661,7 @@ var IP = {
         }
         
         if (enumerate_addresses) {
-            if (((ip2 - ip1) >>> 0) <= 65536 || allow_large_list) {
+            if (((ip2 - ip1) >>> 0) <= 65536 || allow_large_list) {
                 output += IP._generate_ipv4_range(ip1, ip2).join("\n");
             } else {
                 output += IP._LARGE_RANGE_ERROR;
@@ -594,13 +688,13 @@ var IP = {
             total = new Array(128);
             
         // Initialise total array to "0"
-        for (var i = 0; i < 128; i++)
+        for (var i = 0; i < 128; i++)
             total[i] = "0";
         
-        for (i = 0; i < 8; i++) {
+        for (i = 0; i < 8; i++) {
             t = (ip2[i] - ip1[i]).toString(2);
             if (t != "0") {
-                for (var n = 0; n < t.length; n++) {
+                for (var n = 0; n < t.length; n++) {
                     total[i*16 + 16-(t.length-n)] = t[n];
                 }
             }
@@ -632,9 +726,9 @@ var IP = {
             num_blocks = parse_blocks(blocks),
             result = 0;
             
-        result += num_blocks[0] << 24;
-        result += num_blocks[1] << 16;
-        result += num_blocks[2] << 8;
+        result += num_blocks[0] << 24;
+        result += num_blocks[1] << 16;
+        result += num_blocks[2] << 8;
         result += num_blocks[3];
         
         return result;
@@ -644,9 +738,9 @@ var IP = {
                 throw "More than 4 blocks.";
                 
             var num_blocks = [];
-            for (var i = 0; i < 4; i++) {
+            for (var i = 0; i < 4; i++) {
                 num_blocks[i] = parseInt(blocks[i], 10);
-                if (num_blocks[i] < 0 || num_blocks[i] > 255)
+                if (num_blocks[i] < 0 || num_blocks[i] > 255)
                     throw "Block out of range.";
             }
             return num_blocks;
@@ -666,10 +760,10 @@ var IP = {
      * IP._ipv4_to_str(168427520);
      */
     _ipv4_to_str: function(ip_int) {
-        var blockA = (ip_int >> 24) & 255,
-            blockB = (ip_int >> 16) & 255,
-            blockC = (ip_int >> 8) & 255,
-            blockD = ip_int & 255;
+        var blockA = (ip_int >> 24) & 255,
+            blockB = (ip_int >> 16) & 255,
+            blockC = (ip_int >> 8) & 255,
+            blockD = ip_int & 255;
         
         return blockA + "." + blockB + "." + blockC + "." + blockD;
     },
@@ -692,7 +786,7 @@ var IP = {
             j = 0,
             ipv6 = new Array(8);
         
-        for (var i = 0; i < 8; i++) {
+        for (var i = 0; i < 8; i++) {
             if (isNaN(num_blocks[j])) {
                 ipv6[i] = 0;
                 if (i == (8-num_blocks.slice(j).length)) j++;
@@ -704,12 +798,12 @@ var IP = {
         return ipv6;
         
         function parse_blocks(blocks) {
-            if (blocks.length < 3 || blocks.length > 8)
+            if (blocks.length < 3 || blocks.length > 8)
                 throw "Badly formatted IPv6 address.";
             var num_blocks = [];
-            for (var i = 0; i < blocks.length; i++) {
+            for (var i = 0; i < blocks.length; i++) {
                 num_blocks[i] = parseInt(blocks[i], 16);
-                if (num_blocks[i] < 0 || num_blocks[i] > 65535)
+                if (num_blocks[i] < 0 || num_blocks[i] > 65535)
                     throw "Block out of range.";
             }
             return num_blocks;
@@ -743,19 +837,19 @@ var IP = {
                 s = 0,
                 e = -1;
                 
-            for (i = 0; i < 8; i++) {
-                if (ipv6[i] === 0 && e === (i-1)) {
+            for (i = 0; i < 8; i++) {
+                if (ipv6[i] === 0 && e === (i-1)) {
                     e = i;
                 } else if (ipv6[i] === 0) {
                     s = i; e = i;
                 }
-                if (e >= 0 && (e-s) > (end - start)) {
+                if (e >= 0 && (e-s) > (end - start)) {
                     start = s;
                     end = e;
                 }
             }
             
-            for (i = 0; i < 8; i++) {
+            for (i = 0; i < 8; i++) {
                 if (i != start) {
                     output += Utils.hex(ipv6[i],1) + ":";
                 } else {
@@ -767,7 +861,7 @@ var IP = {
             if (output[0] === ":")
                 output = ":" + output;
         } else {
-            for (i = 0; i < 8; i++) {
+            for (i = 0; i < 8; i++) {
                 output += Utils.hex(ipv6[i],4) + ":";
             }
         }
@@ -790,7 +884,7 @@ var IP = {
     _generate_ipv4_range: function(ip, end_ip) {
         var range = [];
         if (end_ip >= ip) {
-            for (; ip <= end_ip; ip++) {
+            for (; ip <= end_ip; ip++) {
                 range.push(IP._ipv4_to_str(ip));
             }
         } else {
@@ -800,3 +894,140 @@ var IP = {
     },
 
 };
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_JS.js.html b/docs/operations_JS.js.html new file mode 100755 index 00000000..135a1817 --- /dev/null +++ b/docs/operations_JS.js.html @@ -0,0 +1,390 @@ + + + + + + + CyberChef Source: operations/JS.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/JS.js

+ +
+
+
/* globals esprima, escodegen, esmangle */
+
+/**
+ * JavaScript operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var JS = {
+    
+    /**
+     * @constant
+     * @default
+     */
+    PARSE_LOC: false,
+    /**
+     * @constant
+     * @default
+     */
+    PARSE_RANGE: false,
+    /**
+     * @constant
+     * @default
+     */
+    PARSE_TOKENS: false,
+    /**
+     * @constant
+     * @default
+     */
+    PARSE_COMMENT: false,
+    /**
+     * @constant
+     * @default
+     */
+    PARSE_TOLERANT: false,
+    
+    /**
+     * JavaScript Parser operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_parse: function (input, args) {
+        var parse_loc = args[0],
+            parse_range = args[1],
+            parse_tokens = args[2],
+            parse_comment = args[3],
+            parse_tolerant = args[4],
+            result = {},
+            options = {
+                loc:      parse_loc,
+                range:    parse_range,
+                tokens:   parse_tokens,
+                comment:  parse_comment,
+                tolerant: parse_tolerant
+            };
+            
+        result = esprima.parse(input, options);
+        return JSON.stringify(result, null, 2);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    BEAUTIFY_INDENT: "\\t",
+    /**
+     * @constant
+     * @default
+     */
+    BEAUTIFY_QUOTES: ["Auto", "Single", "Double"],
+    /**
+     * @constant
+     * @default
+     */
+    BEAUTIFY_SEMICOLONS: true,
+    /**
+     * @constant
+     * @default
+     */
+    BEAUTIFY_COMMENT: true,
+    
+    /**
+     * JavaScript Beautify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_beautify: function(input, args) {
+        var beautify_indent = args[0] || JS.BEAUTIFY_INDENT,
+            quotes = args[1].toLowerCase(),
+            beautify_semicolons = args[2],
+            beautify_comment = args[3],
+            result = "",
+            AST;
+            
+        try {
+            AST = esprima.parse(input, {
+                range: true,
+                tokens: true,
+                comment: true
+            });
+            
+            var options = {
+                format: {
+                    indent: {
+                        style: beautify_indent
+                    },
+                    quotes: quotes,
+                    semicolons: beautify_semicolons,
+                },
+                comment: beautify_comment
+            };
+            
+            if (options.comment)
+                AST = escodegen.attachComments(AST, AST.comments, AST.tokens);
+                
+            result = escodegen.generate(AST, options);
+        } catch(e) {
+            // Leave original error so the user can see the detail
+            throw "Unable to parse JavaScript.<br>" + e.message;
+        }
+        return result;
+    },
+    
+    
+    /**
+     * JavaScript Minify operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_minify: function(input, args) {
+        var result = "",
+            AST = esprima.parse(input),
+            optimised_AST = esmangle.optimize(AST, null),
+            mangled_AST = esmangle.mangle(optimised_AST);
+            
+        result = escodegen.generate(mangled_AST, {
+            format: {
+                renumber:    true,
+                hexadecimal: true,
+                escapeless:  true,
+                compact:     true,
+                semicolons:  false,
+                parentheses: false
+            }
+        });
+        return result;
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_MAC.js.html b/docs/operations_MAC.js.html new file mode 100755 index 00000000..36bdfa6f --- /dev/null +++ b/docs/operations_MAC.js.html @@ -0,0 +1,319 @@ + + + + + + + CyberChef Source: operations/MAC.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/MAC.js

+ +
+
+
/**
+ * MAC address operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var MAC = {
+
+    /**
+     * @constant
+     * @default
+     */
+    OUTPUT_CASE: ["Both", "Upper only", "Lower only"],
+    /**
+     * @constant
+     * @default
+     */
+    NO_DELIM: true,
+    /**
+     * @constant
+     * @default
+     */
+    DASH_DELIM: true,
+    /**
+     * @constant
+     * @default
+     */
+    COLON_DELIM: true,
+    /**
+     * @constant
+     * @default
+     */
+    CISCO_STYLE: false,
+
+    /**
+     * Format MAC addresses operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_format: function(input, args) {
+        if (!input) return "";
+    
+        var output_case = args[0],
+            no_delim = args[1],
+            dash_delim = args[2],
+            colon_delim = args[3],
+            cisco_style = args[4],
+            output_list = [],
+            macs = input.toLowerCase().split(/[,\s\r\n]+/);
+
+        macs.forEach(function(mac) {
+            var cleanMac = mac.replace(/[:.-]+/g, ''),
+                macHyphen = cleanMac.replace(/(.{2}(?=.))/g, '$1-'),
+                macColon = cleanMac.replace(/(.{2}(?=.))/g, '$1:'),
+                macCisco = cleanMac.replace(/(.{4}(?=.))/g, '$1.');
+                
+            if (output_case == "Lower only") {
+                if (no_delim) output_list.push(cleanMac);
+                if (dash_delim) output_list.push(macHyphen);
+                if (colon_delim) output_list.push(macColon);
+                if (cisco_style) output_list.push(macCisco);
+            } else if (output_case == "Upper only") {
+                if (no_delim) output_list.push(cleanMac.toUpperCase());
+                if (dash_delim) output_list.push(macHyphen.toUpperCase());
+                if (colon_delim) output_list.push(macColon.toUpperCase());
+                if (cisco_style) output_list.push(macCisco.toUpperCase());
+            } else {
+                if (no_delim) output_list.push(cleanMac, cleanMac.toUpperCase());
+                if (dash_delim) output_list.push(macHyphen, macHyphen.toUpperCase());
+                if (colon_delim) output_list.push(macColon, macColon.toUpperCase());
+                if (cisco_style) output_list.push(macCisco, macCisco.toUpperCase());
+            }
+            
+            output_list.push(
+                "" // Empty line to delimit groups
+            );
+        });
+
+        // Return the data as a string
+        return output_list.join('\n');
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Numberwang.js.html b/docs/operations_Numberwang.js.html new file mode 100755 index 00000000..f4439802 --- /dev/null +++ b/docs/operations_Numberwang.js.html @@ -0,0 +1,258 @@ + + + + + + + CyberChef Source: operations/Numberwang.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Numberwang.js

+ +
+
+
/**
+ * Numberwang operations.
+ *
+ * @author Unknown Male 282
+ * @namespace
+ */
+var Numberwang = {
+
+    /**
+     * Numberwang operation. Remain indoors.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run: function(input, args) {
+        if (!input) return "Let's play Wangernumb!";
+        var match = input.match(/\d+/);
+        if (match) {
+            return match[0] + "! That's Numberwang!";
+        } else {
+            // That's a bad miss!
+            return "Sorry, that's not Numberwang. Let's rotate the board!";
+        }
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_OS.js.html b/docs/operations_OS.js.html new file mode 100755 index 00000000..d1ad5ab8 --- /dev/null +++ b/docs/operations_OS.js.html @@ -0,0 +1,540 @@ + + + + + + + CyberChef Source: operations/OS.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/OS.js

+ +
+
+
/**
+ * Operating system operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var OS = {
+
+    /**
+     * Parse UNIX file permissions operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_parse_unix_perms: function(input, args) {
+        var perms = {
+                d : false,  // directory
+                sl : false, // symbolic link
+                np : false, // named pipe
+                s : false,  // socket
+                cd : false, // character device
+                bd : false, // block device
+                dr : false, // door
+                sb : false, // sticky bit
+                su : false, // setuid
+                sg : false, // setgid
+                ru : false, // read user
+                wu : false, // write user
+                eu : false, // execute user
+                rg : false, // read group
+                wg : false, // write group
+                eg : false, // execute group
+                ro : false, // read other
+                wo : false, // write other
+                eo : false // execute other
+            },
+            d = 0,
+            u = 0,
+            g = 0,
+            o = 0,
+            output = "",
+            octal = null,
+            textual = null;
+        
+        if (input.search(/\s*[0-7]{1,4}\s*/i) === 0) {
+            // Input is octal
+            octal = input.match(/\s*([0-7]{1,4})\s*/i)[1];
+
+            if (octal.length == 4) {
+                d = parseInt(octal[0], 8);
+                u = parseInt(octal[1], 8);
+                g = parseInt(octal[2], 8);
+                o = parseInt(octal[3], 8);
+            } else {
+                if (octal.length > 0) u = parseInt(octal[0], 8);
+                if (octal.length > 1) g = parseInt(octal[1], 8);
+                if (octal.length > 2) o = parseInt(octal[2], 8);
+            }
+            
+            perms.su = d >> 2 & 0x1;
+            perms.sg = d >> 1 & 0x1;
+            perms.sb = d & 0x1;
+                    
+            perms.ru = u >> 2 & 0x1;
+            perms.wu = u >> 1 & 0x1;
+            perms.eu = u & 0x1;
+            
+            perms.rg = g >> 2 & 0x1;
+            perms.wg = g >> 1 & 0x1;
+            perms.eg = g & 0x1;
+            
+            perms.ro = o >> 2 & 0x1;
+            perms.wo = o >> 1 & 0x1;
+            perms.eo = o & 0x1;
+        } else if (input.search(/\s*[dlpcbDrwxsStT-]{1,10}\s*/) === 0) {
+            // Input is textual
+            textual = input.match(/\s*([dlpcbDrwxsStT-]{1,10})\s*/)[1];
+            
+            switch (textual[0]) {
+                case "d":
+                    perms.d = true;
+                    break;
+                case "l":
+                    perms.sl = true;
+                    break;
+                case "p":
+                    perms.np = true;
+                    break;
+                case "s":
+                    perms.s = true;
+                    break;
+                case "c":
+                    perms.cd = true;
+                    break;
+                case "b":
+                    perms.bd = true;
+                    break;
+                case "D":
+                    perms.dr = true;
+                    break;
+            }
+            
+            if (textual.length > 1) perms.ru = textual[1] == "r";
+            if (textual.length > 2) perms.wu = textual[2] == "w";
+            if (textual.length > 3) {
+                switch (textual[3]) {
+                    case "x":
+                        perms.eu = true;
+                        break;
+                    case "s":
+                        perms.eu = true;
+                        perms.su = true;
+                        break;
+                    case "S":
+                        perms.su = true;
+                        break;
+                }
+            }
+            
+            if (textual.length > 4) perms.rg = textual[4] == "r";
+            if (textual.length > 5) perms.wg = textual[5] == "w";
+            if (textual.length > 6) {
+                switch (textual[6]) {
+                    case "x":
+                        perms.eg = true;
+                        break;
+                    case "s":
+                        perms.eg = true;
+                        perms.sg = true;
+                        break;
+                    case "S":
+                        perms.sg = true;
+                        break;
+                }
+            }
+            
+            if (textual.length > 7) perms.ro = textual[7] == "r";
+            if (textual.length > 8) perms.wo = textual[8] == "w";
+            if (textual.length > 9) {
+                switch (textual[9]) {
+                    case "x":
+                        perms.eo = true;
+                        break;
+                    case "t":
+                        perms.eo = true;
+                        perms.sb = true;
+                        break;
+                    case "T":
+                        perms.sb = true;
+                        break;
+                }
+            }
+        } else {
+            return "Invalid input format.\nPlease enter the permissions in either octal (e.g. 755) or textual (e.g. drwxr-xr-x) format.";
+        }
+        
+        output += "Textual representation: " + OS._perms_to_str(perms);
+        output += "\nOctal representation:   " + OS._perms_to_octal(perms);
+ 
+        // File type
+        if (textual) {
+            output += "\nFile type: " + OS._ft_from_perms(perms);
+        }
+        
+        // setuid, setgid
+        if (perms.su) {
+            output += "\nThe setuid flag is set";
+        }
+        if (perms.sg) {
+            output += "\nThe setgid flag is set";
+        }
+        
+        // sticky bit
+        if (perms.sb) {
+            output += "\nThe sticky bit is set";
+        }
+        
+        // Permission matrix
+        output += "\n\n +---------+-------+-------+-------+\n" +
+            " |         | User  | Group | Other |\n" + 
+            " +---------+-------+-------+-------+\n" +
+            " |    Read |   " + (perms.ru ? "X" : " ") + "   |   " + (perms.rg ? "X" : " ") + "   |   " + (perms.ro ? "X" : " ") + "   |\n" +
+            " +---------+-------+-------+-------+\n" +
+            " |   Write |   " + (perms.wu ? "X" : " ") + "   |   " + (perms.wg ? "X" : " ") + "   |   " + (perms.wo ? "X" : " ") + "   |\n" +
+            " +---------+-------+-------+-------+\n" +
+            " | Execute |   " + (perms.eu ? "X" : " ") + "   |   " + (perms.eg ? "X" : " ") + "   |   " + (perms.eo ? "X" : " ") + "   |\n" +
+            " +---------+-------+-------+-------+\n";
+ 
+        return output;
+    },
+    
+    
+    /**
+     * Given a permissions object dictionary, generates a textual permissions string.
+     *
+     * @private
+     * @param {Object} perms
+     * @returns {string}
+     */
+    _perms_to_str: function(perms) {
+        var str = "",
+            type = "-";
+            
+        if (perms.d) type = "d";
+        if (perms.sl) type = "l";
+        if (perms.np) type = "p";
+        if (perms.s) type = "s";
+        if (perms.cd) type = "c";
+        if (perms.bd) type = "b";
+        if (perms.dr) type = "D";
+        
+        str = type;
+        
+        str += perms.ru ? "r" : "-";
+        str += perms.wu ? "w" : "-";
+        if (perms.eu && perms.su) {
+            str += "s";
+        } else if (perms.su) {
+            str += "S";
+        } else if (perms.eu) {
+            str += "x";
+        } else {
+            str += "-";
+        }
+        
+        str += perms.rg ? "r" : "-";
+        str += perms.wg ? "w" : "-";
+        if (perms.eg && perms.sg) {
+            str += "s";
+        } else if (perms.sg) {
+            str += "S";
+        } else if (perms.eg) {
+            str += "x";
+        } else {
+            str += "-";
+        }
+        
+        str += perms.ro ? "r" : "-";
+        str += perms.wo ? "w" : "-";
+        if (perms.eo && perms.sb) {
+            str += "t";
+        } else if (perms.sb) {
+            str += "T";
+        } else if (perms.eo) {
+            str += "x";
+        } else {
+            str += "-";
+        }
+        
+        return str;
+    },
+    
+    
+    /**
+     * Given a permissions object dictionary, generates an octal permissions string.
+     *
+     * @private
+     * @param {Object} perms
+     * @returns {string}
+     */
+    _perms_to_octal: function(perms) {
+        var d = 0,
+            u = 0,
+            g = 0,
+            o = 0;
+        
+        if (perms.su) d += 4;
+        if (perms.sg) d += 2;
+        if (perms.sb) d += 1;
+        
+        if (perms.ru) u += 4;
+        if (perms.wu) u += 2;
+        if (perms.eu) u += 1;
+        
+        if (perms.rg) g += 4;
+        if (perms.wg) g += 2;
+        if (perms.eg) g += 1;
+        
+        if (perms.ro) o += 4;
+        if (perms.wo) o += 2;
+        if (perms.eo) o += 1;
+        
+        return d.toString() + u.toString() + g.toString() + o.toString();
+    },
+    
+    
+    /**
+     * Given a permissions object dictionary, returns the file type.
+     *
+     * @private
+     * @param {Object} perms
+     * @returns {string}
+     */
+    _ft_from_perms: function(perms) {
+        if (perms.d) return "Directory";
+        if (perms.sl) return "Symbolic link";
+        if (perms.np) return "Named pipe";
+        if (perms.s) return "Socket";
+        if (perms.cd) return "Character device";
+        if (perms.bd) return "Block device";
+        if (perms.dr) return "Door";
+        return "Regular file";
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/operations/PublicKey.js b/docs/operations_PublicKey.js.html similarity index 82% rename from src/js/operations/PublicKey.js rename to docs/operations_PublicKey.js.html index 7b7cae62..6fc88c51 100755 --- a/src/js/operations/PublicKey.js +++ b/docs/operations_PublicKey.js.html @@ -1,4 +1,98 @@ -/* globals X509, KJUR, ASN1HEX, KEYUTIL, BigInteger */ + + + + + + + CyberChef Source: operations/PublicKey.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/PublicKey.js

+ +
+
+
/* globals X509, KJUR, ASN1HEX, KEYUTIL, BigInteger */
 
 /**
  * Public Key operations.
@@ -130,7 +224,7 @@ var PublicKey = {
         }
         
         // Format Public Key fields
-        for (var i = 0; i < pk_fields.length; i++) {
+        for (var i = 0; i < pk_fields.length; i++) {
             pk_str += "  " + pk_fields[i].key + ":" +
                 Utils.pad_left(
                     pk_fields[i].value + "\n",
@@ -176,11 +270,11 @@ var PublicKey = {
      * @returns {string}
      */
     run_pem_to_hex: function(input, args) {
-        if (input.indexOf("-----BEGIN") < 0) {
+        if (input.indexOf("-----BEGIN") < 0) {
             // Add header so that the KEYUTIL function works
             input = "-----BEGIN CERTIFICATE-----" + input;
         }
-        if (input.indexOf("-----END") < 0) {
+        if (input.indexOf("-----END") < 0) {
             // Add footer so that the KEYUTIL function works
             input = input + "-----END CERTIFICATE-----";
         }
@@ -268,7 +362,7 @@ var PublicKey = {
             value,
             str;
         
-        for (var i = 0; i < fields.length; i++) {
+        for (var i = 0; i < fields.length; i++) {
             if (!fields[i].length) continue;
             
             key = fields[i].split("=")[0];
@@ -276,7 +370,7 @@ var PublicKey = {
             max_key_len = key.length > max_key_len ? key.length : max_key_len;
         }
         
-        for (i = 0; i < fields.length; i++) {
+        for (i = 0; i < fields.length; i++) {
             if (!fields[i].length) continue;
             
             key = fields[i].split("=")[0];
@@ -304,7 +398,7 @@ var PublicKey = {
         length = length * 3;
         var output = "";
         
-        for (var i = 0; i < byte_str.length; i += length) {
+        for (var i = 0; i < byte_str.length; i += length) {
             var str = byte_str.slice(i, i + length) + "\n";
             if (i === 0) {
                 output += str;
@@ -346,7 +440,7 @@ var PublicKey = {
 X509.hex2dn = function(hDN) {
     var s = "";
     var a = ASN1HEX.getPosArrayOfChildren_AtObj(hDN, 0);
-    for (var i = 0; i < a.length; i++) {
+    for (var i = 0; i < a.length; i++) {
         var hRDN = ASN1HEX.getHexOfTLV_AtObj(hDN, a[i]);
         s = s + ",/|" + X509.hex2rdn(hRDN);
     }
@@ -1050,4 +1144,140 @@ X509.DN_ATTRHEX = {
     '0603550801' : 'X.500-Alg-Encryption',
     '060355080101' : 'rsa',
     '0603604c0101' : 'DPC'
-};
\ No newline at end of file
+};
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Punycode.js.html b/docs/operations_Punycode.js.html new file mode 100755 index 00000000..8502509b --- /dev/null +++ b/docs/operations_Punycode.js.html @@ -0,0 +1,286 @@ + + + + + + + CyberChef Source: operations/Punycode.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Punycode.js

+ +
+
+
/* globals punycode */
+
+/**
+ * Punycode operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Punycode = {
+
+    /**
+     * @constant
+     * @default
+     */
+    IDN: false,
+    
+    /**
+     * To Punycode operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to_ascii: function(input, args) {
+        var idn = args[0];
+        
+        if (idn) {
+            return punycode.ToASCII(input);
+        } else {
+            return punycode.encode(input);
+        }
+    },
+    
+    
+    /**
+     * From Punycode operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to_unicode: function(input, args) {
+        var idn = args[0];
+        
+        if (idn) {
+            return punycode.ToUnicode(input);
+        } else {
+            return punycode.decode(input);
+        }
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_QuotedPrintable.js.html b/docs/operations_QuotedPrintable.js.html new file mode 100755 index 00000000..96e3bcd1 --- /dev/null +++ b/docs/operations_QuotedPrintable.js.html @@ -0,0 +1,501 @@ + + + + + + + CyberChef Source: operations/QuotedPrintable.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/QuotedPrintable.js

+ +
+
+
/** @license
+========================================================================
+  mimelib: http://github.com/andris9/mimelib
+  Copyright (c) 2011-2012 Andris Reinman
+  
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of this software and associated documentation files (the "Software"), to deal
+  in the Software without restriction, including without limitation the rights
+  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+  
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+*/
+
+/**
+ * Quoted Printable operations.
+ * Some parts taken from mimelib (http://github.com/andris9/mimelib)
+ *
+ * @author Andris Reinman
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var QuotedPrintable = {
+    
+    /**
+     * To Quoted Printable operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to: function (input, args) {
+        var mimeEncodedStr = QuotedPrintable.mimeEncode(input);
+        
+        // fix line breaks
+        mimeEncodedStr = mimeEncodedStr.replace(/\r?\n|\r/g, function() {
+            return "\r\n";
+        }).replace(/[\t ]+$/gm, function(spaces) {
+            return spaces.replace(/ /g, "=20").replace(/\t/g, "=09");
+        });
+
+        return QuotedPrintable._addSoftLinebreaks(mimeEncodedStr, "qp");
+    },
+    
+    
+    /**
+     * From Quoted Printable operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_from: function (input, args) {
+        var str = input.replace(/\=(?:\r?\n|$)/g, "");
+        return QuotedPrintable.mimeDecode(str);
+    },
+    
+    
+    /**
+     * Decodes mime-encoded data.
+     *
+     * @param {string} str
+     * @returns {byte_array}
+     */
+    mimeDecode: function(str) {
+        var encodedBytesCount = (str.match(/\=[\da-fA-F]{2}/g) || []).length,
+            bufferLength = str.length - encodedBytesCount * 2,
+            chr, hex,
+            buffer = new Array(bufferLength),
+            bufferPos = 0;
+
+        for (var i = 0, len = str.length; i < len; i++) {
+            chr = str.charAt(i);
+            if (chr == "=" && (hex = str.substr(i + 1, 2)) && /[\da-fA-F]{2}/.test(hex)) {
+                buffer[bufferPos++] = parseInt(hex, 16);
+                i += 2;
+                continue;
+            }
+            buffer[bufferPos++] = chr.charCodeAt(0);
+        }
+
+        return buffer;
+    },
+    
+    
+    /**
+     * Encodes mime data.
+     *
+     * @param {byte_array} buffer
+     * @returns {string}
+     */
+    mimeEncode: function(buffer) {
+        var ranges = [
+                [0x09],
+                [0x0A],
+                [0x0D],
+                [0x20],
+                [0x21],
+                [0x23, 0x3C],
+                [0x3E],
+                [0x40, 0x5E],
+                [0x60, 0x7E]
+            ],
+            result = "";
+
+        for (var i = 0, len = buffer.length; i < len; i++) {
+            if (this._checkRanges(buffer[i], ranges)) {
+                result += String.fromCharCode(buffer[i]);
+                continue;
+            }
+            result += "=" + (buffer[i] < 0x10 ? "0" : "") + buffer[i].toString(16).toUpperCase();
+        }
+
+        return result;
+    },
+    
+    
+    /**
+     * Checks if a given number falls within a given set of ranges.
+     *
+     * @private
+     * @param {number} nr
+     * @param {byte_array[]} ranges
+     * @returns {bolean}
+     */
+    _checkRanges: function(nr, ranges) {
+        for (var i = ranges.length - 1; i >= 0; i--) {
+            if (!ranges[i].length)
+                continue;
+            if (ranges[i].length == 1 && nr == ranges[i][0])
+                return true;
+            if (ranges[i].length == 2 && nr >= ranges[i][0] && nr <= ranges[i][1])
+                return true;
+        }
+        return false;
+    },
+
+    
+    /**
+     * Adds soft line breaks to a string.
+     * Lines can't be longer that 76 + <CR><LF> = 78 bytes
+     * http://tools.ietf.org/html/rfc2045#section-6.7
+     *
+     * @private
+     * @param {string} str
+     * @param {string} encoding
+     * @returns {string}
+     */
+    _addSoftLinebreaks: function(str, encoding) {
+        var lineLengthMax = 76;
+
+        encoding = (encoding || "base64").toString().toLowerCase().trim();
+
+        if (encoding == "qp") {
+            return this._addQPSoftLinebreaks(str, lineLengthMax);
+        } else {
+            return this._addBase64SoftLinebreaks(str, lineLengthMax);
+        }
+    },
+
+    
+    /**
+     * Adds soft line breaks to a base64 string.
+     *
+     * @private
+     * @param {string} base64EncodedStr
+     * @param {number} lineLengthMax
+     * @returns {string}
+     */
+    _addBase64SoftLinebreaks: function(base64EncodedStr, lineLengthMax) {
+        base64EncodedStr = (base64EncodedStr || "").toString().trim();
+        return base64EncodedStr.replace(new RegExp(".{" + lineLengthMax + "}", "g"), "$&\r\n").trim();
+    },
+
+    
+    /**
+     * Adds soft line breaks to a quoted printable string.
+     *
+     * @private
+     * @param {string} mimeEncodedStr
+     * @param {number} lineLengthMax
+     * @returns {string}
+     */
+    _addQPSoftLinebreaks: function(mimeEncodedStr, lineLengthMax) {
+        var pos = 0,
+            len = mimeEncodedStr.length,
+            match, code, line,
+            lineMargin = Math.floor(lineLengthMax / 3),
+            result = "";
+
+        // insert soft linebreaks where needed
+        while (pos < len) {
+            line = mimeEncodedStr.substr(pos, lineLengthMax);
+            if ((match = line.match(/\r\n/))) {
+                line = line.substr(0, match.index + match[0].length);
+                result += line;
+                pos += line.length;
+                continue;
+            }
+
+            if (line.substr(-1) == "\n") {
+                // nothing to change here
+                result += line;
+                pos += line.length;
+                continue;
+            } else if ((match = line.substr(-lineMargin).match(/\n.*?$/))) {
+                // truncate to nearest line break
+                line = line.substr(0, line.length - (match[0].length - 1));
+                result += line;
+                pos += line.length;
+                continue;
+            } else if (line.length > lineLengthMax - lineMargin && (match = line.substr(-lineMargin).match(/[ \t\.,!\?][^ \t\.,!\?]*$/))) {
+                // truncate to nearest space
+                line = line.substr(0, line.length - (match[0].length - 1));
+            } else if (line.substr(-1) == "\r") {
+                line = line.substr(0, line.length - 1);
+            } else {
+                if (line.match(/\=[\da-f]{0,2}$/i)) {
+
+                    // push incomplete encoding sequences to the next line
+                    if ((match = line.match(/\=[\da-f]{0,1}$/i))) {
+                        line = line.substr(0, line.length - match[0].length);
+                    }
+
+                    // ensure that utf-8 sequences are not split
+                    while (line.length > 3 && line.length < len - pos && !line.match(/^(?:=[\da-f]{2}){1,4}$/i) && (match = line.match(/\=[\da-f]{2}$/ig))) {
+                        code = parseInt(match[0].substr(1, 2), 16);
+                        if (code < 128) {
+                            break;
+                        }
+
+                        line = line.substr(0, line.length - 3);
+
+                        if (code >= 0xC0) {
+                            break;
+                        }
+                    }
+
+                }
+            }
+
+            if (pos + line.length < len && line.substr(-1) != "\n") {
+                if (line.length == 76 && line.match(/\=[\da-f]{2}$/i)) {
+                    line = line.substr(0, line.length - 3);
+                } else if (line.length == 76) {
+                    line = line.substr(0, line.length - 1);
+                }
+                pos += line.length;
+                line += "=\r\n";
+            } else {
+                pos += line.length;
+            }
+
+            result += line;
+        }
+
+        return result;
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Rotate.js.html b/docs/operations_Rotate.js.html new file mode 100755 index 00000000..d3feb350 --- /dev/null +++ b/docs/operations_Rotate.js.html @@ -0,0 +1,437 @@ + + + + + + + CyberChef Source: operations/Rotate.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Rotate.js

+ +
+
+
/**
+ * Bit rotation operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ *
+ * @todo Support for UTF16
+ */
+var Rotate = {
+
+    /**
+     * @constant
+     * @default
+     */
+    ROTATE_AMOUNT: 1,
+    /**
+     * @constant
+     * @default
+     */
+    ROTATE_WHOLE: false,
+    
+    /**
+     * Runs rotation operations across the input data.
+     *
+     * @private
+     * @param {byte_array} data
+     * @param {number} amount
+     * @param {function} algo - The rotation operation to carry out
+     * @returns {byte_array}
+     */
+    _rot: function(data, amount, algo) {
+        var result = [];
+        for (var i = 0; i < data.length; i++) {
+            var b = data[i];
+            for (var j = 0; j < amount; j++) {
+                b = algo(b);
+            }
+            result.push(b);
+        }
+        return result;
+    },
+    
+    
+    /**
+     * Rotate right operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_rotr: function(input, args) {
+        if (args[1]) {
+            return Rotate._rotr_whole(input, args[0]);
+        } else {
+            return Rotate._rot(input, args[0], Rotate._rotr);
+        }
+    },
+    
+    
+    /**
+     * Rotate left operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_rotl: function(input, args) {
+        if (args[1]) {
+            return Rotate._rotl_whole(input, args[0]);
+        } else {
+            return Rotate._rot(input, args[0], Rotate._rotl);
+        }
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    ROT13_AMOUNT: 13,
+    /**
+     * @constant
+     * @default
+     */
+    ROT13_LOWERCASE: true,
+    /**
+     * @constant
+     * @default
+     */
+    ROT13_UPPERCASE: true,
+    
+    /**
+     * ROT13 operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_rot13: function(input, args) {
+        var amount = args[2],
+            output = input,
+            chr,
+            rot13_lowercase = args[0],
+            rot13_upperacse = args[1];
+            
+        if (amount) {
+            if (amount < 0) {
+                amount = 26 - (Math.abs(amount) % 26);
+            }
+            
+            for (var i = 0; i < input.length; i++) {
+                chr = input[i];
+                if (rot13_upperacse && chr >= 65 && chr <= 90) { // Upper case
+                    chr = (chr - 65 + amount) % 26;
+                    output[i] = chr + 65;
+                } else if (rot13_lowercase && chr >= 97 && chr <= 122) { // Lower case
+                    chr = (chr - 97 + amount) % 26;
+                    output[i] = chr + 97;
+                }
+            }
+        }
+        return output;
+    },
+    
+    
+    /**
+     * Rotate right bitwise op.
+     *
+     * @private
+     * @param {byte} b
+     * @returns {byte}
+     */
+    _rotr: function(b) {
+        var bit = (b & 1) << 7;
+        return (b >> 1) | bit;
+    },
+    
+    
+    /**
+     * Rotate left bitwise op.
+     *
+     * @private
+     * @param {byte} b
+     * @returns {byte}
+     */
+    _rotl: function(b) {
+        var bit = (b >> 7) & 1;
+        return ((b << 1) | bit) & 0xFF;
+    },
+    
+    
+    /**
+     * Rotates a byte array to the right by a specific amount as a whole, so that bits are wrapped
+     * from the end of the array to the beginning.
+     *
+     * @private
+     * @param {byte_array} data
+     * @param {number} amount
+     * @returns {byte_array}
+     */
+    _rotr_whole: function(data, amount) {
+        var carry_bits = 0,
+            new_byte,
+            result = [];
+        
+        amount = amount % 8;
+        for (var i = 0; i < data.length; i++) {
+            var old_byte = data[i] >>> 0;
+            new_byte = (old_byte >> amount) | carry_bits;
+            carry_bits = (old_byte & (Math.pow(2, amount)-1)) << (8-amount);
+            result.push(new_byte);
+        }
+        result[0] |= carry_bits;
+        return result;
+    },
+    
+    
+    /**
+     * Rotates a byte array to the left by a specific amount as a whole, so that bits are wrapped
+     * from the beginning of the array to the end.
+     *
+     * @private
+     * @param {byte_array} data
+     * @param {number} amount
+     * @returns {byte_array}
+     */
+    _rotl_whole: function(data, amount) {
+        var carry_bits = 0,
+            new_byte,
+            result = [];
+            
+        amount = amount % 8;
+        for (var i = data.length-1; i >= 0; i--) {
+            var old_byte = data[i];
+            new_byte = ((old_byte << amount) | carry_bits) & 0xFF;
+            carry_bits = (old_byte >> (8-amount)) & (Math.pow(2, amount)-1);
+            result[i] = (new_byte);
+        }
+        result[data.length-1] = result[data.length-1] | carry_bits;
+        return result;
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_SeqUtils.js.html b/docs/operations_SeqUtils.js.html new file mode 100755 index 00000000..fe4f3be6 --- /dev/null +++ b/docs/operations_SeqUtils.js.html @@ -0,0 +1,451 @@ + + + + + + + CyberChef Source: operations/SeqUtils.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/SeqUtils.js

+ +
+
+
/**
+ * Sequence utility operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var SeqUtils = {
+
+    /**
+     * @constant
+     * @default
+     */
+    DELIMITER_OPTIONS: ["Line feed", "CRLF", "Space", "Comma", "Semi-colon", "Colon", "Nothing (separate chars)"],
+    /**
+     * @constant
+     * @default
+     */
+    SORT_REVERSE: false,
+    /**
+     * @constant
+     * @default
+     */
+    SORT_ORDER: ["Alphabetical (case sensitive)", "Alphabetical (case insensitive)", "IP address"],
+    
+    /**
+     * Sort operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_sort: function (input, args) {
+        var delim = Utils.char_rep[args[0]],
+            sort_reverse = args[1],
+            order = args[2],
+            sorted = input.split(delim);
+            
+        if (order == "Alphabetical (case sensitive)") {
+            sorted = sorted.sort();
+        } else if (order == "Alphabetical (case insensitive)") {
+            sorted = sorted.sort(SeqUtils._case_insensitive_sort);
+        } else if (order == "IP address") {
+            sorted = sorted.sort(SeqUtils._ip_sort);
+        }
+            
+        if (sort_reverse) sorted.reverse();
+        return sorted.join(delim);
+    },
+    
+    
+    /**
+     * Unique operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_unique: function (input, args) {
+        var delim = Utils.char_rep[args[0]];
+        return input.split(delim).unique().join(delim);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    SEARCH_TYPE: ["Regex", "Extended (\\n, \\t, \\x...)", "Simple string"],
+    
+    /**
+     * Count occurrences operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {number}
+     */
+    run_count: function(input, args) {
+        var search = args[0].string,
+            type = args[0].option;
+            
+        if (type == "Regex" && search) {
+            try {
+                var regex = new RegExp(search, "gi"),
+                    matches = input.match(regex);
+                return matches.length;
+            } catch(err) {
+                return 0;
+            }
+        } else if (search) {
+            if (type.indexOf("Extended") === 0) {
+                search = Utils.parse_escaped_chars(search);
+            }
+            return input.count(search);
+        } else {
+            return 0;
+        }
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    REVERSE_BY: ["Character", "Line"],
+    
+    /**
+     * Reverse operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_reverse: function (input, args) {
+        if (args[0] == "Line") {
+            var lines = [],
+                line = [],
+                result = [];
+            for (var i = 0; i < input.length; i++) {
+                if (input[i] == 0x0a) {
+                    lines.push(line);
+                    line = [];
+                } else {
+                    line.push(input[i]);
+                }
+            }
+            lines.push(line);
+            lines.reverse();
+            for (i = 0; i < lines.length; i++) {
+                result = result.concat(lines[i]);
+                result.push(0x0a);
+            }
+            return result.slice(0, input.length);
+        } else {
+            return input.reverse();
+        }
+    },
+    
+    
+    /**
+     * Add line numbers operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_add_line_numbers: function(input, args) {
+        var lines = input.split("\n"),
+            output = "",
+            width = lines.length.toString().length;
+            
+        for (var n = 0; n < lines.length; n++) {
+            output += Utils.pad((n+1).toString(), width, " ") + " " + lines[n] + "\n";
+        }
+        return output.slice(0, output.length-1);
+    },
+    
+    
+    /**
+     * Remove line numbers operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_remove_line_numbers: function(input, args) {
+        return input.replace(/^[ \t]{0,5}\d+[\s:|\-,.)\]]/gm, "");
+    },
+    
+    
+    /**
+     * Expand alphabet range operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_expand_alph_range: function(input, args) {
+        return Utils.expand_alph_range(input).join(args[0]);
+    },
+    
+    
+    /**
+     * Comparison operation for sorting of strings ignoring case.
+     *
+     * @private
+     * @param {string} a
+     * @param {string} b
+     * @returns {number}
+     */
+    _case_insensitive_sort: function(a, b) {
+        return a.toLowerCase().localeCompare(b.toLowerCase());
+    },
+    
+    
+    /**
+     * Comparison operation for sorting of IPv4 addresses.
+     *
+     * @private
+     * @param {string} a
+     * @param {string} b
+     * @returns {number}
+     */
+    _ip_sort: function(a, b) {
+        var a_ = a.split("."),
+            b_ = b.split(".");
+        
+        a_ = a_[0] * 0x1000000 + a_[1] * 0x10000 + a_[2] * 0x100 + a_[3] * 1;
+        b_ = b_[0] * 0x1000000 + b_[1] * 0x10000 + b_[2] * 0x100 + b_[3] * 1;
+        
+        if (isNaN(a_) && !isNaN(b_)) return 1;
+        if (!isNaN(a_) && isNaN(b_)) return -1;
+        if (isNaN(a_) && isNaN(b_)) return a.localeCompare(b);
+        
+        return a_ - b_;
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/js/operations/StrUtils.js b/docs/operations_StrUtils.js.html similarity index 57% rename from src/js/operations/StrUtils.js rename to docs/operations_StrUtils.js.html index f2bf3706..9c557cb5 100755 --- a/src/js/operations/StrUtils.js +++ b/docs/operations_StrUtils.js.html @@ -1,4 +1,98 @@ -/* globals JsDiff */ + + + + + + + CyberChef Source: operations/StrUtils.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/StrUtils.js

+ +
+
+
/* globals JsDiff */
 
 /**
  * String utility operations.
@@ -34,7 +128,7 @@ var StrUtils = {
         },
         {
             name: "URL",
-            value: "([A-Za-z]+://)([-\\w]+(?:\\.\\w[-\\w]*)+)(:\\d+)?(/[^.!,?;\"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]*(?:[.!,?]+[^.!,?;\"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]+)*)?"
+            value: "([A-Za-z]+://)([-\\w]+(?:\\.\\w[-\\w]*)+)(:\\d+)?(/[^.!,?;\"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]*(?:[.!,?]+[^.!,?;\"\\x27<>()\\[\\]{}\\s\\x7F-\\xFF]+)*)?"
         },
         {
             name: "Domain",
@@ -66,7 +160,7 @@ var StrUtils = {
         },
         {
             name: "Strings",
-            value: "[A-Za-z\\d/\\-:.,_$%\\x27\"()<>= !\\[\\]{}@]{4,}"
+            value: "[A-Za-z\\d/\\-:.,_$%\\x27\"()<>= !\\[\\]{}@]{4,}"
         },
     ],
     /**
@@ -108,7 +202,7 @@ var StrUtils = {
         if (i) modifiers += "i";
         if (m) modifiers += "m";
         
-        if (user_regex && user_regex != "^" && user_regex != "$") {
+        if (user_regex && user_regex != "^" && user_regex != "$") {
             try {
                 var regex = new RegExp(user_regex, modifiers);
                 
@@ -326,11 +420,11 @@ var StrUtils = {
                 return "Invalid 'Diff by' option.";
         }
         
-        for (var i = 0; i < diff.length; i++) {
+        for (var i = 0; i < diff.length; i++) {
             if (diff[i].added) {
-                if (show_added) output += "" + Utils.escape_html(diff[i].value) + "";
+                if (show_added) output += "<span class='hlgreen'>" + Utils.escape_html(diff[i].value) + "</span>";
             } else if (diff[i].removed) {
-                if (show_removed) output += "" + Utils.escape_html(diff[i].value) + "";
+                if (show_removed) output += "<span class='hlred'>" + Utils.escape_html(diff[i].value) + "</span>";
             } else {
                 output += Utils.escape_html(diff[i].value);
             }
@@ -363,22 +457,22 @@ var StrUtils = {
             in_match = false,
             chr;
             
-        if (!samples || samples.length < 2) {
+        if (!samples || samples.length < 2) {
             return "Not enough samples, perhaps you need to modify the sample delimiter or add more data?";
         }
         
         // Initialise output strings
-        for (s = 0; s < samples.length; s++) {
+        for (s = 0; s < samples.length; s++) {
             outputs[s] = "";
         }
         
         // Loop through each character in the first sample
-        for (i = 0; i < samples[0].length; i++) {
+        for (i = 0; i < samples[0].length; i++) {
             chr = samples[0][i];
             match = false;
             
             // Loop through each sample to see if the chars are the same
-            for (s = 1; s < samples.length; s++) {
+            for (s = 1; s < samples.length; s++) {
                 if (samples[s][i] != chr) {
                     match = false;
                     break;
@@ -387,30 +481,30 @@ var StrUtils = {
             }
             
             // Write output for each sample
-            for (s = 0; s < samples.length; s++) {
-                if (samples[s].length <= i) {
-                    if (in_match) outputs[s] += "";
+            for (s = 0; s < samples.length; s++) {
+                if (samples[s].length <= i) {
+                    if (in_match) outputs[s] += "</span>";
                     if (s == samples.length - 1) in_match = false;
                     continue;
                 }
                 
-                if (match && !in_match) {
-                    outputs[s] += "" + Utils.escape_html(samples[s][i]);
-                    if (samples[s].length == i + 1) outputs[s] += "";
+                if (match && !in_match) {
+                    outputs[s] += "<span class='hlgreen'>" + Utils.escape_html(samples[s][i]);
+                    if (samples[s].length == i + 1) outputs[s] += "</span>";
                     if (s == samples.length - 1) in_match = true;
-                } else if (!match && in_match) {
-                    outputs[s] += "" + Utils.escape_html(samples[s][i]);
+                } else if (!match && in_match) {
+                    outputs[s] += "</span>" + Utils.escape_html(samples[s][i]);
                     if (s == samples.length - 1) in_match = false;
                 } else {
                     outputs[s] += Utils.escape_html(samples[s][i]);
-                    if (in_match && samples[s].length == i + 1) {
-                        outputs[s] += "";
+                    if (in_match && samples[s].length == i + 1) {
+                        outputs[s] += "</span>";
                         if (samples[s].length - 1 != i) in_match = false;
                     }
                 }
                 
                 if (samples[0].length - 1 == i) {
-                    if (in_match) outputs[s] += "";
+                    if (in_match) outputs[s] += "</span>";
                     outputs[s] += Utils.escape_html(samples[s].substring(i + 1));
                 }
             }
@@ -453,7 +547,7 @@ var StrUtils = {
             output += Utils.escape_html(input.slice(i, m.index));
             
             // Add match with highlighting
-            output += "" + Utils.escape_html(m[0]) + "";
+            output += "<span class='hl"+hl+"'>" + Utils.escape_html(m[0]) + "</span>";
             
             // Switch highlight
             hl = hl == 1 ? 2 : 1;
@@ -494,7 +588,7 @@ var StrUtils = {
                 output += match[0] + "\n";
             }
             if (capture_groups) {
-                for (var i = 1; i < match.length; i++) {
+                for (var i = 1; i < match.length; i++) {
                     if (matches) {
                         output += "  Group " + i + ": ";
                     }
@@ -510,3 +604,140 @@ var StrUtils = {
     },
     
 };
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Tidy.js.html b/docs/operations_Tidy.js.html new file mode 100755 index 00000000..ace1ad43 --- /dev/null +++ b/docs/operations_Tidy.js.html @@ -0,0 +1,469 @@ + + + + + + + CyberChef Source: operations/Tidy.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Tidy.js

+ +
+
+
/**
+ * Tidy operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Tidy = {
+
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_SPACES : true,
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_CARIAGE_RETURNS : true,
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_LINE_FEEDS : true,
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_TABS : true,
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_FORM_FEEDS : true,
+    /**
+     * @constant
+     * @default
+     */
+    REMOVE_FULL_STOPS : false,
+    
+    /**
+     * Remove whitespace operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_remove_whitespace: function (input, args) {
+        var remove_spaces = args[0],
+            remove_cariage_returns = args[1],
+            remove_line_feeds = args[2],
+            remove_tabs = args[3],
+            remove_form_feeds = args[4],
+            remove_full_stops = args[5],
+            data = input;
+            
+        if (remove_spaces) data = data.replace(/ /g, "");
+        if (remove_cariage_returns) data = data.replace(/\r/g, "");
+        if (remove_line_feeds) data = data.replace(/\n/g, "");
+        if (remove_tabs) data = data.replace(/\t/g, "");
+        if (remove_form_feeds) data = data.replace(/\f/g, "");
+        if (remove_full_stops) data = data.replace(/\./g, "");
+        return data;
+    },
+    
+    
+    /**
+     * Remove null bytes operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_remove_nulls: function (input, args) {
+        var output = [];
+        for (var i = 0; i < input.length; i++) {
+            if (input[i] !== 0) output.push(input[i]);
+        }
+        return output;
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    APPLY_TO_EACH_LINE : false,
+    /**
+     * @constant
+     * @default
+     */
+    DROP_START : 0,
+    /**
+     * @constant
+     * @default
+     */
+    DROP_LENGTH : 5,
+    
+    /**
+     * Drop bytes operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_drop_bytes: function(input, args) {
+        var start = args[0],
+            length = args[1],
+            apply_to_each_line = args[2];
+            
+        if (start < 0 || length < 0)
+            throw "Error: Invalid value";
+            
+        if (!apply_to_each_line)
+            return input.slice(0, start).concat(input.slice(start+length, input.length));
+            
+        // Split input into lines
+        var lines = [],
+            line = [];
+            
+        for (var i = 0; i < input.length; i++) {
+            if (input[i] == 0x0a) {
+                lines.push(line);
+                line = [];
+            } else {
+                line.push(input[i]);
+            }
+        }
+        lines.push(line);
+        
+        var output = [];
+        for (i = 0; i < lines.length; i++) {
+            output = output.concat(lines[i].slice(0, start).concat(lines[i].slice(start+length, lines[i].length)));
+            output.push(0x0a);
+        }
+        return output.slice(0, output.length-1);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    TAKE_START: 0,
+    /**
+     * @constant
+     * @default
+     */
+    TAKE_LENGTH: 5,
+    
+    /**
+     * Take bytes operation.
+     *
+     * @param {byte_array} input
+     * @param {Object[]} args
+     * @returns {byte_array}
+     */
+    run_take_bytes: function(input, args) {
+        var start = args[0],
+            length = args[1],
+            apply_to_each_line = args[2];
+            
+        if (start < 0 || length < 0)
+            throw "Error: Invalid value";
+            
+        if (!apply_to_each_line)
+            return input.slice(start, start+length);
+            
+        // Split input into lines
+        var lines = [],
+            line = [];
+            
+        for (var i = 0; i < input.length; i++) {
+            if (input[i] == 0x0a) {
+                lines.push(line);
+                line = [];
+            } else {
+                line.push(input[i]);
+            }
+        }
+        lines.push(line);
+        
+        var output = [];
+        for (i = 0; i < lines.length; i++) {
+            output = output.concat(lines[i].slice(start, start+length));
+            output.push(0x0a);
+        }
+        return output.slice(0, output.length-1);
+    },
+    
+    
+    /**
+     * @constant
+     * @default
+     */
+    PAD_POSITION : ["Start", "End"],
+    /**
+     * @constant
+     * @default
+     */
+    PAD_LENGTH : 5,
+    /**
+     * @constant
+     * @default
+     */
+    PAD_CHAR : " ",
+    
+    /**
+     * Pad lines operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_pad: function(input, args) {
+        var position = args[0],
+            len = args[1],
+            chr = args[2],
+            lines = input.split("\n"),
+            output = "",
+            i = 0;
+            
+        if (position == "Start") {
+            for (i = 0; i < lines.length; i++) {
+                output += Utils.pad_left(lines[i], lines[i].length+len, chr) + "\n";
+            }
+        } else if (position == "End") {
+            for (i = 0; i < lines.length; i++) {
+                output += Utils.pad_right(lines[i], lines[i].length+len, chr) + "\n";
+            }
+        }
+        
+        return output.slice(0, output.length-1);
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_URL.js.html b/docs/operations_URL.js.html new file mode 100755 index 00000000..1a1c9ed0 --- /dev/null +++ b/docs/operations_URL.js.html @@ -0,0 +1,361 @@ + + + + + + + CyberChef Source: operations/URL.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/URL.js

+ +
+
+
/* globals unescape */
+
+/**
+ * URL operations.
+ * Namespace is appended with an underscore to prevent overwriting the global URL object.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var URL_ = {
+
+    /**
+     * @constant
+     * @default
+     */
+    ENCODE_ALL: false,
+    
+    /**
+     * URL Encode operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_to: function(input, args) {
+        var encode_all = args[0];
+        return encode_all ? URL_._encode_all_chars(input) : encodeURI(input);
+    },
+    
+    
+    /**
+     * URL Decode operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_from: function(input, args) {
+        var data = input.replace(/\+/g, "%20");
+        try {
+            return decodeURIComponent(data);
+        } catch(err) {
+            return unescape(data);
+        }
+    },
+    
+    
+    /**
+     * Parse URI operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_parse: function(input, args) {
+        var a = document.createElement("a");
+        
+        // Overwrite base href which will be the current CyberChef URL to reduce confusion.
+        a.href = "http://example.com/";
+        a.href = input;
+        
+        if (a.protocol) {
+            var output = "";
+            if (a.hostname != window.location.hostname) {
+                output = "Protocol:\t" + a.protocol + "\n";
+                if (a.hostname) output += "Hostname:\t" + a.hostname + "\n";
+                if (a.port) output += "Port:\t\t" + a.port + "\n";
+            }
+            
+            if (a.pathname) {
+                var pathname = a.pathname;
+                if (pathname.indexOf(window.location.pathname) === 0)
+                    pathname = pathname.replace(window.location.pathname, "");
+                if (pathname)
+                    output += "Path name:\t" + pathname + "\n";
+            }
+            
+            if (a.hash) {
+                output += "Hash:\t\t" + a.hash + "\n";
+            }
+            
+            if (a.search) {
+                output += "Arguments:\n";
+                var args_ = (a.search.slice(1, a.search.length)).split("&");
+                var split_args = [], padding = 0;
+                for (var i = 0; i < args_.length; i++) {
+                    split_args.push(args_[i].split("="));
+                    padding = (split_args[i][0].length > padding) ? split_args[i][0].length : padding;
+                }
+                for (i = 0; i < split_args.length; i++) {
+                    output += "\t" + Utils.pad_right(split_args[i][0], padding);
+                    if (split_args[i].length > 1 && split_args[i][1].length)
+                        output += " = " + split_args[i][1] + "\n";
+                    else output += "\n";
+                }
+            }
+                    
+            return output;
+        }
+        
+        return "Invalid URI";
+    },
+    
+    
+    /**
+     * URL encodes additional special characters beyond the standard set.
+     *
+     * @private
+     * @param {string} str
+     * @returns {string}
+     */
+    _encode_all_chars: function(str) {
+        //TODO Do this programatically
+        return encodeURIComponent(str)
+            .replace(/!/g, "%21")
+            .replace(/#/g, "%23")
+            .replace(/'/g, "%27")
+            .replace(/\(/g, "%28")
+            .replace(/\)/g, "%29")
+            .replace(/\*/g, "%2A")
+            .replace(/\-/g, "%2D")
+            .replace(/\./g, "%2E")
+            .replace(/_/g, "%5F")
+            .replace(/~/g, "%7E");
+    },
+    
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_UUID.js.html b/docs/operations_UUID.js.html new file mode 100755 index 00000000..518cea5e --- /dev/null +++ b/docs/operations_UUID.js.html @@ -0,0 +1,270 @@ + + + + + + + CyberChef Source: operations/UUID.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/UUID.js

+ +
+
+
/**
+ * UUID operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var UUID = {
+
+    /**
+     * Generate UUID operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_generate_v4: function(input, args) {
+        if (typeof(window.crypto) !== 'undefined' && typeof(window.crypto.getRandomValues) !== 'undefined') {
+            var buf = new Uint32Array(4),
+                i = 0;
+            window.crypto.getRandomValues(buf);
+            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
+                var r = (buf[i >> 3] >> ((i % 8) * 4)) & 0xf,
+                    v = c === "x" ? r : (r & 0x3 | 0x8);
+                i++;
+                return v.toString(16);
+            });
+        } else {
+            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
+                var r = Math.random() * 16 | 0,
+                    v = c === "x" ? r : (r & 0x3 | 0x8);
+                return v.toString(16);
+            });
+        }
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/operations_Unicode.js.html b/docs/operations_Unicode.js.html new file mode 100755 index 00000000..a9c29a3f --- /dev/null +++ b/docs/operations_Unicode.js.html @@ -0,0 +1,293 @@ + + + + + + + CyberChef Source: operations/Unicode.js + + + + + + + + + + + + + +
+
+ + +
+ +
+ + +

Source: operations/Unicode.js

+ +
+
+
/**
+ * Unicode operations.
+ *
+ * @author n1474335 [n1474335@gmail.com]
+ * @copyright Crown Copyright 2016
+ * @license Apache-2.0
+ *
+ * @namespace
+ */
+var Unicode = {
+
+    /**
+     * @constant
+     * @default
+     */
+    PREFIXES: ["\\u", "%u", "U+"],
+
+    /**
+     * Unescape Unicode Characters operation.
+     *
+     * @param {string} input
+     * @param {Object[]} args
+     * @returns {string}
+     */
+    run_unescape: function(input, args) {
+        var prefix = Unicode._prefix_to_regex[args[0]],
+            regex = new RegExp(prefix+"([a-f\\d]{4,6})", "ig"),
+            output = "",
+            m,
+            i = 0;
+        
+        while (!!(m = regex.exec(input))) {
+            // Add up to match
+            output += input.slice(i, m.index);
+            i = m.index;
+            
+            // Add match
+            output += Utils.chr(parseInt(m[1], 16));
+            
+            i = regex.lastIndex;
+        }
+        
+        // Add all after final match
+        output += input.slice(i, input.length);
+        
+        return output;
+    },
+    
+    
+    /**
+     * Lookup table to add prefixes to unicode delimiters so that they can be used in a regex.
+     *
+     * @private
+     * @constant
+     */
+    _prefix_to_regex: {
+        "\\u": "\\\\u",
+        "%u": "%u",
+        "U+": "U\\+"
+    },
+
+};
+
+
+
+ + + + + +
+
+ +
+ + + +
+
+ + + + + +
+ + + + © Crown Copyright 2016 + + + + Documentation generated by JSDoc 3.4.3 + + on Mon Nov 28th 2016 + + using the DocStrap template. + +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/quicksearch.html b/docs/quicksearch.html new file mode 100755 index 00000000..fcd4bd4f --- /dev/null +++ b/docs/quicksearch.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/docs/scripts/docstrap.lib.js b/docs/scripts/docstrap.lib.js new file mode 100755 index 00000000..09d9272a --- /dev/null +++ b/docs/scripts/docstrap.lib.js @@ -0,0 +1,11 @@ +if(!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b="length"in a&&a.length,c=_.type(a);return"function"!==c&&!_.isWindow(a)&&(!(1!==a.nodeType||!b)||("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a))}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c)}catch(a){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)ra.set(a[c],"globalEval",!b||ra.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(ra.hasData(a)&&(f=ra.access(a),g=ra.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sa.hasData(a)&&(h=sa.access(a),i=_.extend({},h),sa.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ya.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Oa[a];return c||(c=t(a,b),"none"!==c&&c||(Na=(Na||_("