Skip to content

Commit

Permalink
Merge branch 'master' into fix-expectOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
zb3 committed Apr 6, 2024
2 parents 4652608 + 33a473c commit a23e47d
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 54 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ All major and minor version changes will be documented in this file. Details of
[#1667]: https://github.com/gchq/CyberChef/issues/1667
[#1555]: https://github.com/gchq/CyberChef/issues/1555
[#1694]: https://github.com/gchq/CyberChef/issues/1694
[#1699]: https://github.com/gchq/CyberChef/issues/1694
[#1699]: https://github.com/gchq/CyberChef/issues/1699
[#1757]: https://github.com/gchq/CyberChef/issues/1757
[#1752]: https://github.com/gchq/CyberChef/issues/1752
[#1753]: https://github.com/gchq/CyberChef/issues/1753
Expand Down
6 changes: 5 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ module.exports = function (grunt) {


// Project configuration
const compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
const compileYear = grunt.template.today("UTC:yyyy"),
compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
pkg = grunt.file.readJSON("package.json"),
webpackConfig = require("./webpack.config.js"),
BUILD_CONSTANTS = {
COMPILE_YEAR: JSON.stringify(compileYear),
COMPILE_TIME: JSON.stringify(compileTime),
COMPILE_MSG: JSON.stringify(grunt.option("compile-msg") || grunt.option("msg") || ""),
PKG_VERSION: JSON.stringify(pkg.version),
Expand Down Expand Up @@ -125,6 +127,7 @@ module.exports = function (grunt) {
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileYear: compileYear,
compileTime: compileTime,
version: pkg.version,
minify: {
Expand Down Expand Up @@ -227,6 +230,7 @@ module.exports = function (grunt) {
filename: "index.html",
template: "./src/web/html/index.html",
chunks: ["main"],
compileYear: compileYear,
compileTime: compileTime,
version: pkg.version,
})
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cyberchef",
"version": "10.15.0",
"version": "10.15.1",
"description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.",
"author": "n1474335 <n1474335@gmail.com>",
"homepage": "https://gchq.github.io/CyberChef",
Expand Down
2 changes: 1 addition & 1 deletion src/core/Utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ class Utils {


/**
* Converts a string to it's title case equivalent.
* Converts a string to its title case equivalent.
*
* @param {string} str
* @returns string
Expand Down
2 changes: 1 addition & 1 deletion src/core/config/Categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@
"SHA2",
"SHA3",
"SM3",
"MurmurHash3",
"Keccak",
"Shake",
"RIPEMD",
Expand All @@ -413,6 +412,7 @@
"Scrypt",
"NT Hash",
"LM Hash",
"MurmurHash3",
"Fletcher-8 Checksum",
"Fletcher-16 Checksum",
"Fletcher-32 Checksum",
Expand Down
2 changes: 1 addition & 1 deletion src/core/config/scripts/newOperation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class ${moduleName} extends Operation {
this.name = "${result.opName}";
this.module = "${result.module}";
this.description = "${(new EscapeString).run(result.description, ["Special chars", "Double"])}";
this.infoURL = "${result.infoURL}";
this.infoURL = "${result.infoURL}"; // Usually a Wikipedia link. Remember to remove localisation (i.e. https://wikipedia.org/etc rather than https://en.wikipedia.org/etc)
this.inputType = "${result.inputType}";
this.outputType = "${result.outputType}";
this.args = [
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/FileSignatures.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const FILE_SIGNATURES = {
0: 0x00,
1: 0x00,
2: 0x00,
// 3 could be 0x24 or 0x18, so skip it
3: [0x24, 0x18],
4: 0x66, // ftypheic
5: 0x74,
6: 0x79,
Expand Down Expand Up @@ -2748,7 +2748,7 @@ export function extractGIF(bytes, offset) {
stream.moveForwardsBy(11);

// Loop until next Graphic Control Extension.
while (stream.getBytes(2) !== [0x21, 0xf9]) {
while (!Array.from(stream.getBytes(2)).equals([0x21, 0xf9])) {
stream.moveBackwardsBy(2);
stream.moveForwardsBy(stream.readInt(1));
if (!stream.readInt(1))
Expand Down
2 changes: 1 addition & 1 deletion src/core/operations/ChaCha.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ChaCha extends Operation {
super();

this.name = "ChaCha";
this.module = "Default";
this.module = "Ciphers";
this.description = "ChaCha is a stream cipher designed by Daniel J. Bernstein. It is a variant of the Salsa stream cipher. Several parameterizations exist; 'ChaCha' may refer to the original construction, or to the variant as described in RFC-8439. ChaCha is often used with Poly1305, in the ChaCha20-Poly1305 AEAD construction.<br><br><b>Key:</b> ChaCha uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> ChaCha uses a nonce of 8 or 12 bytes (64 or 96 bits).<br><br><b>Counter:</b> ChaCha uses a counter of 4 or 8 bytes (32 or 64 bits); together, the nonce and counter must add up to 16 bytes. The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.";
this.infoURL = "https://wikipedia.org/wiki/Salsa20#ChaCha_variant";
this.inputType = "string";
Expand Down
1 change: 0 additions & 1 deletion src/core/operations/DateTimeDelta.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class DateTimeDelta extends Operation {
this.name = "DateTime Delta";
this.module = "Default";
this.description = "Calculates a new DateTime value given an input DateTime value and a time difference (delta) from the input DateTime value.";
this.infoURL = "";
this.inputType = "string";
this.outputType = "html";
this.args = [
Expand Down
2 changes: 1 addition & 1 deletion src/core/operations/ExtractHashes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExtractHashes extends Operation {
this.name = "Extract hashes";
this.module = "Regex";
this.description = "Extracts potential hashes based on hash character length";
this.infoURL = "https://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions";
this.infoURL = "https://wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions";
this.inputType = "string";
this.outputType = "string";
this.args = [
Expand Down
1 change: 1 addition & 0 deletions src/core/operations/FangURL.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FangURL extends Operation {
this.name = "Fang URL";
this.module = "Default";
this.description = "Takes a 'Defanged' Universal Resource Locator (URL) and 'Fangs' it. Meaning, it removes the alterations (defanged) that render it useless so that it can be used again.";
this.infoURL = "https://isc.sans.edu/forums/diary/Defang+all+the+things/22744/";
this.inputType = "string";
this.outputType = "string";
this.args = [
Expand Down
5 changes: 3 additions & 2 deletions src/core/operations/FileTree.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author sw5678
* @copyright Crown Copyright 2016
* @copyright Crown Copyright 2023
* @license Apache-2.0
*/

Expand All @@ -21,7 +21,8 @@ class FileTree extends Operation {

this.name = "File Tree";
this.module = "Default";
this.description = "Creates file tree from list of file paths (similar to the tree command in Linux)";
this.description = "Creates a file tree from a list of file paths (similar to the tree command in Linux)";
this.infoURL = "https://wikipedia.org/wiki/Tree_(command)";
this.inputType = "string";
this.outputType = "string";
this.args = [
Expand Down
4 changes: 2 additions & 2 deletions src/core/operations/FromFloat.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class FromFloat extends Operation {

this.name = "From Float";
this.module = "Default";
this.description = "Convert from EEE754 Floating Point Numbers";
this.infoURL = "https://en.wikipedia.org/wiki/IEEE_754";
this.description = "Convert from IEEE754 Floating Point Numbers";
this.infoURL = "https://wikipedia.org/wiki/IEEE_754";
this.inputType = "string";
this.outputType = "byteArray";
this.args = [
Expand Down
8 changes: 2 additions & 6 deletions src/core/operations/MurmurHash3.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MurmurHash3 extends Operation {
super();

this.name = "MurmurHash3";
this.module = "Default";
this.module = "Hashing";
this.description = "Generates a MurmurHash v3 for a string input and an optional seed input";
this.infoURL = "https://wikipedia.org/wiki/MurmurHash";
this.inputType = "string";
Expand Down Expand Up @@ -115,11 +115,7 @@ class MurmurHash3 extends Operation {
* @return {number} 32-bit signed integer
*/
unsignedToSigned(value) {
if (value & 0x80000000) {
return -0x100000000 + value;
} else {
return value;
}
return value & 0x80000000 ? -0x100000000 + value : value;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/operations/ParseCSR.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ParseCSR extends Operation {
this.name = "Parse CSR";
this.module = "PublicKey";
this.description = "Parse Certificate Signing Request (CSR) for an X.509 certificate";
this.infoURL = "https://en.wikipedia.org/wiki/Certificate_signing_request";
this.infoURL = "https://wikipedia.org/wiki/Certificate_signing_request";
this.inputType = "string";
this.outputType = "string";
this.args = [
Expand Down
8 changes: 4 additions & 4 deletions src/core/operations/RegularExpression.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class RegularExpression extends Operation {
name: "MAC address",
value: "[A-Fa-f\\d]{2}(?:[:-][A-Fa-f\\d]{2}){5}"
},
{
name: "UUID",
value: "[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}"
},
{
name: "Date (yyyy-mm-dd)",
value: "((?:19|20)\\d\\d)[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])"
Expand All @@ -83,10 +87,6 @@ class RegularExpression extends Operation {
name: "Strings",
value: "[A-Za-z\\d/\\-:.,_$%\\x27\"()<>= !\\[\\]{}@]{4,}"
},
{
name: "UUID (any version)",
value: "[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}"
},
],
"target": 1
},
Expand Down
11 changes: 4 additions & 7 deletions src/core/operations/RisonDecode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RisonDecode extends Operation {
super();

this.name = "Rison Decode";
this.module = "Default";
this.module = "Encodings";
this.description = "Rison, a data serialization format optimized for compactness in URIs. Rison is a slight variation of JSON that looks vastly superior after URI encoding. Rison still expresses exactly the same set of data structures as JSON, so data can be translated back and forth without loss or guesswork.";
this.infoURL = "https://github.com/Nanonid/rison";
this.inputType = "string";
Expand All @@ -29,11 +29,7 @@ class RisonDecode extends Operation {
{
name: "Decode Option",
type: "editableOption",
value: [
{ name: "Decode", value: "Decode", },
{ name: "Decode Object", value: "Decode Object", },
{ name: "Decode Array", value: "Decode Array", },
]
value: ["Decode", "Decode Object", "Decode Array"]
},
];
}
Expand All @@ -52,8 +48,9 @@ class RisonDecode extends Operation {
return rison.decode_object(input);
case "Decode Array":
return rison.decode_array(input);
default:
throw new OperationError("Invalid Decode option");
}
throw new OperationError("Invalid Decode option");
}
}

Expand Down
14 changes: 5 additions & 9 deletions src/core/operations/RisonEncode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,16 @@ class RisonEncode extends Operation {
super();

this.name = "Rison Encode";
this.module = "Default";
this.module = "Encodings";
this.description = "Rison, a data serialization format optimized for compactness in URIs. Rison is a slight variation of JSON that looks vastly superior after URI encoding. Rison still expresses exactly the same set of data structures as JSON, so data can be translated back and forth without loss or guesswork.";
this.infoURL = "https://github.com/Nanonid/rison";
this.inputType = "Object";
this.outputType = "string";
this.args = [
{
name: "Encode Option",
type: "editableOption",
value: [
{ name: "Encode", value: "Encode", },
{ name: "Encode Object", value: "Encode Object", },
{ name: "Encode Array", value: "Encode Array", },
{ name: "Encode URI", value: "Encode URI", }
]
type: "option",
value: ["Encode", "Encode Object", "Encode Array", "Encode URI"]
},
];
}
Expand All @@ -55,8 +50,9 @@ class RisonEncode extends Operation {
return rison.encode_array(input);
case "Encode URI":
return rison.encode_uri(input);
default:
throw new OperationError("Invalid encode option");
}
throw new OperationError("Invalid encode option");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/operations/Salsa20.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Salsa20 extends Operation {
super();

this.name = "Salsa20";
this.module = "Default";
this.module = "Ciphers";
this.description = "Salsa20 is a stream cipher designed by Daniel J. Bernstein and submitted to the eSTREAM project; Salsa20/8 and Salsa20/12 are round-reduced variants. It is closely related to the ChaCha stream cipher.<br><br><b>Key:</b> Salsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> Salsa20 uses a nonce of 8 bytes (64 bits).<br><br><b>Counter:</b> Salsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.";
this.infoURL = "https://wikipedia.org/wiki/Salsa20";
this.inputType = "string";
Expand Down
4 changes: 2 additions & 2 deletions src/core/operations/ToFloat.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ToFloat extends Operation {

this.name = "To Float";
this.module = "Default";
this.description = "Convert to EEE754 Floating Point Numbers";
this.infoURL = "https://en.wikipedia.org/wiki/IEEE_754";
this.description = "Convert to IEEE754 Floating Point Numbers";
this.infoURL = "https://wikipedia.org/wiki/IEEE_754";
this.inputType = "byteArray";
this.outputType = "string";
this.args = [
Expand Down
2 changes: 1 addition & 1 deletion src/core/operations/XSalsa20.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class XSalsa20 extends Operation {
super();

this.name = "XSalsa20";
this.module = "Default";
this.module = "Ciphers";
this.description = "XSalsa20 is a variant of the Salsa20 stream cipher designed by Daniel J. Bernstein; XSalsa uses longer nonces.<br><br><b>Key:</b> XSalsa20 uses a key of 16 or 32 bytes (128 or 256 bits).<br><br><b>Nonce:</b> XSalsa20 uses a nonce of 24 bytes (192 bits).<br><br><b>Counter:</b> XSalsa uses a counter of 8 bytes (64 bits). The counter starts at zero at the start of the keystream, and is incremented at every 64 bytes.";
this.infoURL = "https://en.wikipedia.org/wiki/Salsa20#XSalsa20_with_192-bit_nonce";
this.inputType = "string";
Expand Down
12 changes: 6 additions & 6 deletions src/web/html/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- htmlmin:ignore --><!--
CyberChef - The Cyber Swiss Army Knife
@copyright Crown Copyright 2016
@copyright Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %>
@license Apache-2.0
Copyright 2016 Crown Copyright
Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %> Crown Copyright
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
<meta charset="UTF-8">
<title>CyberChef</title>

<meta name="copyright" content="Crown Copyright 2016" />
<meta name="copyright" content="Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %>" />
<meta name="description" content="The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis" />
<meta name="keywords" content="base64, hex, decode, encode, encrypt, decrypt, compress, decompress, regex, regular expressions, hash, crypt, hexadecimal, user agent, url, certificate, x.509, parser, JSON, gzip, md5, sha1, aes, des, blowfish, xor" />

Expand Down Expand Up @@ -562,10 +562,10 @@ <h5 class="modal-title">CyberChef - The Cyber Swiss Army Knife</h5>
<div class="modal-body">
<img aria-hidden="true" class="about-img-left" src="<%- require('../static/images/cyberchef-128x128.png') %>" alt="CyberChef Logo"/>
<p class="subtext">
Version <%= htmlWebpackPlugin.options.version %><br>
Version <%= htmlWebpackPlugin.options.version %><br>
Compile time: <%= htmlWebpackPlugin.options.compileTime %>
</p>
<p>&copy; Crown Copyright 2016.</p>
<p>&copy; Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %>.</p>
<p>Released under the Apache Licence, Version 2.0.</p>
<p><a href="https://gitter.im/gchq/CyberChef">
<img src="<%- require('../static/images/gitter-badge.svg') %>">
Expand Down Expand Up @@ -861,7 +861,7 @@ <h6>CyberChef v<%= htmlWebpackPlugin.options.version %></h6>
<ul>
<li>Build time: <%= htmlWebpackPlugin.options.compileTime %></li>
<li>The changelog for this version can be viewed <a href="https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md">here</a></li>
<li>&copy; Crown Copyright 2016</li>
<li>&copy; Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %></li>
<li>Released under the Apache Licence, Version 2.0</li>
<li>SHA256 hash: DOWNLOAD_HASH_PLACEHOLDER</li>
</ul>
Expand Down

0 comments on commit a23e47d

Please sign in to comment.