mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-25 01:06:16 -04:00
merge esm
This commit is contained in:
commit
7ce1bf1048
181 changed files with 5628 additions and 3545 deletions
|
@ -25,216 +25,219 @@ const Categories = [
|
|||
{
|
||||
name: "Data format",
|
||||
ops: [
|
||||
"To Hexdump",
|
||||
"From Hexdump",
|
||||
// "To Hexdump",
|
||||
// "From Hexdump",
|
||||
"To Hex",
|
||||
"From Hex",
|
||||
"To Charcode",
|
||||
"From Charcode",
|
||||
"To Decimal",
|
||||
"From Decimal",
|
||||
"To Binary",
|
||||
"From Binary",
|
||||
"To Octal",
|
||||
"From Octal",
|
||||
// "To Charcode",
|
||||
// "From Charcode",
|
||||
// "To Decimal",
|
||||
// "From Decimal",
|
||||
// "To Binary",
|
||||
// "From Binary",
|
||||
// "To Octal",
|
||||
// "From Octal",
|
||||
"To Base64",
|
||||
"From Base64",
|
||||
"Show Base64 offsets",
|
||||
"To Base32",
|
||||
"From Base32",
|
||||
"To Base58",
|
||||
"From Base58",
|
||||
"To Base",
|
||||
"From Base",
|
||||
"To BCD",
|
||||
"From BCD",
|
||||
"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",
|
||||
"Encode text",
|
||||
"Decode text",
|
||||
"Swap endianness",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Encryption / Encoding",
|
||||
ops: [
|
||||
"AES Encrypt",
|
||||
"AES Decrypt",
|
||||
"Blowfish Encrypt",
|
||||
"Blowfish Decrypt",
|
||||
"DES Encrypt",
|
||||
"DES Decrypt",
|
||||
"Triple DES Encrypt",
|
||||
"Triple DES Decrypt",
|
||||
"RC2 Encrypt",
|
||||
"RC2 Decrypt",
|
||||
"RC4",
|
||||
"RC4 Drop",
|
||||
"ROT13",
|
||||
"ROT47",
|
||||
"XOR",
|
||||
"XOR Brute Force",
|
||||
"Vigenère Encode",
|
||||
"Vigenère Decode",
|
||||
"To Morse Code",
|
||||
"From Morse Code",
|
||||
"Bifid Cipher Encode",
|
||||
"Bifid Cipher Decode",
|
||||
"Affine Cipher Encode",
|
||||
"Affine Cipher Decode",
|
||||
"Atbash Cipher",
|
||||
"Substitute",
|
||||
"Derive PBKDF2 key",
|
||||
"Derive EVP key",
|
||||
"Pseudo-Random Number Generator",
|
||||
]
|
||||
},
|
||||
{
|
||||
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: "Arithmetic / Logic",
|
||||
ops: [
|
||||
"XOR",
|
||||
"XOR Brute Force",
|
||||
"OR",
|
||||
"NOT",
|
||||
"AND",
|
||||
"ADD",
|
||||
"SUB",
|
||||
"Sum",
|
||||
"Subtract",
|
||||
"Multiply",
|
||||
"Divide",
|
||||
"Mean",
|
||||
"Median",
|
||||
"Standard Deviation",
|
||||
"Bit shift left",
|
||||
"Bit shift right",
|
||||
"Rotate left",
|
||||
"Rotate right",
|
||||
"ROT13",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Networking",
|
||||
ops: [
|
||||
"HTTP request",
|
||||
"Strip HTTP headers",
|
||||
"Parse User Agent",
|
||||
"Parse IP range",
|
||||
"Parse IPv6 address",
|
||||
"Parse IPv4 header",
|
||||
"Parse URI",
|
||||
"URL Encode",
|
||||
"URL Decode",
|
||||
"Format MAC addresses",
|
||||
"Change IP format",
|
||||
"Group IP addresses",
|
||||
"Encode NetBIOS Name",
|
||||
"Decode NetBIOS Name",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Language",
|
||||
ops: [
|
||||
"Encode text",
|
||||
"Decode text",
|
||||
"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",
|
||||
"Filter",
|
||||
"Head",
|
||||
"Tail",
|
||||
"Count occurrences",
|
||||
"Expand alphabet range",
|
||||
"Drop bytes",
|
||||
"Take bytes",
|
||||
"Pad lines",
|
||||
"Find / Replace",
|
||||
"Regular expression",
|
||||
"Offset checker",
|
||||
"Hamming Distance",
|
||||
"Convert distance",
|
||||
"Convert area",
|
||||
"Convert mass",
|
||||
"Convert speed",
|
||||
"Convert data units",
|
||||
"Parse UNIX file permissions",
|
||||
"Swap endianness",
|
||||
"Parse colour code",
|
||||
"Escape string",
|
||||
"Unescape string",
|
||||
"Pseudo-Random Number Generator",
|
||||
"Sleep",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Date / Time",
|
||||
ops: [
|
||||
"Parse DateTime",
|
||||
"Translate DateTime Format",
|
||||
"From UNIX Timestamp",
|
||||
"To UNIX Timestamp",
|
||||
"Windows Filetime to UNIX Timestamp",
|
||||
"UNIX Timestamp to Windows Filetime",
|
||||
"Extract dates",
|
||||
"Sleep",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Extractors",
|
||||
ops: [
|
||||
"Strings",
|
||||
"Extract IP addresses",
|
||||
"Extract email addresses",
|
||||
"Extract MAC addresses",
|
||||
"Extract URLs",
|
||||
"Extract domains",
|
||||
"Extract file paths",
|
||||
"Extract dates",
|
||||
"Regular expression",
|
||||
"XPath expression",
|
||||
"JPath expression",
|
||||
"CSS selector",
|
||||
"Extract EXIF",
|
||||
// "To Base58",
|
||||
// "From Base58",
|
||||
// "To Base",
|
||||
// "From Base",
|
||||
// "To BCD",
|
||||
// "From BCD",
|
||||
// "To HTML Entity",
|
||||
// "From HTML Entity",
|
||||
// "URL Encode",
|
||||
// "URL Decode",
|
||||
// "Escape Unicode Characters",
|
||||
// "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",
|
||||
// "Encode text",
|
||||
// "Decode text",
|
||||
// "Swap endianness",
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "Encryption / Encoding",
|
||||
// ops: [
|
||||
// "AES Encrypt",
|
||||
// "AES Decrypt",
|
||||
// "Blowfish Encrypt",
|
||||
// "Blowfish Decrypt",
|
||||
// "DES Encrypt",
|
||||
// "DES Decrypt",
|
||||
// "Triple DES Encrypt",
|
||||
// "Triple DES Decrypt",
|
||||
// "RC2 Encrypt",
|
||||
// "RC2 Decrypt",
|
||||
// "RC4",
|
||||
// "RC4 Drop",
|
||||
// "ROT13",
|
||||
// "ROT47",
|
||||
// "XOR",
|
||||
// "XOR Brute Force",
|
||||
// "Vigenère Encode",
|
||||
// "Vigenère Decode",
|
||||
// "To Morse Code",
|
||||
// "From Morse Code",
|
||||
// "Bifid Cipher Encode",
|
||||
// "Bifid Cipher Decode",
|
||||
// "Affine Cipher Encode",
|
||||
// "Affine Cipher Decode",
|
||||
// "Atbash Cipher",
|
||||
// "Substitute",
|
||||
// "Derive PBKDF2 key",
|
||||
// "Derive EVP key",
|
||||
// "Bcrypt",
|
||||
// "Scrypt",
|
||||
// "Pseudo-Random Number Generator",
|
||||
]
|
||||
},
|
||||
// {
|
||||
// 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: "Arithmetic / Logic",
|
||||
// ops: [
|
||||
// "XOR",
|
||||
// "XOR Brute Force",
|
||||
// "OR",
|
||||
// "NOT",
|
||||
// "AND",
|
||||
// "ADD",
|
||||
// "SUB",
|
||||
// "Sum",
|
||||
// "Subtract",
|
||||
// "Multiply",
|
||||
// "Divide",
|
||||
// "Mean",
|
||||
// "Median",
|
||||
// "Standard Deviation",
|
||||
// "Bit shift left",
|
||||
// "Bit shift right",
|
||||
// "Rotate left",
|
||||
// "Rotate right",
|
||||
// "ROT13",
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "Networking",
|
||||
// ops: [
|
||||
// "HTTP request",
|
||||
// "Strip HTTP headers",
|
||||
// "Parse User Agent",
|
||||
// "Parse IP range",
|
||||
// "Parse IPv6 address",
|
||||
// "Parse IPv4 header",
|
||||
// "Parse URI",
|
||||
// "URL Encode",
|
||||
// "URL Decode",
|
||||
// "Format MAC addresses",
|
||||
// "Change IP format",
|
||||
// "Group IP addresses",
|
||||
// "Encode NetBIOS Name",
|
||||
// "Decode NetBIOS Name",
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "Language",
|
||||
// ops: [
|
||||
// "Encode text",
|
||||
// "Decode text",
|
||||
// "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",
|
||||
// "Filter",
|
||||
// "Head",
|
||||
// "Tail",
|
||||
// "Count occurrences",
|
||||
// "Expand alphabet range",
|
||||
// "Drop bytes",
|
||||
// "Take bytes",
|
||||
// "Pad lines",
|
||||
// "Find / Replace",
|
||||
// "Regular expression",
|
||||
// "Offset checker",
|
||||
// "Hamming Distance",
|
||||
// "Convert distance",
|
||||
// "Convert area",
|
||||
// "Convert mass",
|
||||
// "Convert speed",
|
||||
// "Convert data units",
|
||||
// "Parse UNIX file permissions",
|
||||
// "Swap endianness",
|
||||
// "Parse colour code",
|
||||
// "Escape string",
|
||||
// "Unescape string",
|
||||
// "Pseudo-Random Number Generator",
|
||||
// "Sleep",
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "Date / Time",
|
||||
// ops: [
|
||||
// "Parse DateTime",
|
||||
// "Translate DateTime Format",
|
||||
// "From UNIX Timestamp",
|
||||
// "To UNIX Timestamp",
|
||||
// "Windows Filetime to UNIX Timestamp",
|
||||
// "UNIX Timestamp to Windows Filetime",
|
||||
// "Extract dates",
|
||||
// "Sleep",
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "Extractors",
|
||||
// ops: [
|
||||
// "Strings",
|
||||
// "Extract IP addresses",
|
||||
// "Extract email addresses",
|
||||
// "Extract MAC addresses",
|
||||
// "Extract URLs",
|
||||
// "Extract domains",
|
||||
// "Extract file paths",
|
||||
// "Extract dates",
|
||||
// "Regular expression",
|
||||
// "XPath expression",
|
||||
// "JPath expression",
|
||||
// "CSS selector",
|
||||
// "Extract EXIF",
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
name: "Compression",
|
||||
ops: [
|
||||
|
@ -246,107 +249,112 @@ const Categories = [
|
|||
"Gunzip",
|
||||
"Zip",
|
||||
"Unzip",
|
||||
"Bzip2 Decompress",
|
||||
"Tar",
|
||||
"Untar",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Hashing",
|
||||
ops: [
|
||||
"Analyse hash",
|
||||
"Generate all hashes",
|
||||
"MD2",
|
||||
"MD4",
|
||||
"MD5",
|
||||
"MD6",
|
||||
"SHA0",
|
||||
"SHA1",
|
||||
"SHA2",
|
||||
"SHA3",
|
||||
"Keccak",
|
||||
"Shake",
|
||||
"RIPEMD",
|
||||
"HAS-160",
|
||||
"Whirlpool",
|
||||
"Snefru",
|
||||
"SSDEEP",
|
||||
"CTPH",
|
||||
"Compare SSDEEP hashes",
|
||||
"Compare CTPH hashes",
|
||||
"HMAC",
|
||||
"Fletcher-8 Checksum",
|
||||
"Fletcher-16 Checksum",
|
||||
"Fletcher-32 Checksum",
|
||||
"Fletcher-64 Checksum",
|
||||
"Adler-32 Checksum",
|
||||
"CRC-16 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",
|
||||
"XPath expression",
|
||||
"JPath expression",
|
||||
"CSS selector",
|
||||
"PHP Deserialize",
|
||||
"Microsoft Script Decoder",
|
||||
"Strip HTML tags",
|
||||
"Diff",
|
||||
"To Snake case",
|
||||
"To Camel case",
|
||||
"To Kebab case",
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Other",
|
||||
ops: [
|
||||
"Entropy",
|
||||
"Frequency distribution",
|
||||
"Chi Square",
|
||||
"Detect File Type",
|
||||
"Scan for Embedded Files",
|
||||
"Disassemble x86",
|
||||
"Pseudo-Random Number Generator",
|
||||
"Generate UUID",
|
||||
"Generate TOTP",
|
||||
"Generate HOTP",
|
||||
"Render Image",
|
||||
"Remove EXIF",
|
||||
"Extract EXIF",
|
||||
"Numberwang",
|
||||
"XKCD Random Number",
|
||||
"Set Operations"
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Flow control",
|
||||
ops: [
|
||||
"Fork",
|
||||
"Merge",
|
||||
"Register",
|
||||
"Label",
|
||||
"Jump",
|
||||
"Conditional Jump",
|
||||
"Return",
|
||||
"Comment"
|
||||
// "Bzip2 Decompress",
|
||||
// "Tar",
|
||||
// "Untar",
|
||||
]
|
||||
},
|
||||
// {
|
||||
// name: "Hashing",
|
||||
// ops: [
|
||||
// "Analyse hash",
|
||||
// "Generate all hashes",
|
||||
// "MD2",
|
||||
// "MD4",
|
||||
// "MD5",
|
||||
// "MD6",
|
||||
// "SHA0",
|
||||
// "SHA1",
|
||||
// "SHA2",
|
||||
// "SHA3",
|
||||
// "Keccak",
|
||||
// "Shake",
|
||||
// "RIPEMD",
|
||||
// "HAS-160",
|
||||
// "Whirlpool",
|
||||
// "Snefru",
|
||||
// "SSDEEP",
|
||||
// "CTPH",
|
||||
// "Compare SSDEEP hashes",
|
||||
// "Compare CTPH hashes",
|
||||
// "HMAC",
|
||||
// "Bcrypt",
|
||||
// "Bcrypt compare",
|
||||
// "Bcrypt parse",
|
||||
// "Scrypt",
|
||||
// "Fletcher-8 Checksum",
|
||||
// "Fletcher-16 Checksum",
|
||||
// "Fletcher-32 Checksum",
|
||||
// "Fletcher-64 Checksum",
|
||||
// "Adler-32 Checksum",
|
||||
// "CRC-16 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",
|
||||
// "XPath expression",
|
||||
// "JPath expression",
|
||||
// "CSS selector",
|
||||
// "PHP Deserialize",
|
||||
// "Microsoft Script Decoder",
|
||||
// "Strip HTML tags",
|
||||
// "Diff",
|
||||
// "To Snake case",
|
||||
// "To Camel case",
|
||||
// "To Kebab case",
|
||||
// "BSON serialise",
|
||||
// "BSON deserialise",
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "Other",
|
||||
// ops: [
|
||||
// "Entropy",
|
||||
// "Frequency distribution",
|
||||
// "Chi Square",
|
||||
// "Detect File Type",
|
||||
// "Scan for Embedded Files",
|
||||
// "Disassemble x86",
|
||||
// "Pseudo-Random Number Generator",
|
||||
// "Generate UUID",
|
||||
// "Generate TOTP",
|
||||
// "Generate HOTP",
|
||||
// "Render Image",
|
||||
// "Remove EXIF",
|
||||
// "Extract EXIF",
|
||||
// "Numberwang",
|
||||
// "XKCD Random Number",
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// name: "Flow control",
|
||||
// ops: [
|
||||
// "Fork",
|
||||
// "Merge",
|
||||
// "Register",
|
||||
// "Label",
|
||||
// "Jump",
|
||||
// "Conditional Jump",
|
||||
// "Return",
|
||||
// "Comment"
|
||||
// ]
|
||||
// },
|
||||
];
|
||||
|
||||
export default Categories;
|
||||
|
|
1
src/core/config/MetaConfig.js
Normal file
1
src/core/config/MetaConfig.js
Normal file
File diff suppressed because one or more lines are too long
461
src/core/config/OperationConfig.json
Normal file
461
src/core/config/OperationConfig.json
Normal file
|
@ -0,0 +1,461 @@
|
|||
{
|
||||
"From Base32": {
|
||||
"module": "Default",
|
||||
"description": "Base32 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. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",
|
||||
"inputType": "string",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Alphabet",
|
||||
"type": "binaryString",
|
||||
"value": "A-Z2-7="
|
||||
},
|
||||
{
|
||||
"name": "Remove non-alphabet chars",
|
||||
"type": "boolean",
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"From Base64": {
|
||||
"module": "Default",
|
||||
"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>",
|
||||
"inputType": "string",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Alphabet",
|
||||
"type": "editableOption",
|
||||
"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+/="
|
||||
},
|
||||
{
|
||||
"name": "UNIX crypt: ./0-9A-Za-z",
|
||||
"value": "./0-9A-Za-z"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Remove non-alphabet chars",
|
||||
"type": "boolean",
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"From Hex": {
|
||||
"module": "Default",
|
||||
"description": "Converts a hexadecimal byte string back into 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>",
|
||||
"inputType": "string",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Delimiter",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Space",
|
||||
"Comma",
|
||||
"Semi-colon",
|
||||
"Colon",
|
||||
"Line feed",
|
||||
"CRLF",
|
||||
"0x",
|
||||
"\\x",
|
||||
"None"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"Gunzip": {
|
||||
"module": "Compression",
|
||||
"description": "Decompresses data which has been compressed using the deflate algorithm with gzip headers.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": []
|
||||
},
|
||||
"Gzip": {
|
||||
"module": "Compression",
|
||||
"description": "Compresses data using the deflate algorithm with gzip headers.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Compression type",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Dynamic Huffman Coding",
|
||||
"Fixed Huffman Coding",
|
||||
"None (Store)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Filename (optional)",
|
||||
"type": "string",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "Comment (optional)",
|
||||
"type": "string",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "Include file checksum",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"Raw Deflate": {
|
||||
"module": "Compression",
|
||||
"description": "Compresses data using the deflate algorithm with no headers.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Compression type",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Dynamic Huffman Coding",
|
||||
"Fixed Huffman Coding",
|
||||
"None (Store)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"Raw Inflate": {
|
||||
"module": "Compression",
|
||||
"description": "Decompresses data which has been compressed using the deflate algorithm with no headers.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Start index",
|
||||
"type": "number",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Initial output buffer size",
|
||||
"type": "number",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Buffer expansion type",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Adaptive",
|
||||
"Block"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Resize buffer after decompression",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"name": "Verify result",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"Show Base64 offsets": {
|
||||
"module": "Default",
|
||||
"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.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "html",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Alphabet",
|
||||
"type": "binaryString",
|
||||
"value": "A-Za-z0-9+/="
|
||||
},
|
||||
{
|
||||
"name": "Show variable chars and padding",
|
||||
"type": "boolean",
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"To Base32": {
|
||||
"module": "Default",
|
||||
"description": "Base32 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. It uses a smaller set of characters than Base64, usually the uppercase alphabet and the numbers 2 to 7.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "string",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Alphabet",
|
||||
"type": "binaryString",
|
||||
"value": "A-Z2-7="
|
||||
}
|
||||
]
|
||||
},
|
||||
"To Base64": {
|
||||
"module": "Default",
|
||||
"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>",
|
||||
"inputType": "ArrayBuffer",
|
||||
"outputType": "string",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Alphabet",
|
||||
"type": "editableOption",
|
||||
"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+/="
|
||||
},
|
||||
{
|
||||
"name": "UNIX crypt: ./0-9A-Za-z",
|
||||
"value": "./0-9A-Za-z"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"To Hex": {
|
||||
"module": "Default",
|
||||
"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>",
|
||||
"inputType": "ArrayBuffer",
|
||||
"outputType": "string",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Delimiter",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Space",
|
||||
"Comma",
|
||||
"Semi-colon",
|
||||
"Colon",
|
||||
"Line feed",
|
||||
"CRLF",
|
||||
"0x",
|
||||
"\\x",
|
||||
"None"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unzip": {
|
||||
"module": "Compression",
|
||||
"description": "Decompresses data using the PKZIP algorithm and displays it per file, with support for passwords.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Password",
|
||||
"type": "binaryString",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "Verify result",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"Zip": {
|
||||
"module": "Compression",
|
||||
"description": "Compresses data using the PKZIP algorithm with the given filename.<br><br>No support for multiple files at this time.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Filename",
|
||||
"type": "string",
|
||||
"value": "file.txt"
|
||||
},
|
||||
{
|
||||
"name": "Comment",
|
||||
"type": "string",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "Password",
|
||||
"type": "binaryString",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "Compression method",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Deflate",
|
||||
"None (Store)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Operating system",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"MSDOS",
|
||||
"Unix",
|
||||
"Macintosh"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Compression type",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Dynamic Huffman Coding",
|
||||
"Fixed Huffman Coding",
|
||||
"None (Store)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"Zlib Deflate": {
|
||||
"module": "Compression",
|
||||
"description": "Compresses data using the deflate algorithm adding zlib headers.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Compression type",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Dynamic Huffman Coding",
|
||||
"Fixed Huffman Coding",
|
||||
"None (Store)"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"Zlib Inflate": {
|
||||
"module": "Compression",
|
||||
"description": "Decompresses data which has been compressed using the deflate algorithm with zlib headers.",
|
||||
"inputType": "byteArray",
|
||||
"outputType": "byteArray",
|
||||
"flowControl": false,
|
||||
"args": [
|
||||
{
|
||||
"name": "Start index",
|
||||
"type": "number",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Initial output buffer size",
|
||||
"type": "number",
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"name": "Buffer expansion type",
|
||||
"type": "option",
|
||||
"value": [
|
||||
"Adaptive",
|
||||
"Block"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Resize buffer after decompression",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"name": "Verify result",
|
||||
"type": "boolean",
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
import CharEnc from "../../operations/CharEnc.js";
|
||||
|
||||
|
||||
/**
|
||||
* CharEnc module.
|
||||
*
|
||||
* Libraries:
|
||||
* - cptable
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.CharEnc = {
|
||||
"Encode text": CharEnc.runEncode,
|
||||
"Decode text": CharEnc.runDecode,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,44 +0,0 @@
|
|||
import Cipher from "../../operations/Cipher.js";
|
||||
|
||||
|
||||
/**
|
||||
* Ciphers module.
|
||||
*
|
||||
* Libraries:
|
||||
* - CryptoJS
|
||||
* - Blowfish
|
||||
* - Forge
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Ciphers = {
|
||||
"AES Encrypt": Cipher.runAesEnc,
|
||||
"AES Decrypt": Cipher.runAesDec,
|
||||
"Blowfish Encrypt": Cipher.runBlowfishEnc,
|
||||
"Blowfish Decrypt": Cipher.runBlowfishDec,
|
||||
"DES Encrypt": Cipher.runDesEnc,
|
||||
"DES Decrypt": Cipher.runDesDec,
|
||||
"Triple DES Encrypt": Cipher.runTripleDesEnc,
|
||||
"Triple DES Decrypt": Cipher.runTripleDesDec,
|
||||
"Derive PBKDF2 key": Cipher.runPbkdf2,
|
||||
"Derive EVP key": Cipher.runEvpkdf,
|
||||
"RC4": Cipher.runRc4,
|
||||
"RC4 Drop": Cipher.runRc4drop,
|
||||
"RC2 Encrypt": Cipher.runRc2Enc,
|
||||
"RC2 Decrypt": Cipher.runRc2Dec,
|
||||
"Vigenère Encode": Cipher.runVigenereEnc,
|
||||
"Vigenère Decode": Cipher.runVigenereDec,
|
||||
"Bifid Cipher Encode": Cipher.runBifidEnc,
|
||||
"Bifid Cipher Decode": Cipher.runBifidDec,
|
||||
"Affine Cipher Encode": Cipher.runAffineEnc,
|
||||
"Affine Cipher Decode": Cipher.runAffineDec,
|
||||
"Atbash Cipher": Cipher.runAtbash,
|
||||
"Substitute": Cipher.runSubstitute,
|
||||
"Pseudo-Random Number Generator": Cipher.runPRNG,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,44 +0,0 @@
|
|||
import JS from "../../operations/JS.js";
|
||||
import Code from "../../operations/Code.js";
|
||||
|
||||
|
||||
/**
|
||||
* Code module.
|
||||
*
|
||||
* Libraries:
|
||||
* - lodash
|
||||
* - vkbeautify
|
||||
* - xmldom
|
||||
* - xpath
|
||||
* - jpath
|
||||
* - highlight.js
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Code = {
|
||||
"JavaScript Parser": JS.runParse,
|
||||
"JavaScript Beautify": JS.runBeautify,
|
||||
"JavaScript Minify": JS.runMinify,
|
||||
"Syntax highlighter": Code.runSyntaxHighlight,
|
||||
"Generic Code Beautify": Code.runGenericBeautify,
|
||||
"JSON Beautify": Code.runJsonBeautify,
|
||||
"JSON Minify": Code.runJsonMinify,
|
||||
"XML Beautify": Code.runXmlBeautify,
|
||||
"XML Minify": Code.runXmlMinify,
|
||||
"SQL Beautify": Code.runSqlBeautify,
|
||||
"SQL Minify": Code.runSqlMinify,
|
||||
"CSS Beautify": Code.runCssBeautify,
|
||||
"CSS Minify": Code.runCssMinify,
|
||||
"XPath expression": Code.runXpath,
|
||||
"CSS selector": Code.runCSSQuery,
|
||||
"To Snake case": Code.runToSnakeCase,
|
||||
"To Camel case": Code.runToCamelCase,
|
||||
"To Kebab case": Code.runToKebabCase,
|
||||
"JPath expression": Code.runJpath,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,32 +0,0 @@
|
|||
import Compress from "../../operations/Compress.js";
|
||||
|
||||
|
||||
/**
|
||||
* Compression module.
|
||||
*
|
||||
* Libraries:
|
||||
* - zlib.js
|
||||
* - bzip2.js
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Compression = {
|
||||
"Raw Deflate": Compress.runRawDeflate,
|
||||
"Raw Inflate": Compress.runRawInflate,
|
||||
"Zlib Deflate": Compress.runZlibDeflate,
|
||||
"Zlib Inflate": Compress.runZlibInflate,
|
||||
"Gzip": Compress.runGzip,
|
||||
"Gunzip": Compress.runGunzip,
|
||||
"Zip": Compress.runPkzip,
|
||||
"Unzip": Compress.runPkunzip,
|
||||
"Bzip2 Decompress": Compress.runBzip2Decompress,
|
||||
"Tar": Compress.runTar,
|
||||
"Untar": Compress.runUntar,
|
||||
|
||||
};
|
||||
|
||||
export default OpModules;
|
30
src/core/config/modules/Compression.mjs
Normal file
30
src/core/config/modules/Compression.mjs
Normal file
|
@ -0,0 +1,30 @@
|
|||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import Gunzip from "../../operations/Gunzip";
|
||||
import Gzip from "../../operations/Gzip";
|
||||
import RawDeflate from "../../operations/RawDeflate";
|
||||
import RawInflate from "../../operations/RawInflate";
|
||||
import Unzip from "../../operations/Unzip";
|
||||
import Zip from "../../operations/Zip";
|
||||
import ZlibDeflate from "../../operations/ZlibDeflate";
|
||||
import ZlibInflate from "../../operations/ZlibInflate";
|
||||
|
||||
const OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Compression = {
|
||||
"Gunzip": Gunzip,
|
||||
"Gzip": Gzip,
|
||||
"Raw Deflate": RawDeflate,
|
||||
"Raw Inflate": RawInflate,
|
||||
"Unzip": Unzip,
|
||||
"Zip": Zip,
|
||||
"Zlib Deflate": ZlibDeflate,
|
||||
"Zlib Inflate": ZlibInflate,
|
||||
};
|
||||
|
||||
export default OpModules;
|
28
src/core/config/modules/Default.mjs
Normal file
28
src/core/config/modules/Default.mjs
Normal file
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import FromBase32 from "../../operations/FromBase32";
|
||||
import FromBase64 from "../../operations/FromBase64";
|
||||
import FromHex from "../../operations/FromHex";
|
||||
import ShowBase64Offsets from "../../operations/ShowBase64Offsets";
|
||||
import ToBase32 from "../../operations/ToBase32";
|
||||
import ToBase64 from "../../operations/ToBase64";
|
||||
import ToHex from "../../operations/ToHex";
|
||||
|
||||
const OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Default = {
|
||||
"From Base32": FromBase32,
|
||||
"From Base64": FromBase64,
|
||||
"From Hex": FromHex,
|
||||
"Show Base64 offsets": ShowBase64Offsets,
|
||||
"To Base32": ToBase32,
|
||||
"To Base64": ToBase64,
|
||||
"To Hex": ToHex,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,20 +0,0 @@
|
|||
import Diff from "../../operations/Diff.js";
|
||||
|
||||
|
||||
/**
|
||||
* Diff module.
|
||||
*
|
||||
* Libraries:
|
||||
* - JsDIff
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Diff = {
|
||||
"Diff": Diff.runDiff,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,21 +0,0 @@
|
|||
import Punycode from "../../operations/Punycode.js";
|
||||
|
||||
|
||||
/**
|
||||
* Encodings module.
|
||||
*
|
||||
* Libraries:
|
||||
* - punycode
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Encodings = {
|
||||
"To Punycode": Punycode.runToAscii,
|
||||
"From Punycode": Punycode.runToUnicode,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,22 +0,0 @@
|
|||
import HTTP from "../../operations/HTTP.js";
|
||||
|
||||
|
||||
/**
|
||||
* HTTP module.
|
||||
*
|
||||
* Libraries:
|
||||
* - UAS_parser
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.HTTP = {
|
||||
"HTTP request": HTTP.runHTTPRequest,
|
||||
"Strip HTTP headers": HTTP.runStripHeaders,
|
||||
"Parse User Agent": HTTP.runParseUserAgent,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,52 +0,0 @@
|
|||
import Checksum from "../../operations/Checksum.js";
|
||||
import Hash from "../../operations/Hash.js";
|
||||
|
||||
|
||||
/**
|
||||
* Hashing module.
|
||||
*
|
||||
* Libraries:
|
||||
* - CryptoApi
|
||||
* - node-md6
|
||||
* - js-sha3
|
||||
* - ./Checksum.js
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Hashing = {
|
||||
"Analyse hash": Hash.runAnalyse,
|
||||
"Generate all hashes": Hash.runAll,
|
||||
"MD2": Hash.runMD2,
|
||||
"MD4": Hash.runMD4,
|
||||
"MD5": Hash.runMD5,
|
||||
"MD6": Hash.runMD6,
|
||||
"SHA0": Hash.runSHA0,
|
||||
"SHA1": Hash.runSHA1,
|
||||
"SHA2": Hash.runSHA2,
|
||||
"SHA3": Hash.runSHA3,
|
||||
"Keccak": Hash.runKeccak,
|
||||
"Shake": Hash.runShake,
|
||||
"RIPEMD": Hash.runRIPEMD,
|
||||
"HAS-160": Hash.runHAS,
|
||||
"Whirlpool": Hash.runWhirlpool,
|
||||
"Snefru": Hash.runSnefru,
|
||||
"CTPH": Hash.runCTPH,
|
||||
"SSDEEP": Hash.runSSDEEP,
|
||||
"Compare CTPH hashes": Hash.runCompareCTPH,
|
||||
"Compare SSDEEP hashes": Hash.runCompareSSDEEP,
|
||||
"HMAC": Hash.runHMAC,
|
||||
"Fletcher-8 Checksum": Checksum.runFletcher8,
|
||||
"Fletcher-16 Checksum": Checksum.runFletcher16,
|
||||
"Fletcher-32 Checksum": Checksum.runFletcher32,
|
||||
"Fletcher-64 Checksum": Checksum.runFletcher64,
|
||||
"Adler-32 Checksum": Checksum.runAdler32,
|
||||
"CRC-16 Checksum": Checksum.runCRC16,
|
||||
"CRC-32 Checksum": Checksum.runCRC32,
|
||||
"TCP/IP Checksum": Checksum.runTCPIP,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,25 +0,0 @@
|
|||
import Image from "../../operations/Image.js";
|
||||
|
||||
|
||||
/**
|
||||
* Image module.
|
||||
*
|
||||
* Libraries:
|
||||
* - exif-parser
|
||||
* - remove-exif
|
||||
* - ./FileType.js
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Image = {
|
||||
"Extract EXIF": Image.runExtractEXIF,
|
||||
"Remove EXIF": Image.runRemoveEXIF,
|
||||
"Render Image": Image.runRenderImage,
|
||||
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,25 +0,0 @@
|
|||
import IP from "../../operations/IP.js";
|
||||
|
||||
|
||||
/**
|
||||
* JSBN module.
|
||||
*
|
||||
* Libraries:
|
||||
* - jsbn
|
||||
* - ./Checksum.js
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.JSBN = {
|
||||
"Parse IP range": IP.runParseIpRange,
|
||||
"Parse IPv6 address": IP.runParseIPv6,
|
||||
"Parse IPv4 header": IP.runParseIPv4Header,
|
||||
"Change IP format": IP.runChangeIpFormat,
|
||||
"Group IP addresses": IP.runGroupIps,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,43 +0,0 @@
|
|||
/**
|
||||
* Imports all modules for builds which do not load modules separately.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import OpModules from "./Default.js";
|
||||
import CharEncModule from "./CharEnc.js";
|
||||
import CipherModule from "./Ciphers.js";
|
||||
import CodeModule from "./Code.js";
|
||||
import CompressionModule from "./Compression.js";
|
||||
import DiffModule from "./Diff.js";
|
||||
import EncodingModule from "./Encodings.js";
|
||||
import HashingModule from "./Hashing.js";
|
||||
import HTTPModule from "./HTTP.js";
|
||||
import ImageModule from "./Image.js";
|
||||
import JSBNModule from "./JSBN.js";
|
||||
import PublicKeyModule from "./PublicKey.js";
|
||||
import RegexModule from "./Regex.js";
|
||||
import ShellcodeModule from "./Shellcode.js";
|
||||
import URLModule from "./URL.js";
|
||||
|
||||
Object.assign(
|
||||
OpModules,
|
||||
CharEncModule,
|
||||
CipherModule,
|
||||
CodeModule,
|
||||
CompressionModule,
|
||||
DiffModule,
|
||||
EncodingModule,
|
||||
HashingModule,
|
||||
HTTPModule,
|
||||
ImageModule,
|
||||
JSBNModule,
|
||||
PublicKeyModule,
|
||||
RegexModule,
|
||||
ShellcodeModule,
|
||||
URLModule
|
||||
);
|
||||
|
||||
export default OpModules;
|
21
src/core/config/modules/OpModules.mjs
Normal file
21
src/core/config/modules/OpModules.mjs
Normal file
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
|
||||
*
|
||||
* Imports all modules for builds which do not load modules separately.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import DefaultModule from "./Default";
|
||||
import CompressionModule from "./Compression";
|
||||
|
||||
const OpModules = {};
|
||||
|
||||
Object.assign(
|
||||
OpModules,
|
||||
DefaultModule,
|
||||
CompressionModule,
|
||||
);
|
||||
|
||||
export default OpModules;
|
|
@ -1,25 +0,0 @@
|
|||
import PublicKey from "../../operations/PublicKey.js";
|
||||
|
||||
|
||||
/**
|
||||
* PublicKey module.
|
||||
*
|
||||
* Libraries:
|
||||
* - jsrsasign
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.PublicKey = {
|
||||
"Parse X.509 certificate": PublicKey.runParseX509,
|
||||
"Parse ASN.1 hex string": PublicKey.runParseAsn1HexString,
|
||||
"PEM to Hex": PublicKey.runPemToHex,
|
||||
"Hex to PEM": PublicKey.runHexToPem,
|
||||
"Hex to Object Identifier": PublicKey.runHexToObjectIdentifier,
|
||||
"Object Identifier to Hex": PublicKey.runObjectIdentifierToHex,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,30 +0,0 @@
|
|||
import Extract from "../../operations/Extract.js";
|
||||
import Regex from "../../operations/Regex.js";
|
||||
|
||||
|
||||
/**
|
||||
* Regex module.
|
||||
*
|
||||
* Libraries:
|
||||
* - XRegExp
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Regex = {
|
||||
"Regular expression": Regex.runRegex,
|
||||
"Find / Replace": Regex.runFindReplace,
|
||||
"Strings": Extract.runStrings,
|
||||
"Extract IP addresses": Extract.runIp,
|
||||
"Extract email addresses": Extract.runEmail,
|
||||
"Extract MAC addresses": Extract.runMac,
|
||||
"Extract URLs": Extract.runUrls,
|
||||
"Extract domains": Extract.runDomains,
|
||||
"Extract file paths": Extract.runFilePaths,
|
||||
"Extract dates": Extract.runDates,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,20 +0,0 @@
|
|||
import Shellcode from "../../operations/Shellcode.js";
|
||||
|
||||
|
||||
/**
|
||||
* Shellcode module.
|
||||
*
|
||||
* Libraries:
|
||||
* - DisassembleX86-64.js
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.Shellcode = {
|
||||
"Disassemble x86": Shellcode.runDisassemble,
|
||||
};
|
||||
|
||||
export default OpModules;
|
|
@ -1,23 +0,0 @@
|
|||
import URL_ from "../../operations/URL.js";
|
||||
|
||||
|
||||
/**
|
||||
* URL module.
|
||||
*
|
||||
* Libraries:
|
||||
* - Utils.js
|
||||
* - url
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
let OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.URL = {
|
||||
"URL Encode": URL_.runTo,
|
||||
"URL Decode": URL_.runFrom,
|
||||
"Parse URI": URL_.runParse,
|
||||
};
|
||||
|
||||
export default OpModules;
|
418
src/core/config/OperationConfig.js → src/core/config/scripts/generateConfig.mjs
Executable file → Normal file
418
src/core/config/OperationConfig.js → src/core/config/scripts/generateConfig.mjs
Executable file → Normal file
|
@ -1,88 +1,161 @@
|
|||
import Arithmetic from "../operations/Arithmetic.js";
|
||||
import Base from "../operations/Base.js";
|
||||
import Base58 from "../operations/Base58.js";
|
||||
import Base64 from "../operations/Base64.js";
|
||||
import BCD from "../operations/BCD.js";
|
||||
import BitwiseOp from "../operations/BitwiseOp.js";
|
||||
import ByteRepr from "../operations/ByteRepr.js";
|
||||
import CharEnc from "../operations/CharEnc.js";
|
||||
import Cipher from "../operations/Cipher.js";
|
||||
import Code from "../operations/Code.js";
|
||||
import Compress from "../operations/Compress.js";
|
||||
import Convert from "../operations/Convert.js";
|
||||
import DateTime from "../operations/DateTime.js";
|
||||
import Diff from "../operations/Diff.js";
|
||||
import Endian from "../operations/Endian.js";
|
||||
import Entropy from "../operations/Entropy.js";
|
||||
import Extract from "../operations/Extract.js";
|
||||
import Filetime from "../operations/Filetime.js";
|
||||
import FileType from "../operations/FileType.js";
|
||||
import Image from "../operations/Image.js";
|
||||
import Hash from "../operations/Hash.js";
|
||||
import Hexdump from "../operations/Hexdump.js";
|
||||
import HTML from "../operations/HTML.js";
|
||||
import HTTP from "../operations/HTTP.js";
|
||||
import IP from "../operations/IP.js";
|
||||
import JS from "../operations/JS.js";
|
||||
import MAC from "../operations/MAC.js";
|
||||
import MorseCode from "../operations/MorseCode.js";
|
||||
import NetBIOS from "../operations/NetBIOS.js";
|
||||
import PHP from "../operations/PHP.js";
|
||||
import PublicKey from "../operations/PublicKey.js";
|
||||
import Punycode from "../operations/Punycode.js";
|
||||
import Regex from "../operations/Regex.js";
|
||||
import Rotate from "../operations/Rotate.js";
|
||||
import SeqUtils from "../operations/SeqUtils.js";
|
||||
import Shellcode from "../operations/Shellcode.js";
|
||||
import StrUtils from "../operations/StrUtils.js";
|
||||
import Tidy from "../operations/Tidy.js";
|
||||
import Unicode from "../operations/Unicode.js";
|
||||
import URL_ from "../operations/URL.js";
|
||||
import SetOps from "../operations/SetOperations.js";
|
||||
|
||||
|
||||
/**
|
||||
* Type definition for an OpConf.
|
||||
*
|
||||
* @typedef {Object} OpConf
|
||||
* @property {string} module - The module to which the operation belongs
|
||||
* @property {html} description - A description of the operation with optional HTML tags
|
||||
* @property {string} inputType
|
||||
* @property {string} outputType
|
||||
* @property {Function|boolean} [highlight] - A function to calculate the highlight offset, or true
|
||||
* if the offset does not change
|
||||
* @property {Function|boolean} [highlightReverse] - A function to calculate the highlight offset
|
||||
* in reverse, or true if the offset does not change
|
||||
* @property {boolean} [flowControl] - True if the operation is for Flow Control
|
||||
* @property {ArgConf[]} [args] - A list of configuration objects for the arguments
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Type definition for an ArgConf.
|
||||
*
|
||||
* @typedef {Object} ArgConf
|
||||
* @property {string} name - The display name of the argument
|
||||
* @property {string} type - The data type of the argument
|
||||
* @property {*} value
|
||||
* @property {number[]} [disableArgs] - A list of the indices of the operation's arguments which
|
||||
* should be toggled on or off when this argument is changed
|
||||
* @property {boolean} [disabled] - Whether or not this argument starts off disabled
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Operation configuration objects.
|
||||
* This script automatically generates OperationConfig.json, containing metadata
|
||||
* for each operation in the src/core/operations directory.
|
||||
* It also generates modules in the src/core/config/modules directory to separate
|
||||
* out operations into logical collections.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2016
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* @constant
|
||||
* @type {Object.<string, OpConf>}
|
||||
*/
|
||||
const OperationConfig = {
|
||||
"Fork": {
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import process from "process";
|
||||
import * as Ops from "../../operations/index";
|
||||
|
||||
const dir = path.join(process.cwd() + "/src/core/config/");
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("\nCWD: " + process.cwd());
|
||||
console.log("Error: generateConfig.mjs should be run from the project root");
|
||||
console.log("Example> node --experimental-modules src/core/config/scripts/generateConfig.mjs");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
const operationConfig = {},
|
||||
modules = {};
|
||||
|
||||
/**
|
||||
* Generate operation config and module lists.
|
||||
*/
|
||||
for (const opObj in Ops) {
|
||||
const op = new Ops[opObj]();
|
||||
|
||||
operationConfig[op.name] = {
|
||||
module: op.module,
|
||||
description: op.description,
|
||||
inputType: op.inputType,
|
||||
outputType: op.outputType,
|
||||
flowControl: op.flowControl,
|
||||
args: op.args
|
||||
};
|
||||
|
||||
if (!modules.hasOwnProperty(op.module))
|
||||
modules[op.module] = {};
|
||||
modules[op.module][op.name] = opObj;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write OperationConfig.
|
||||
*/
|
||||
fs.writeFile(
|
||||
path.join(dir, "OperationConfig.json"),
|
||||
JSON.stringify(operationConfig, null, 4),
|
||||
err => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Write modules.
|
||||
*/
|
||||
for (const module in modules) {
|
||||
let code = `/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
`;
|
||||
|
||||
for (const opName in modules[module]) {
|
||||
const objName = modules[module][opName];
|
||||
code += `import ${objName} from "../../operations/${objName}";\n`;
|
||||
}
|
||||
|
||||
code += `
|
||||
const OpModules = typeof self === "undefined" ? {} : self.OpModules || {};
|
||||
|
||||
OpModules.${module} = {
|
||||
`;
|
||||
for (const opName in modules[module]) {
|
||||
const objName = modules[module][opName];
|
||||
code += ` "${opName}": ${objName},\n`;
|
||||
}
|
||||
|
||||
code += `};
|
||||
|
||||
export default OpModules;
|
||||
`;
|
||||
fs.writeFile(
|
||||
path.join(dir, `modules/${module}.mjs`),
|
||||
code,
|
||||
err => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Write OpModules wrapper.
|
||||
*/
|
||||
let opModulesCode = `/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateConfig.mjs
|
||||
*
|
||||
* Imports all modules for builds which do not load modules separately.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
`;
|
||||
|
||||
for (const module in modules) {
|
||||
opModulesCode += `import ${module}Module from "./${module}";\n`;
|
||||
}
|
||||
|
||||
opModulesCode += `
|
||||
const OpModules = {};
|
||||
|
||||
Object.assign(
|
||||
OpModules,
|
||||
`;
|
||||
|
||||
for (const module in modules) {
|
||||
opModulesCode += ` ${module}Module,\n`;
|
||||
}
|
||||
|
||||
opModulesCode += `);
|
||||
|
||||
export default OpModules;
|
||||
`;
|
||||
|
||||
fs.writeFile(
|
||||
path.join(dir, "modules/OpModules.mjs"),
|
||||
opModulesCode,
|
||||
err => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
/*"Fork": {
|
||||
module: "Default",
|
||||
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.",
|
||||
inputType: "string",
|
||||
|
@ -257,6 +330,9 @@ const OperationConfig = {
|
|||
},
|
||||
]
|
||||
},
|
||||
};*/
|
||||
|
||||
/*
|
||||
"From Base58": {
|
||||
module: "Default",
|
||||
description: "Base58 (similar to Base64) is a notation for encoding arbitrary byte data. It differs from Base64 by removing easily misread characters (i.e. l, I, 0 and O) to improve human readability.<br><br>This operation decodes data from an ASCII string (with an alphabet of your choosing, presets included) back into its raw form.<br><br>e.g. <code>StV1DL6CwTryKyV</code> becomes <code>hello world</code><br><br>Base58 is commonly used in cryptocurrencies (Bitcoin, Ripple, etc).",
|
||||
|
@ -913,6 +989,34 @@ const OperationConfig = {
|
|||
}
|
||||
]
|
||||
},
|
||||
"Escape Unicode Characters": {
|
||||
module: "Default",
|
||||
description: "Converts characters to their unicode-escaped notations.<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>σου</code> becomes <code>\\u03C3\\u03BF\\u03C5</code>",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Prefix",
|
||||
type: "option",
|
||||
value: Unicode.PREFIXES
|
||||
},
|
||||
{
|
||||
name: "Encode all chars",
|
||||
type: "boolean",
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "Padding",
|
||||
type: "number",
|
||||
value: 4
|
||||
},
|
||||
{
|
||||
name: "Uppercase hex",
|
||||
type: "boolean",
|
||||
value: true
|
||||
}
|
||||
]
|
||||
},
|
||||
"From Quoted Printable": {
|
||||
module: "Default",
|
||||
description: "Converts QP-encoded text back to standard text.",
|
||||
|
@ -2433,7 +2537,7 @@ const OperationConfig = {
|
|||
module: "Default",
|
||||
description: "Parses a datetime string in UTC and returns the corresponding UNIX timestamp.<br><br>e.g. <code>Mon 1 January 2001 11:00:00</code> becomes <code>978346800</code><br><br>A UNIX timestamp is a 32-bit value representing the number of seconds since January 1, 1970 UTC (the UNIX epoch).",
|
||||
inputType: "string",
|
||||
outputType: "number",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Units",
|
||||
|
@ -2444,6 +2548,11 @@ const OperationConfig = {
|
|||
name: "Treat as UTC",
|
||||
type: "boolean",
|
||||
value: DateTime.TREAT_AS_UTC
|
||||
},
|
||||
{
|
||||
name: "Show parsed datetime",
|
||||
type: "boolean",
|
||||
value: true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -3555,14 +3664,40 @@ const OperationConfig = {
|
|||
},
|
||||
"Escape string": {
|
||||
module: "Default",
|
||||
description: "Escapes special characters in a string so that they do not cause conflicts. For example, <code>Don't stop me now</code> becomes <code>Don\\'t stop me now</code>.<br><br>Supports the following escape sequences:<ul><li><code>\\n</code> (Line feed/newline)</li><li><code>\\r</code> (Carriage return)</li><li><code>\\t</code> (Horizontal tab)</li><li><code>\\b</code> (Backspace)</li><li><code>\\f</code> (Form feed)</li><li><code>\\xnn</code> (Hex, where n is 0-f)</li><li><code>\\\\</code> (Backslash)</li><li><code>\\'</code> (Single quote)</li><li><code>\\"</code> (Double quote)</li></ul>",
|
||||
description: "Escapes special characters in a string so that they do not cause conflicts. For example, <code>Don't stop me now</code> becomes <code>Don\\'t stop me now</code>.<br><br>Supports the following escape sequences:<ul><li><code>\\n</code> (Line feed/newline)</li><li><code>\\r</code> (Carriage return)</li><li><code>\\t</code> (Horizontal tab)</li><li><code>\\b</code> (Backspace)</li><li><code>\\f</code> (Form feed)</li><li><code>\\xnn</code> (Hex, where n is 0-f)</li><li><code>\\\\</code> (Backslash)</li><li><code>\\'</code> (Single quote)</li><li><code>\\"</code> (Double quote)</li><li><code>\\unnnn</code> (Unicode character)</li><li><code>\\u{nnnnnn}</code> (Unicode code point)</li></ul>",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: []
|
||||
args: [
|
||||
{
|
||||
name: "Escape level",
|
||||
type: "option",
|
||||
value: StrUtils.ESCAPE_LEVEL
|
||||
},
|
||||
{
|
||||
name: "Escape quote",
|
||||
type: "option",
|
||||
value: StrUtils.QUOTE_TYPES
|
||||
},
|
||||
{
|
||||
name: "JSON compatible",
|
||||
type: "boolean",
|
||||
value: false
|
||||
},
|
||||
{
|
||||
name: "ES6 compatible",
|
||||
type: "boolean",
|
||||
value: true
|
||||
},
|
||||
{
|
||||
name: "Uppercase hex",
|
||||
type: "boolean",
|
||||
value: false
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unescape string": {
|
||||
module: "Default",
|
||||
description: "Unescapes characters in a string that have been escaped. For example, <code>Don\\'t stop me now</code> becomes <code>Don't stop me now</code>.<br><br>Supports the following escape sequences:<ul><li><code>\\n</code> (Line feed/newline)</li><li><code>\\r</code> (Carriage return)</li><li><code>\\t</code> (Horizontal tab)</li><li><code>\\b</code> (Backspace)</li><li><code>\\f</code> (Form feed)</li><li><code>\\xnn</code> (Hex, where n is 0-f)</li><li><code>\\\\</code> (Backslash)</li><li><code>\\'</code> (Single quote)</li><li><code>\\"</code> (Double quote)</li></ul>",
|
||||
description: "Unescapes characters in a string that have been escaped. For example, <code>Don\\'t stop me now</code> becomes <code>Don't stop me now</code>.<br><br>Supports the following escape sequences:<ul><li><code>\\n</code> (Line feed/newline)</li><li><code>\\r</code> (Carriage return)</li><li><code>\\t</code> (Horizontal tab)</li><li><code>\\b</code> (Backspace)</li><li><code>\\f</code> (Form feed)</li><li><code>\\xnn</code> (Hex, where n is 0-f)</li><li><code>\\\\</code> (Backslash)</li><li><code>\\'</code> (Single quote)</li><li><code>\\"</code> (Double quote)</li><li><code>\\unnnn</code> (Unicode character)</li><li><code>\\u{nnnnnn}</code> (Unicode code point)</li></ul>",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: []
|
||||
|
@ -4020,6 +4155,7 @@ const OperationConfig = {
|
|||
outputType: "number",
|
||||
args: []
|
||||
},
|
||||
<<<<<<< HEAD:src/core/config/OperationConfig.js
|
||||
"Set Operations": {
|
||||
module: "Default",
|
||||
description: "Performs set operations",
|
||||
|
@ -4043,23 +4179,107 @@ const OperationConfig = {
|
|||
}
|
||||
]
|
||||
}
|
||||
=======
|
||||
"Bcrypt": {
|
||||
module: "Hashing",
|
||||
description: "bcrypt is a password hashing function designed by Niels Provos and David Mazières, based on the Blowfish cipher, and presented at USENIX in 1999. Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the iteration count (rounds) can be increased to make it slower, so it remains resistant to brute-force search attacks even with increasing computation power.<br><br>Enter the password in the input to generate its hash.",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Rounds",
|
||||
type: "number",
|
||||
value: Hash.BCRYPT_ROUNDS
|
||||
}
|
||||
]
|
||||
},
|
||||
"Bcrypt compare": {
|
||||
module: "Hashing",
|
||||
description: "Tests whether the input matches the given bcrypt hash. To test multiple possible passwords, use the 'Fork' operation.",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Hash",
|
||||
type: "string",
|
||||
value: ""
|
||||
}
|
||||
]
|
||||
},
|
||||
"Bcrypt parse": {
|
||||
module: "Hashing",
|
||||
description: "Parses a bcrypt hash to determine the number of rounds used, the salt, and the password hash.",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: []
|
||||
},
|
||||
"Scrypt": {
|
||||
module: "Hashing",
|
||||
description: "scrypt is a password-based key derivation function (PBKDF) created by Colin Percival. The algorithm was specifically designed to make it costly to perform large-scale custom hardware attacks by requiring large amounts of memory. In 2016, the scrypt algorithm was published by IETF as RFC 7914.<br><br>Enter the password in the input to generate its hash.",
|
||||
inputType: "string",
|
||||
outputType: "string",
|
||||
args: [
|
||||
{
|
||||
name: "Salt",
|
||||
type: "toggleString",
|
||||
value: "",
|
||||
toggleValues: Hash.KEY_FORMAT
|
||||
},
|
||||
{
|
||||
name: "Iterations (N)",
|
||||
type: "number",
|
||||
value: Hash.SCRYPT_ITERATIONS
|
||||
},
|
||||
{
|
||||
name: "Memory factor (r)",
|
||||
type: "number",
|
||||
value: Hash.SCRYPT_MEM_FACTOR
|
||||
},
|
||||
{
|
||||
name: "Parallelization factor (p)",
|
||||
type: "number",
|
||||
value: Hash.SCRYPT_PARALLEL_FACTOR
|
||||
},
|
||||
{
|
||||
name: "Key length",
|
||||
type: "number",
|
||||
value: Hash.SCRYPT_KEY_LENGTH
|
||||
},
|
||||
]
|
||||
},
|
||||
"BSON serialise": {
|
||||
module: "BSON",
|
||||
description: "BSON is a computer data interchange format used mainly as a data storage and network transfer format in the MongoDB database. It is a binary form for representing simple data structures, associative arrays (called objects or documents in MongoDB), and various data types of specific interest to MongoDB. The name 'BSON' is based on the term JSON and stands for 'Binary JSON'.<br><br>Input data should be valid JSON.",
|
||||
inputType: "string",
|
||||
outputType: "ArrayBuffer",
|
||||
args: []
|
||||
},
|
||||
"BSON deserialise": {
|
||||
module: "BSON",
|
||||
description: "BSON is a computer data interchange format used mainly as a data storage and network transfer format in the MongoDB database. It is a binary form for representing simple data structures, associative arrays (called objects or documents in MongoDB), and various data types of specific interest to MongoDB. The name 'BSON' is based on the term JSON and stands for 'Binary JSON'.<br><br>Input data should be in a raw bytes format.",
|
||||
inputType: "ArrayBuffer",
|
||||
outputType: "string",
|
||||
args: []
|
||||
},
|
||||
>>>>>>> esm:src/core/config/scripts/generateConfig.mjs
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Exports the OperationConfig JSON object in val-loader format so that it can be loaded
|
||||
* into the app without also importing all the dependencies.
|
||||
*
|
||||
* See https://github.com/webpack-contrib/val-loader
|
||||
*
|
||||
* @returns {Object}
|
||||
*/
|
||||
function valExport() {
|
||||
return {
|
||||
code: "module.exports = " + JSON.stringify(OperationConfig) + ";"
|
||||
};
|
||||
}
|
||||
// /**
|
||||
// * Exports the OperationConfig JSON object in val-loader format so that it can be loaded
|
||||
// * into the app without also importing all the dependencies.
|
||||
// *
|
||||
// * See https://github.com/webpack-contrib/val-loader
|
||||
// *
|
||||
// * @returns {Object}
|
||||
// */
|
||||
// function valExport() {
|
||||
// return {
|
||||
// code: "module.exports = " + JSON.stringify(OperationConfig) + ";"
|
||||
// };
|
||||
// }
|
||||
|
||||
export default valExport;
|
||||
// export default valExport;
|
||||
|
||||
export { OperationConfig };
|
||||
// export {operations};
|
59
src/core/config/scripts/generateOpsIndex.mjs
Normal file
59
src/core/config/scripts/generateOpsIndex.mjs
Normal file
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* This script automatically generates src/core/operations/index.mjs, containing
|
||||
* imports for all operations in src/core/operations.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
/*eslint no-console: ["off"] */
|
||||
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import process from "process";
|
||||
|
||||
const dir = path.join(process.cwd() + "/src/core/config/");
|
||||
if (!fs.existsSync(dir)) {
|
||||
console.log("\nCWD: " + process.cwd());
|
||||
console.log("Error: generateOpsIndex.mjs should be run from the project root");
|
||||
console.log("Example> node --experimental-modules src/core/config/scripts/generateOpsIndex.mjs");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Find all operation files
|
||||
const opObjs = [];
|
||||
fs.readdirSync(path.join(dir, "../operations")).forEach(file => {
|
||||
if (!file.endsWith(".mjs") || file === "index.mjs") return;
|
||||
opObjs.push(file.split(".mjs")[0]);
|
||||
});
|
||||
|
||||
// Construct index file
|
||||
let code = `/**
|
||||
* THIS FILE IS AUTOMATICALLY GENERATED BY src/core/config/scripts/generateOpsIndex.mjs
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright ${new Date().getUTCFullYear()}
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
`;
|
||||
|
||||
opObjs.forEach(obj => {
|
||||
code += `import ${obj} from "./${obj}";\n`;
|
||||
});
|
||||
|
||||
code += `
|
||||
export {
|
||||
`;
|
||||
|
||||
opObjs.forEach(obj => {
|
||||
code += ` ${obj},\n`;
|
||||
});
|
||||
|
||||
code += "};\n";
|
||||
|
||||
// Write file
|
||||
fs.writeFileSync(
|
||||
path.join(dir, "../operations/index.mjs"),
|
||||
code
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue