Merge branch 'master' into feat/escape-smart-characters
This commit is contained in:
commit
77818c6281
33
.github/dependabot.yml
vendored
33
.github/dependabot.yml
vendored
@ -15,6 +15,8 @@ updates:
|
|||||||
day: 'friday'
|
day: 'friday'
|
||||||
time: '03:00'
|
time: '03:00'
|
||||||
timezone: Europe/London
|
timezone: Europe/London
|
||||||
|
cooldown:
|
||||||
|
default-days: 2
|
||||||
commit-message:
|
commit-message:
|
||||||
prefix: 'chore (deps): '
|
prefix: 'chore (deps): '
|
||||||
ignore:
|
ignore:
|
||||||
@ -25,12 +27,8 @@ updates:
|
|||||||
# see issue #2214 for rationale for each of these
|
# see issue #2214 for rationale for each of these
|
||||||
- dependency-name: '@xmldom/xmldom'
|
- dependency-name: '@xmldom/xmldom'
|
||||||
versions: [ '>=0.9.0' ]
|
versions: [ '>=0.9.0' ]
|
||||||
- dependency-name: 'bcryptjs'
|
|
||||||
versions: [ '>=3.0.0' ]
|
|
||||||
- dependency-name: 'bootstrap'
|
- dependency-name: 'bootstrap'
|
||||||
versions: [ '>=5.0.0' ]
|
versions: [ '>=5.0.0' ]
|
||||||
- dependency-name: 'bson'
|
|
||||||
versions: [ '>=5.0.0' ]
|
|
||||||
- dependency-name: 'cbor'
|
- dependency-name: 'cbor'
|
||||||
versions: [ '>=10.0.0' ]
|
versions: [ '>=10.0.0' ]
|
||||||
- dependency-name: 'eslint'
|
- dependency-name: 'eslint'
|
||||||
@ -43,11 +41,12 @@ updates:
|
|||||||
versions: [ '>=2.0.0' ]
|
versions: [ '>=2.0.0' ]
|
||||||
- dependency-name: 'jimp'
|
- dependency-name: 'jimp'
|
||||||
versions: [ '1.6.1' ]
|
versions: [ '1.6.1' ]
|
||||||
- dependency-name: 'webpack-dev-server'
|
- dependency-name: 'jq-web'
|
||||||
versions: [ '>=5.1.0' ]
|
versions: [ '>=0.6.0' ]
|
||||||
groups:
|
groups:
|
||||||
#
|
#
|
||||||
# Grouping so we don't get a seperate PR for every patch version.
|
# Grouping so patch version updates are batched together in a single PR
|
||||||
|
# and similarly with minor version updates
|
||||||
#
|
#
|
||||||
patch-updates:
|
patch-updates:
|
||||||
applies-to: version-updates
|
applies-to: version-updates
|
||||||
@ -55,6 +54,12 @@ updates:
|
|||||||
- '*'
|
- '*'
|
||||||
update-types:
|
update-types:
|
||||||
- 'patch'
|
- 'patch'
|
||||||
|
minor-updates:
|
||||||
|
applies-to: version-updates
|
||||||
|
patterns:
|
||||||
|
- '*'
|
||||||
|
update-types:
|
||||||
|
- 'minor'
|
||||||
|
|
||||||
# Versioning on Github Actions
|
# Versioning on Github Actions
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
@ -66,8 +71,14 @@ updates:
|
|||||||
day: 'friday'
|
day: 'friday'
|
||||||
time: '03:00'
|
time: '03:00'
|
||||||
timezone: Europe/London
|
timezone: Europe/London
|
||||||
|
cooldown:
|
||||||
|
default-days: 4
|
||||||
commit-message:
|
commit-message:
|
||||||
prefix: 'chore (deps): '
|
prefix: 'chore (deps): '
|
||||||
|
groups:
|
||||||
|
actions-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|
||||||
- package-ecosystem: docker
|
- package-ecosystem: docker
|
||||||
directory: /
|
directory: /
|
||||||
@ -76,3 +87,11 @@ updates:
|
|||||||
day: 'friday'
|
day: 'friday'
|
||||||
time: '03:00'
|
time: '03:00'
|
||||||
timezone: Europe/London
|
timezone: Europe/London
|
||||||
|
cooldown:
|
||||||
|
default-days: 4
|
||||||
|
commit-message:
|
||||||
|
prefix: 'chore (deps): '
|
||||||
|
groups:
|
||||||
|
docker-dependencies:
|
||||||
|
patterns:
|
||||||
|
- "*"
|
||||||
|
|||||||
8
.github/workflows/master.yml
vendored
8
.github/workflows/master.yml
vendored
@ -44,9 +44,17 @@ jobs:
|
|||||||
- name: Generate sitemap
|
- name: Generate sitemap
|
||||||
run: npx grunt exec:sitemap
|
run: npx grunt exec:sitemap
|
||||||
|
|
||||||
|
- name: Setup Chrome
|
||||||
|
id: setup-chrome
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
npx @puppeteer/browsers install chrome@148
|
||||||
|
echo chromedir=$(dirname $(find `pwd`/chrome/* -name chrome -print -quit)) >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: UI Tests
|
- name: UI Tests
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
|
export PATH=${{ steps.setup-chrome.outputs.chromedir }}:$PATH
|
||||||
sudo apt-get install xvfb
|
sudo apt-get install xvfb
|
||||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||||
|
|
||||||
|
|||||||
12
.github/workflows/pull_requests.yml
vendored
12
.github/workflows/pull_requests.yml
vendored
@ -45,15 +45,23 @@ jobs:
|
|||||||
path: build/prod/*.zip
|
path: build/prod/*.zip
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
|
- name: Setup Chrome
|
||||||
|
id: setup-chrome
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
npx @puppeteer/browsers install chrome@148
|
||||||
|
echo chromedir=$(dirname $(find `pwd`/chrome/* -name chrome -print -quit)) >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: UI Tests
|
- name: UI Tests
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
|
export PATH=${{ steps.setup-chrome.outputs.chromedir }}:$PATH
|
||||||
sudo apt-get install xvfb
|
sudo apt-get install xvfb
|
||||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
if: success()
|
if: success()
|
||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
||||||
@ -61,6 +69,6 @@ jobs:
|
|||||||
- name: Production Image Build
|
- name: Production Image Build
|
||||||
if: success()
|
if: success()
|
||||||
id: build-image
|
id: build-image
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
|||||||
19
.github/workflows/releases.yml
vendored
19
.github/workflows/releases.yml
vendored
@ -46,20 +46,29 @@ jobs:
|
|||||||
- name: Production Build
|
- name: Production Build
|
||||||
run: npx grunt prod
|
run: npx grunt prod
|
||||||
|
|
||||||
- name: UI Tests
|
- name: Setup Chrome
|
||||||
|
id: setup-chrome
|
||||||
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
|
npx @puppeteer/browsers install chrome@148
|
||||||
|
echo chromedir=$(dirname $(find `pwd`/chrome/* -name chrome -print -quit)) >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: UI Tests
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
export PATH=${{ steps.setup-chrome.outputs.chromedir }}:$PATH
|
||||||
sudo apt-get install xvfb
|
sudo apt-get install xvfb
|
||||||
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
||||||
|
|
||||||
- name: Image Metadata
|
- name: Image Metadata
|
||||||
id: image-metadata
|
id: image-metadata
|
||||||
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
@ -68,14 +77,14 @@ jobs:
|
|||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
|
|
||||||
- name: Log in to GHCR
|
- name: Log in to GHCR
|
||||||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ env.REGISTRY_USER }}
|
username: ${{ env.REGISTRY_USER }}
|
||||||
password: ${{ env.REGISTRY_PASSWORD }}
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Publish to GHCR
|
- name: Publish to GHCR
|
||||||
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,3 +13,4 @@ src/node/index.mjs
|
|||||||
**/*.DS_Store
|
**/*.DS_Store
|
||||||
tests/browser/output/*
|
tests/browser/output/*
|
||||||
.node-version
|
.node-version
|
||||||
|
chrome
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
# Modifier --platform=$BUILDPLATFORM limits the platform to "BUILDPLATFORM" during buildx multi-platform builds
|
# Modifier --platform=$BUILDPLATFORM limits the platform to "BUILDPLATFORM" during buildx multi-platform builds
|
||||||
# This is because npm "chromedriver" package is not compatiable with all platforms
|
# This is because npm "chromedriver" package is not compatiable with all platforms
|
||||||
# For more info see: https://docs.docker.com/build/building/multi-platform/#cross-compilation
|
# For more info see: https://docs.docker.com/build/building/multi-platform/#cross-compilation
|
||||||
FROM --platform=$BUILDPLATFORM node:24-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f AS builder
|
FROM --platform=$BUILDPLATFORM node:24-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14 AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ RUN npm run build
|
|||||||
#########################################
|
#########################################
|
||||||
# Package static build files into nginx #
|
# Package static build files into nginx #
|
||||||
#########################################
|
#########################################
|
||||||
FROM nginxinc/nginx-unprivileged:stable-alpine@sha256:808f7846d21a9c94cf53833e8807a00a33fd0b65cc47fb05b79efe366c2d201f AS cyberchef
|
FROM nginxinc/nginx-unprivileged:stable-alpine@sha256:0a1e718ff1e1a22fc519d0c2e5b6872681f01e37c8a2817ec43ce6e716103929 AS cyberchef
|
||||||
|
|
||||||
LABEL maintainer="GCHQ <oss@gchq.gov.uk>"
|
LABEL maintainer="GCHQ <oss@gchq.gov.uk>"
|
||||||
|
|
||||||
|
|||||||
12
Gruntfile.js
12
Gruntfile.js
@ -89,6 +89,8 @@ module.exports = function (grunt) {
|
|||||||
const compileYear = grunt.template.today("UTC:yyyy"),
|
const compileYear = grunt.template.today("UTC:yyyy"),
|
||||||
compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
|
compileTime = grunt.template.today("UTC:dd/mm/yyyy HH:MM:ss") + " UTC",
|
||||||
pkg = grunt.file.readJSON("package.json"),
|
pkg = grunt.file.readJSON("package.json"),
|
||||||
|
version = process.env.GITHUB_SHA || `v${pkg.version}`,
|
||||||
|
downloadZipFilename = `CyberChef_${version}.zip`,
|
||||||
webpackConfig = require("./webpack.config.js"),
|
webpackConfig = require("./webpack.config.js"),
|
||||||
BUILD_CONSTANTS = {
|
BUILD_CONSTANTS = {
|
||||||
COMPILE_YEAR: JSON.stringify(compileYear),
|
COMPILE_YEAR: JSON.stringify(compileYear),
|
||||||
@ -129,7 +131,9 @@ module.exports = function (grunt) {
|
|||||||
chunks: ["main"],
|
chunks: ["main"],
|
||||||
compileYear: compileYear,
|
compileYear: compileYear,
|
||||||
compileTime: compileTime,
|
compileTime: compileTime,
|
||||||
version: pkg.version,
|
version: version,
|
||||||
|
latestReleaseVersion: pkg.version,
|
||||||
|
downloadZipFilename: downloadZipFilename,
|
||||||
minify: {
|
minify: {
|
||||||
removeComments: true,
|
removeComments: true,
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
@ -245,7 +249,7 @@ module.exports = function (grunt) {
|
|||||||
"!build/prod/index.html",
|
"!build/prod/index.html",
|
||||||
"!build/prod/BundleAnalyzerReport.html",
|
"!build/prod/BundleAnalyzerReport.html",
|
||||||
],
|
],
|
||||||
dest: `build/prod/CyberChef_v${pkg.version}.zip`
|
dest: `build/prod/${downloadZipFilename}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
connect: {
|
connect: {
|
||||||
@ -333,12 +337,12 @@ module.exports = function (grunt) {
|
|||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return chainCommands([
|
return chainCommands([
|
||||||
`shasum -a 256 build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
`shasum -a 256 build/prod/${downloadZipFilename} | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
||||||
`sed -i '' -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
`sed -i '' -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
||||||
]);
|
]);
|
||||||
default:
|
default:
|
||||||
return chainCommands([
|
return chainCommands([
|
||||||
`sha256sum build/prod/CyberChef_v${pkg.version}.zip | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
`sha256sum build/prod/${downloadZipFilename} | awk '{print $1;}' > build/prod/sha256digest.txt`,
|
||||||
`sed -i -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
`sed -i -e "s/DOWNLOAD_HASH_PLACEHOLDER/$(cat build/prod/sha256digest.txt)/" build/prod/index.html`
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
1803
package-lock.json
generated
1803
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
39
package.json
39
package.json
@ -39,20 +39,21 @@
|
|||||||
"node >= 24"
|
"node >= 24"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/eslint-parser": "^7.28.6",
|
"@babel/eslint-parser": "^7.29.7",
|
||||||
"@babel/plugin-syntax-import-assertions": "^7.28.6",
|
"@babel/plugin-syntax-import-assertions": "^7.28.6",
|
||||||
"@babel/plugin-transform-runtime": "^7.29.0",
|
"@babel/plugin-transform-runtime": "^7.29.7",
|
||||||
"@babel/preset-env": "^7.29.5",
|
"@babel/preset-env": "^7.29.7",
|
||||||
"@babel/runtime": "^7.29.2",
|
"@babel/runtime": "^7.29.7",
|
||||||
"@codemirror/commands": "^6.10.3",
|
"@codemirror/commands": "^6.10.3",
|
||||||
"@codemirror/language": "^6.12.3",
|
"@codemirror/language": "^6.12.3",
|
||||||
"@codemirror/search": "^6.7.0",
|
"@codemirror/search": "^6.7.0",
|
||||||
"@codemirror/state": "^6.5.4",
|
"@codemirror/state": "^6.5.4",
|
||||||
"@codemirror/view": "^6.41.1",
|
"@codemirror/view": "^6.43.0",
|
||||||
|
"@puppeteer/browsers": "3.0.4",
|
||||||
"autoprefixer": "^10.5.0",
|
"autoprefixer": "^10.5.0",
|
||||||
"babel-loader": "^10.1.1",
|
"babel-loader": "^10.1.1",
|
||||||
"base64-loader": "^1.0.0",
|
"base64-loader": "^1.0.0",
|
||||||
"chromedriver": "^146.0.6",
|
"chromedriver": "^148.0.4",
|
||||||
"cli-progress": "^3.12.0",
|
"cli-progress": "^3.12.0",
|
||||||
"colors": "^1.4.0",
|
"colors": "^1.4.0",
|
||||||
"compression-webpack-plugin": "^12.0.0",
|
"compression-webpack-plugin": "^12.0.0",
|
||||||
@ -62,7 +63,7 @@
|
|||||||
"css-loader": "^7.1.4",
|
"css-loader": "^7.1.4",
|
||||||
"eslint": "^9.39.4",
|
"eslint": "^9.39.4",
|
||||||
"eslint-plugin-jsdoc": "^50.8.0",
|
"eslint-plugin-jsdoc": "^50.8.0",
|
||||||
"globals": "^17.4.0",
|
"globals": "^17.6.0",
|
||||||
"grunt": "^1.6.2",
|
"grunt": "^1.6.2",
|
||||||
"grunt-chmod": "~1.1.1",
|
"grunt-chmod": "~1.1.1",
|
||||||
"grunt-concurrent": "^3.0.0",
|
"grunt-concurrent": "^3.0.0",
|
||||||
@ -78,17 +79,17 @@
|
|||||||
"imports-loader": "^5.0.0",
|
"imports-loader": "^5.0.0",
|
||||||
"mini-css-extract-plugin": "2.10.2",
|
"mini-css-extract-plugin": "2.10.2",
|
||||||
"modify-source-webpack-plugin": "^4.1.0",
|
"modify-source-webpack-plugin": "^4.1.0",
|
||||||
"nightwatch": "^3.15.0",
|
"nightwatch": "^3.16.0",
|
||||||
"postcss": "^8.5.14",
|
"postcss": "^8.5.15",
|
||||||
"postcss-css-variables": "^0.19.0",
|
"postcss-css-variables": "^0.19.0",
|
||||||
"postcss-import": "^16.1.1",
|
"postcss-import": "^16.1.1",
|
||||||
"postcss-loader": "^8.2.1",
|
"postcss-loader": "^8.2.1",
|
||||||
"prompt": "^1.3.0",
|
"prompt": "^1.3.0",
|
||||||
"sitemap": "^8.0.3",
|
"sitemap": "^9.0.1",
|
||||||
"terser": "^5.46.2",
|
"terser": "^5.48.0",
|
||||||
"webpack": "^5.106.2",
|
"webpack": "^5.107.2",
|
||||||
"webpack-bundle-analyzer": "^5.3.0",
|
"webpack-bundle-analyzer": "^5.3.0",
|
||||||
"webpack-dev-server": "^5.0.4",
|
"webpack-dev-server": "^5.2.4",
|
||||||
"webpack-node-externals": "^3.0.0",
|
"webpack-node-externals": "^3.0.0",
|
||||||
"worker-loader": "^3.0.8"
|
"worker-loader": "^3.0.8"
|
||||||
},
|
},
|
||||||
@ -110,7 +111,7 @@
|
|||||||
"bootstrap-colorpicker": "^3.4.0",
|
"bootstrap-colorpicker": "^3.4.0",
|
||||||
"bootstrap-material-design": "^4.1.3",
|
"bootstrap-material-design": "^4.1.3",
|
||||||
"browserify-zlib": "^0.2.0",
|
"browserify-zlib": "^0.2.0",
|
||||||
"bson": "^4.7.2",
|
"bson": "^7.2.0",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"cbor": "9.0.2",
|
"cbor": "9.0.2",
|
||||||
"chi-squared": "^1.1.0",
|
"chi-squared": "^1.1.0",
|
||||||
@ -122,7 +123,7 @@
|
|||||||
"d3": "7.9.0",
|
"d3": "7.9.0",
|
||||||
"d3-hexbin": "^0.2.2",
|
"d3-hexbin": "^0.2.2",
|
||||||
"diff": "^5.2.2",
|
"diff": "^5.2.2",
|
||||||
"dompurify": "^3.4.2",
|
"dompurify": "^3.4.7",
|
||||||
"es6-promisify": "^7.0.0",
|
"es6-promisify": "^7.0.0",
|
||||||
"escodegen": "^2.1.0",
|
"escodegen": "^2.1.0",
|
||||||
"esprima": "^4.0.1",
|
"esprima": "^4.0.1",
|
||||||
@ -141,7 +142,7 @@
|
|||||||
"js-sha3": "^0.9.3",
|
"js-sha3": "^0.9.3",
|
||||||
"jsesc": "^3.1.0",
|
"jsesc": "^3.1.0",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"jsonata": "^2.1.0",
|
"jsonata": "^2.2.1",
|
||||||
"jsonpath-plus": "^10.4.0",
|
"jsonpath-plus": "^10.4.0",
|
||||||
"jsonwebtoken": "9.0.3",
|
"jsonwebtoken": "9.0.3",
|
||||||
"jsqr": "^1.4.0",
|
"jsqr": "^1.4.0",
|
||||||
@ -154,7 +155,7 @@
|
|||||||
"loglevel-message-prefix": "^3.0.0",
|
"loglevel-message-prefix": "^3.0.0",
|
||||||
"lz-string": "^1.5.0",
|
"lz-string": "^1.5.0",
|
||||||
"lz4js": "^0.2.0",
|
"lz4js": "^0.2.0",
|
||||||
"markdown-it": "^14.1.1",
|
"markdown-it": "^14.2.0",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"moment-timezone": "^0.6.2",
|
"moment-timezone": "^0.6.2",
|
||||||
"ngeohash": "^0.6.3",
|
"ngeohash": "^0.6.3",
|
||||||
@ -168,7 +169,7 @@
|
|||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"popper.js": "^1.16.1",
|
"popper.js": "^1.16.1",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"protobufjs": "^7.5.6",
|
"protobufjs": "^7.6.2",
|
||||||
"punycode.js": "^2.3.1",
|
"punycode.js": "^2.3.1",
|
||||||
"qr-image": "^3.2.0",
|
"qr-image": "^3.2.0",
|
||||||
"reflect-metadata": "^0.2.2",
|
"reflect-metadata": "^0.2.2",
|
||||||
@ -177,7 +178,7 @@
|
|||||||
"snackbarjs": "^1.1.0",
|
"snackbarjs": "^1.1.0",
|
||||||
"sortablejs": "^1.15.7",
|
"sortablejs": "^1.15.7",
|
||||||
"split.js": "^1.6.5",
|
"split.js": "^1.6.5",
|
||||||
"sql-formatter": "^15.7.3",
|
"sql-formatter": "^15.8.0",
|
||||||
"ssdeep.js": "0.0.3",
|
"ssdeep.js": "0.0.3",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"tesseract.js": "^6.0.1",
|
"tesseract.js": "^6.0.1",
|
||||||
|
|||||||
@ -189,6 +189,7 @@
|
|||||||
"Generate PGP Key Pair",
|
"Generate PGP Key Pair",
|
||||||
"PGP Encrypt",
|
"PGP Encrypt",
|
||||||
"PGP Decrypt",
|
"PGP Decrypt",
|
||||||
|
"PGP Sign",
|
||||||
"PGP Verify",
|
"PGP Verify",
|
||||||
"PGP Encrypt and Sign",
|
"PGP Encrypt and Sign",
|
||||||
"PGP Decrypt and Verify",
|
"PGP Decrypt and Verify",
|
||||||
@ -304,6 +305,7 @@
|
|||||||
"Diff",
|
"Diff",
|
||||||
"Remove whitespace",
|
"Remove whitespace",
|
||||||
"Remove null bytes",
|
"Remove null bytes",
|
||||||
|
"Remove ANSI Escape Codes",
|
||||||
"To Upper case",
|
"To Upper case",
|
||||||
"To Lower case",
|
"To Lower case",
|
||||||
"Swap case",
|
"Swap case",
|
||||||
|
|||||||
@ -39,41 +39,46 @@ class AESDecrypt extends Operation {
|
|||||||
"value": "",
|
"value": "",
|
||||||
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "IV Length",
|
||||||
|
"type": "number",
|
||||||
|
"value": 16
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Mode",
|
"name": "Mode",
|
||||||
"type": "argSelector",
|
"type": "argSelector",
|
||||||
"value": [
|
"value": [
|
||||||
{
|
{
|
||||||
name: "CBC",
|
name: "CBC",
|
||||||
off: [5, 6]
|
off: [6, 7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "CFB",
|
name: "CFB",
|
||||||
off: [5, 6]
|
off: [6, 7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "OFB",
|
name: "OFB",
|
||||||
off: [5, 6]
|
off: [6, 7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "CTR",
|
name: "CTR",
|
||||||
off: [5, 6]
|
off: [6, 7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "GCM",
|
name: "GCM",
|
||||||
on: [5, 6]
|
on: [6, 7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ECB",
|
name: "ECB",
|
||||||
off: [5, 6]
|
off: [6, 7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "CBC/NoPadding",
|
name: "CBC/NoPadding",
|
||||||
off: [5, 6]
|
off: [6, 7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ECB/NoPadding",
|
name: "ECB/NoPadding",
|
||||||
off: [5, 6]
|
off: [6, 7]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -98,6 +103,26 @@ class AESDecrypt extends Operation {
|
|||||||
"type": "toggleString",
|
"type": "toggleString",
|
||||||
"value": "",
|
"value": "",
|
||||||
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "IV from input",
|
||||||
|
"type": "argSelector",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
name: "Off",
|
||||||
|
on: [1],
|
||||||
|
off: [2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "From start",
|
||||||
|
on: [2],
|
||||||
|
off: [1]
|
||||||
|
}, {
|
||||||
|
name: "From end",
|
||||||
|
on: [2],
|
||||||
|
off: [1]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -110,14 +135,18 @@ class AESDecrypt extends Operation {
|
|||||||
* @throws {OperationError} if cannot decrypt input or invalid key length
|
* @throws {OperationError} if cannot decrypt input or invalid key length
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
|
let iv;
|
||||||
|
|
||||||
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
||||||
iv = Utils.convertToByteString(args[1].string, args[1].option),
|
ivLength = args[2],
|
||||||
mode = args[2].split("/")[0],
|
mode = args[3].split("/")[0],
|
||||||
noPadding = args[2].endsWith("NoPadding"),
|
noPadding = args[3].endsWith("NoPadding"),
|
||||||
inputType = args[3],
|
inputType = args[4],
|
||||||
outputType = args[4],
|
outputType = args[5],
|
||||||
gcmTag = Utils.convertToByteString(args[5].string, args[5].option),
|
gcmTag = Utils.convertToByteString(args[6].string, args[6].option),
|
||||||
aad = Utils.convertToByteString(args[6].string, args[6].option);
|
aad = Utils.convertToByteString(args[7].string, args[7].option),
|
||||||
|
ivFromInput = args[8];
|
||||||
|
|
||||||
|
|
||||||
if ([16, 24, 32].indexOf(key.length) < 0) {
|
if ([16, 24, 32].indexOf(key.length) < 0) {
|
||||||
throw new OperationError(`Invalid key length: ${key.length} bytes
|
throw new OperationError(`Invalid key length: ${key.length} bytes
|
||||||
@ -130,11 +159,27 @@ The following algorithms will be used based on the size of the key:
|
|||||||
|
|
||||||
input = Utils.convertToByteString(input, inputType);
|
input = Utils.convertToByteString(input, inputType);
|
||||||
|
|
||||||
|
if (ivFromInput !== "Off") {
|
||||||
|
if (input.length <= ivLength) {
|
||||||
|
throw new OperationError(`Input is too short to contain an IV of ${ivLength} bytes.`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ivFromInput === "From start") {
|
||||||
|
iv = input.substr(0, ivLength);
|
||||||
|
input = input.substr(ivLength);
|
||||||
|
} else {
|
||||||
|
iv = input.substr(input.length - ivLength);
|
||||||
|
input = input.substr(0, input.length - ivLength);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
iv = Utils.convertToByteString(args[1].string, args[1].option);
|
||||||
|
}
|
||||||
|
|
||||||
const decipher = forge.cipher.createDecipher("AES-" + mode, key);
|
const decipher = forge.cipher.createDecipher("AES-" + mode, key);
|
||||||
|
|
||||||
/* Allow for a "no padding" mode */
|
/* Allow for a "no padding" mode */
|
||||||
if (noPadding) {
|
if (noPadding) {
|
||||||
decipher.mode.unpad = function(output, options) {
|
decipher.mode.unpad = function (output, options) {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import Operation from "../Operation.mjs";
|
|||||||
import Utils from "../Utils.mjs";
|
import Utils from "../Utils.mjs";
|
||||||
import forge from "node-forge";
|
import forge from "node-forge";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
import { toHexFast } from "../lib/Hex.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AES Encrypt operation
|
* AES Encrypt operation
|
||||||
@ -92,6 +93,11 @@ class AESEncrypt extends Operation {
|
|||||||
"type": "toggleString",
|
"type": "toggleString",
|
||||||
"value": "",
|
"value": "",
|
||||||
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
"toggleValues": ["Hex", "UTF8", "Latin1", "Base64"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Include IV in output",
|
||||||
|
"type": "option",
|
||||||
|
"value": ["Off", "Prepend", "Append"]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -107,10 +113,11 @@ class AESEncrypt extends Operation {
|
|||||||
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
const key = Utils.convertToByteString(args[0].string, args[0].option),
|
||||||
iv = Utils.convertToByteString(args[1].string, args[1].option),
|
iv = Utils.convertToByteString(args[1].string, args[1].option),
|
||||||
mode = args[2].split("/")[0],
|
mode = args[2].split("/")[0],
|
||||||
noPadding = args[2].endsWith("NoPadding"),
|
noPadding = args[2].endsWith("NoPadding"),
|
||||||
inputType = args[3],
|
inputType = args[3],
|
||||||
outputType = args[4],
|
outputType = args[4],
|
||||||
aad = Utils.convertToByteString(args[5].string, args[5].option);
|
aad = Utils.convertToByteString(args[5].string, args[5].option),
|
||||||
|
includeIV = args[6];
|
||||||
|
|
||||||
if ([16, 24, 32].indexOf(key.length) < 0) {
|
if ([16, 24, 32].indexOf(key.length) < 0) {
|
||||||
throw new OperationError(`Invalid key length: ${key.length} bytes
|
throw new OperationError(`Invalid key length: ${key.length} bytes
|
||||||
@ -133,26 +140,34 @@ The following algorithms will be used based on the size of the key:
|
|||||||
additionalData: mode === "GCM" ? aad : undefined
|
additionalData: mode === "GCM" ? aad : undefined
|
||||||
});
|
});
|
||||||
if (noPadding) {
|
if (noPadding) {
|
||||||
cipher.mode.pad = function(output, options) {
|
cipher.mode.pad = function (output, options) {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
cipher.update(forge.util.createBuffer(input));
|
cipher.update(forge.util.createBuffer(input));
|
||||||
cipher.finish();
|
cipher.finish();
|
||||||
|
|
||||||
|
let output = cipher.output.getBytes();
|
||||||
|
|
||||||
|
if (includeIV === "Prepend") {
|
||||||
|
output = iv + output;
|
||||||
|
} else if (includeIV === "Append") {
|
||||||
|
output = output + iv;
|
||||||
|
}
|
||||||
|
|
||||||
if (outputType === "Hex") {
|
if (outputType === "Hex") {
|
||||||
|
output = toHexFast(Utils.strToByteArray(output));
|
||||||
|
|
||||||
if (mode === "GCM") {
|
if (mode === "GCM") {
|
||||||
return cipher.output.toHex() + "\n\n" +
|
return output + "\n\n" +
|
||||||
"Tag: " + cipher.mode.tag.toHex();
|
"Tag: " + cipher.mode.tag.toHex();
|
||||||
}
|
}
|
||||||
return cipher.output.toHex();
|
} else if (mode === "GCM") {
|
||||||
} else {
|
return output + "\n\n" +
|
||||||
if (mode === "GCM") {
|
"Tag: " + cipher.mode.tag.getBytes();
|
||||||
return cipher.output.getBytes() + "\n\n" +
|
|
||||||
"Tag: " + cipher.mode.tag.getBytes();
|
|
||||||
}
|
|
||||||
return cipher.output.getBytes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import bson from "bson";
|
import { deserialize } from "bson";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,7 +37,7 @@ class BSONDeserialise extends Operation {
|
|||||||
if (!input.byteLength) return "";
|
if (!input.byteLength) return "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = bson.deserialize(new Buffer(input));
|
const data = deserialize(new Uint8Array(input));
|
||||||
return JSON.stringify(data, null, 2);
|
return JSON.stringify(data, null, 2);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError(err.toString());
|
throw new OperationError(err.toString());
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import bson from "bson";
|
import { serialize } from "bson";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,7 +38,8 @@ class BSONSerialise extends Operation {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(input);
|
const data = JSON.parse(input);
|
||||||
return bson.serialize(data).buffer;
|
const result = serialize(data);
|
||||||
|
return result.buffer.slice(result.byteOffset, result.byteOffset + result.byteLength);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError(err.toString());
|
throw new OperationError(err.toString());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
import cptable from "codepage";
|
import cptable from "codepage";
|
||||||
import {CHR_ENC_CODE_PAGES} from "../lib/ChrEnc.mjs";
|
import {CHR_ENC_CODE_PAGES} from "../lib/ChrEnc.mjs";
|
||||||
|
|
||||||
@ -48,6 +49,9 @@ class DecodeText extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const format = CHR_ENC_CODE_PAGES[args[0]];
|
const format = CHR_ENC_CODE_PAGES[args[0]];
|
||||||
|
if (!format) {
|
||||||
|
throw new OperationError("Invalid encoding");
|
||||||
|
}
|
||||||
return cptable.utils.decode(format, new Uint8Array(input));
|
return cptable.utils.decode(format, new Uint8Array(input));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
import cptable from "codepage";
|
import cptable from "codepage";
|
||||||
import {CHR_ENC_CODE_PAGES} from "../lib/ChrEnc.mjs";
|
import {CHR_ENC_CODE_PAGES} from "../lib/ChrEnc.mjs";
|
||||||
|
|
||||||
@ -48,6 +49,9 @@ class EncodeText extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const format = CHR_ENC_CODE_PAGES[args[0]];
|
const format = CHR_ENC_CODE_PAGES[args[0]];
|
||||||
|
if (!format) {
|
||||||
|
throw new OperationError("Invalid encoding");
|
||||||
|
}
|
||||||
const encoded = cptable.utils.encode(format, input);
|
const encoded = cptable.utils.encode(format, input);
|
||||||
return new Uint8Array(encoded).buffer;
|
return new Uint8Array(encoded).buffer;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import { getSubkeySize, ASP } from "../lib/PGP.mjs";
|
|||||||
import { cryptNotice } from "../lib/Crypt.mjs";
|
import { cryptNotice } from "../lib/Crypt.mjs";
|
||||||
import * as es6promisify from "es6-promisify";
|
import * as es6promisify from "es6-promisify";
|
||||||
const promisify = es6promisify.default ? es6promisify.default.promisify : es6promisify.promisify;
|
const promisify = es6promisify.default ? es6promisify.default.promisify : es6promisify.promisify;
|
||||||
|
const KEY_FLAGS = kbpgp.const.openpgp.key_flags;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,11 +74,11 @@ class GeneratePGPKeyPair extends Operation {
|
|||||||
if (name) userIdentifier += name;
|
if (name) userIdentifier += name;
|
||||||
if (email) userIdentifier += ` <${email}>`;
|
if (email) userIdentifier += ` <${email}>`;
|
||||||
|
|
||||||
let flags = kbpgp.const.openpgp.certify_keys;
|
let flags = KEY_FLAGS.certify_keys;
|
||||||
flags |= kbpgp.const.openpgp.sign_data;
|
flags |= KEY_FLAGS.sign_data;
|
||||||
flags |= kbpgp.const.openpgp.auth;
|
flags |= KEY_FLAGS.auth;
|
||||||
flags |= kbpgp.const.openpgp.encrypt_comm;
|
flags |= KEY_FLAGS.encrypt_comm;
|
||||||
flags |= kbpgp.const.openpgp.encrypt_storage;
|
flags |= KEY_FLAGS.encrypt_storage;
|
||||||
|
|
||||||
const keyGenerationOptions = {
|
const keyGenerationOptions = {
|
||||||
userid: userIdentifier,
|
userid: userIdentifier,
|
||||||
@ -89,11 +90,11 @@ class GeneratePGPKeyPair extends Operation {
|
|||||||
},
|
},
|
||||||
subkeys: [{
|
subkeys: [{
|
||||||
"nbits": getSubkeySize(keySize),
|
"nbits": getSubkeySize(keySize),
|
||||||
"flags": kbpgp.const.openpgp.sign_data,
|
"flags": KEY_FLAGS.sign_data,
|
||||||
"expire_in": 86400 * 365 * 8
|
"expire_in": 86400 * 365 * 8
|
||||||
}, {
|
}, {
|
||||||
"nbits": getSubkeySize(keySize),
|
"nbits": getSubkeySize(keySize),
|
||||||
"flags": kbpgp.const.openpgp.encrypt_comm | kbpgp.const.openpgp.encrypt_storage,
|
"flags": KEY_FLAGS.encrypt_comm | KEY_FLAGS.encrypt_storage,
|
||||||
"expire_in": 86400 * 365 * 2
|
"expire_in": 86400 * 365 * 2
|
||||||
}],
|
}],
|
||||||
asp: ASP
|
asp: ASP
|
||||||
|
|||||||
83
src/core/operations/PGPSign.mjs
Normal file
83
src/core/operations/PGPSign.mjs
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
/**
|
||||||
|
* @author GCHQDeveloper581
|
||||||
|
* @copyright Crown Copyright 2026
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Operation from "../Operation.mjs";
|
||||||
|
import kbpgp from "kbpgp";
|
||||||
|
import { ASP, importPrivateKey } from "../lib/PGP.mjs";
|
||||||
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
|
import * as es6promisify from "es6-promisify";
|
||||||
|
const promisify = es6promisify.default ? es6promisify.default.promisify : es6promisify.promisify;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PGP Sign operation
|
||||||
|
*/
|
||||||
|
class PGPSign extends Operation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PGPSign constructor
|
||||||
|
*/
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.name = "PGP Sign";
|
||||||
|
this.module = "PGP";
|
||||||
|
this.description = [
|
||||||
|
"Input: the message you want to sign",
|
||||||
|
"<br><br>",
|
||||||
|
"Arguments: the ASCII-armoured PGP private key of the sender.",
|
||||||
|
"<br><br>",
|
||||||
|
"Pretty Good Privacy is an encryption standard (OpenPGP) used for encrypting, decrypting, and signing messages.",
|
||||||
|
"<br><br>",
|
||||||
|
"This function uses the Keybase implementation of PGP.",
|
||||||
|
].join("\n");
|
||||||
|
this.infoURL = "https://wikipedia.org/wiki/Pretty_Good_Privacy"; // Usually a Wikipedia link. Remember to remove localisation (i.e. https://wikipedia.org/etc rather than https://en.wikipedia.org/etc)
|
||||||
|
this.inputType = "string";
|
||||||
|
this.outputType = "string";
|
||||||
|
this.args = [
|
||||||
|
{
|
||||||
|
"name": "Private key of signer",
|
||||||
|
"type": "text",
|
||||||
|
"value": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Private key passphrase (optional)",
|
||||||
|
"type": "string",
|
||||||
|
"value": ""
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} input
|
||||||
|
* @param {Object[]} args
|
||||||
|
* @returns {string}
|
||||||
|
*
|
||||||
|
* @throws {OperationError} if failed private key import or failed encryption
|
||||||
|
*/
|
||||||
|
async run(input, args) {
|
||||||
|
const message = input,
|
||||||
|
[privateKey, passphrase] = args;
|
||||||
|
let signedMessage;
|
||||||
|
|
||||||
|
if (!privateKey) throw new OperationError("Enter the private key of the signer.");
|
||||||
|
const privKey = await importPrivateKey(privateKey, passphrase);
|
||||||
|
|
||||||
|
try {
|
||||||
|
signedMessage = await promisify(kbpgp.box)({
|
||||||
|
"msg": message,
|
||||||
|
"sign_with": privKey,
|
||||||
|
"asp": ASP
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
throw new OperationError(`Couldn't sign message: ${err}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return signedMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PGPSign;
|
||||||
@ -92,7 +92,7 @@ class ParseEthernetFrame extends Operation {
|
|||||||
const packetData = input.slice(offset);
|
const packetData = input.slice(offset);
|
||||||
|
|
||||||
if (outputFormat === "Packet data") {
|
if (outputFormat === "Packet data") {
|
||||||
return Utils.byteArrayToChars(packetData);
|
return Utils.escapeHtml(Utils.byteArrayToChars(packetData));
|
||||||
} else if (outputFormat === "Packet data (hex)") {
|
} else if (outputFormat === "Packet data (hex)") {
|
||||||
return toHex(packetData);
|
return toHex(packetData);
|
||||||
} else if (outputFormat === "Text output") {
|
} else if (outputFormat === "Text output") {
|
||||||
|
|||||||
@ -138,7 +138,7 @@ class ParseIPv4Header extends Operation {
|
|||||||
} else if (outputFormat === "Data (hex)") {
|
} else if (outputFormat === "Data (hex)") {
|
||||||
return toHex(data);
|
return toHex(data);
|
||||||
} else if (outputFormat === "Data (raw)") {
|
} else if (outputFormat === "Data (raw)") {
|
||||||
return Utils.byteArrayToChars(data);
|
return Utils.escapeHtml(Utils.byteArrayToChars(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
import Operation from "../Operation.mjs";
|
import Operation from "../Operation.mjs";
|
||||||
import OperationError from "../errors/OperationError.mjs";
|
import OperationError from "../errors/OperationError.mjs";
|
||||||
import BSON from "bson";
|
import { ObjectId } from "bson";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse ObjectID timestamp operation
|
* Parse ObjectID timestamp operation
|
||||||
@ -35,7 +35,7 @@ class ParseObjectIDTimestamp extends Operation {
|
|||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
try {
|
try {
|
||||||
const objectId = new BSON.ObjectID(input);
|
const objectId = new ObjectId(input);
|
||||||
return objectId.getTimestamp().toISOString();
|
return objectId.getTimestamp().toISOString();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new OperationError(err);
|
throw new OperationError(err);
|
||||||
|
|||||||
41
src/core/operations/RemoveANSIEscapeCodes.mjs
Normal file
41
src/core/operations/RemoveANSIEscapeCodes.mjs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/**
|
||||||
|
* @author Louis-Ladd [lewisharshman1@gmail.com]
|
||||||
|
* @copyright Crown Copyright 2025
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import Operation from "../Operation.mjs";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove ANSI Escape Codes operation
|
||||||
|
*/
|
||||||
|
class RemoveANSIEscapeCodes extends Operation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RemoveANSIEscapeCodes constructor
|
||||||
|
*/
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.name = "Remove ANSI Escape Codes";
|
||||||
|
this.module = "Default";
|
||||||
|
this.description = "Removes ANSI Escape Codes.";
|
||||||
|
this.infoURL = "https://wikipedia.org/wiki/ANSI_escape_code";
|
||||||
|
this.inputType = "string";
|
||||||
|
this.outputType = "string";
|
||||||
|
this.args = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} input
|
||||||
|
* @param {Object[]} args
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
run(input, args) {
|
||||||
|
const ansiRegex = /\x1B\[[0-?]*[ -/]*[@-~]/g;
|
||||||
|
return input.replace(ansiRegex, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default RemoveANSIEscapeCodes;
|
||||||
@ -15,6 +15,20 @@ import Utils from "../Utils.mjs";
|
|||||||
const d3 = d3temp.default ? d3temp.default : d3temp;
|
const d3 = d3temp.default ? d3temp.default : d3temp;
|
||||||
const nodom = nodomtemp.default ? nodomtemp.default: nodomtemp;
|
const nodom = nodomtemp.default ? nodomtemp.default: nodomtemp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes D3's internal bound data from a nodom tree before serialization.
|
||||||
|
* nodom serializes enumerable expando properties such as __data__ as attributes,
|
||||||
|
* so leaving them on attacker-controlled values can create executable markup.
|
||||||
|
*
|
||||||
|
* @param {Object} node
|
||||||
|
*/
|
||||||
|
function clearD3BoundData(node) {
|
||||||
|
delete node.__data__;
|
||||||
|
|
||||||
|
if (!node.childNodes) return;
|
||||||
|
node.childNodes.forEach(clearD3BoundData);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Series chart operation
|
* Series chart operation
|
||||||
*/
|
*/
|
||||||
@ -222,6 +236,8 @@ class SeriesChart extends Operation {
|
|||||||
.text(serie.name);
|
.text(serie.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
clearD3BoundData(svg.node());
|
||||||
|
|
||||||
return svg._groups[0][0].outerHTML;
|
return svg._groups[0][0].outerHTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,14 @@ class App {
|
|||||||
this.progress = 0;
|
this.progress = 0;
|
||||||
this.ingId = 0;
|
this.ingId = 0;
|
||||||
|
|
||||||
|
// stateChangeId increments on every statechange dispatch; bakeStateId records
|
||||||
|
// the stateChangeId captured when the most recent bake started. autoBake uses
|
||||||
|
// these to decide whether the output is genuinely stale, so a debounced
|
||||||
|
// autoBake firing shortly after a manual bake doesn't clobber the bake's
|
||||||
|
// hideStaleIndicator with a redundant showStaleIndicator.
|
||||||
|
this.stateChangeId = 0;
|
||||||
|
this.bakeStateId = -1;
|
||||||
|
|
||||||
this.appLoaded = false;
|
this.appLoaded = false;
|
||||||
this.workerLoaded = false;
|
this.workerLoaded = false;
|
||||||
this.waitersLoaded = false;
|
this.waitersLoaded = false;
|
||||||
@ -136,6 +144,9 @@ class App {
|
|||||||
bake(step=false) {
|
bake(step=false) {
|
||||||
if (this.baking) return;
|
if (this.baking) return;
|
||||||
|
|
||||||
|
// Record which state version this bake is covering.
|
||||||
|
this.bakeStateId = this.stateChangeId;
|
||||||
|
|
||||||
// Reset attemptHighlight flag
|
// Reset attemptHighlight flag
|
||||||
this.options.attemptHighlight = true;
|
this.options.attemptHighlight = true;
|
||||||
|
|
||||||
@ -166,7 +177,10 @@ class App {
|
|||||||
nums: [this.manager.tabs.getActiveTab("input")],
|
nums: [this.manager.tabs.getActiveTab("input")],
|
||||||
step: false
|
step: false
|
||||||
});
|
});
|
||||||
} else {
|
} else if (this.bakeStateId < this.stateChangeId) {
|
||||||
|
// Only show stale-indicator if the most recent bake didn't cover the
|
||||||
|
// current state. Without this guard, a debounced autoBake firing after
|
||||||
|
// a manual bake completed would re-show the indicator on fresh output.
|
||||||
this.manager.controls.showStaleIndicator();
|
this.manager.controls.showStaleIndicator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -768,6 +782,10 @@ class App {
|
|||||||
* @param {event} e
|
* @param {event} e
|
||||||
*/
|
*/
|
||||||
stateChange(e) {
|
stateChange(e) {
|
||||||
|
// Bump the state-change counter synchronously so a manual bake invoked between
|
||||||
|
// here and the debounced autoBake firing can record it via bakeStateId.
|
||||||
|
this.stateChangeId++;
|
||||||
|
|
||||||
debounce(function() {
|
debounce(function() {
|
||||||
this.progress = 0;
|
this.progress = 0;
|
||||||
this.autoBake();
|
this.autoBake();
|
||||||
|
|||||||
@ -166,6 +166,7 @@ class HTMLIngredient {
|
|||||||
id="${this.id}"
|
id="${this.id}"
|
||||||
tabindex="${this.tabIndex}"
|
tabindex="${this.tabIndex}"
|
||||||
arg-name="${this.name}"
|
arg-name="${this.name}"
|
||||||
|
data-target="${this.target}"
|
||||||
${this.disabled ? "disabled" : ""}>`;
|
${this.disabled ? "disabled" : ""}>`;
|
||||||
for (i = 0; i < this.value.length; i++) {
|
for (i = 0; i < this.value.length; i++) {
|
||||||
if ((m = this.value[i].name.match(/\[([a-z0-9 -()^]+)\]/i))) {
|
if ((m = this.value[i].name.match(/\[([a-z0-9 -()^]+)\]/i))) {
|
||||||
|
|||||||
@ -868,15 +868,15 @@
|
|||||||
Be aware that the standalone version will never update itself, meaning it will not receive bug fixes or new features until you re-download newer versions manually.
|
Be aware that the standalone version will never update itself, meaning it will not receive bug fixes or new features until you re-download newer versions manually.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h6>CyberChef v<%= htmlWebpackPlugin.options.version %></h6>
|
<h6>CyberChef <%= htmlWebpackPlugin.options.version %></h6>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Build time: <%= htmlWebpackPlugin.options.compileTime %></li>
|
<li>Build time: <%= htmlWebpackPlugin.options.compileTime %></li>
|
||||||
<li>The changelog for this version can be viewed <a href="https://github.com/gchq/CyberChef/blob/v<%= htmlWebpackPlugin.options.version %>/CHANGELOG.md">here</a></li>
|
<li>The changelog for this version can be viewed <a href="https://github.com/gchq/CyberChef/blob/v<%= htmlWebpackPlugin.options.latestReleaseVersion %>/CHANGELOG.md">here</a></li>
|
||||||
<li>© Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %></li>
|
<li>© Crown Copyright 2016-<%= htmlWebpackPlugin.options.compileYear %></li>
|
||||||
<li>Released under the Apache Licence, Version 2.0</li>
|
<li>Released under the Apache Licence, Version 2.0</li>
|
||||||
<li>SHA256 hash: DOWNLOAD_HASH_PLACEHOLDER</li>
|
<li>SHA256 hash: DOWNLOAD_HASH_PLACEHOLDER</li>
|
||||||
</ul>
|
</ul>
|
||||||
<a href="CyberChef_v<%= htmlWebpackPlugin.options.version %>.zip" download class="btn btn-outline-primary">Download ZIP file</a>
|
<a href="<%= htmlWebpackPlugin.options.downloadZipFilename %>" download class="btn btn-outline-primary">Download ZIP file</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
|
<button type="button" class="btn btn-primary" data-dismiss="modal">Ok</button>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import sm from "sitemap";
|
import { SitemapStream, streamToPromise } from "sitemap";
|
||||||
import OperationConfig from "../../core/config/OperationConfig.json" with { type: "json" };
|
import OperationConfig from "../../core/config/OperationConfig.json" with { type: "json" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -11,7 +11,7 @@ import OperationConfig from "../../core/config/OperationConfig.json" with { type
|
|||||||
|
|
||||||
const baseUrl = "https://gchq.github.io/CyberChef/";
|
const baseUrl = "https://gchq.github.io/CyberChef/";
|
||||||
|
|
||||||
const smStream = new sm.SitemapStream({});
|
const smStream = new SitemapStream({});
|
||||||
|
|
||||||
smStream.write({
|
smStream.write({
|
||||||
url: baseUrl,
|
url: baseUrl,
|
||||||
@ -28,6 +28,6 @@ for (const op in OperationConfig) {
|
|||||||
}
|
}
|
||||||
smStream.end();
|
smStream.end();
|
||||||
|
|
||||||
sm.streamToPromise(smStream).then(
|
streamToPromise(smStream).then(
|
||||||
(buffer) => console.log(buffer.toString()), // eslint-disable-line no-console
|
(buffer) => console.log(buffer.toString()), // eslint-disable-line no-console
|
||||||
);
|
);
|
||||||
|
|||||||
@ -487,11 +487,19 @@ class RecipeWaiter {
|
|||||||
* @param {HTMLElement} op
|
* @param {HTMLElement} op
|
||||||
*/
|
*/
|
||||||
triggerArgEvents(op) {
|
triggerArgEvents(op) {
|
||||||
// Trigger populateOption and argSelector events
|
// Trigger argSelector events and populateOption events only where the target is empty.
|
||||||
|
// When loading a saved recipe, arguments are populated before this method is called, so
|
||||||
|
// re-triggering populateOption events would overwrite saved custom values with defaults.
|
||||||
|
const args = op.querySelectorAll(".arg");
|
||||||
const triggerableOptions = op.querySelectorAll(".populate-option, .arg-selector");
|
const triggerableOptions = op.querySelectorAll(".populate-option, .arg-selector");
|
||||||
const evt = new Event("change", {bubbles: true});
|
const evt = new Event("change", {bubbles: true});
|
||||||
|
|
||||||
if (triggerableOptions.length) {
|
if (triggerableOptions.length) {
|
||||||
for (const el of triggerableOptions) {
|
for (const el of triggerableOptions) {
|
||||||
|
if (el.classList.contains("populate-option")) {
|
||||||
|
const target = args[el.getAttribute("data-target")];
|
||||||
|
if (target && target.value !== "") continue;
|
||||||
|
}
|
||||||
el.dispatchEvent(evt);
|
el.dispatchEvent(evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,8 +30,8 @@ module.exports = {
|
|||||||
testOp(browser, "A1Z26 Cipher Decode", "20 5 19 20 15 21 20 16 21 20", "testoutput");
|
testOp(browser, "A1Z26 Cipher Decode", "20 5 19 20 15 21 20 16 21 20", "testoutput");
|
||||||
testOp(browser, "A1Z26 Cipher Encode", "test input", "20 5 19 20 9 14 16 21 20");
|
testOp(browser, "A1Z26 Cipher Encode", "test input", "20 5 19 20 9 14 16 21 20");
|
||||||
testOp(browser, "ADD", "test input", "Ê»ÉÊv¿ÄÆËÊ", [{ "option": "Hex", "string": "56" }]);
|
testOp(browser, "ADD", "test input", "Ê»ÉÊv¿ÄÆËÊ", [{ "option": "Hex", "string": "56" }]);
|
||||||
testOp(browser, "AES Decrypt", "b443f7f7c16ac5396a34273f6f639caa", "test output", [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff" }, { "option": "Hex", "string": "00000000000000000000000000000000" }, "CBC", "Hex", "Raw", { "option": "Hex", "string": "" }]);
|
testOp(browser, "AES Decrypt", "b443f7f7c16ac5396a34273f6f639caa", "test output", [{ "option": "Hex", "string": "00112233445566778899aabbccddeeff" }, { "option": "Hex", "string": "00000000000000000000000000000000" }, 16, "CBC", "Hex", "Raw", { "option": "Hex", "string": "" }, { "option": "Hex", "string": "" }, "Off"]);
|
||||||
testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex"]);
|
testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex", "Off"]);
|
||||||
testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]);
|
testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]);
|
||||||
testOp(browser, "Add line numbers", "test input", "1 test input");
|
testOp(browser, "Add line numbers", "test input", "1 test input");
|
||||||
testOp(browser, ["From Hex", "Add Text To Image", "SHA2"], Images.PNG_HEX, "50cdf8ea483c55564a091650c2bccb4586f919b721e5fe9d6a61660505b4346d6ebdb2ef0cf075a7728cd84cb26ea3e477b5bd86a94a49a27d79423994afb60a", [[], ["Chef", "Center", "Middle", 0, 0, 16, "Roboto"], []]);
|
testOp(browser, ["From Hex", "Add Text To Image", "SHA2"], Images.PNG_HEX, "50cdf8ea483c55564a091650c2bccb4586f919b721e5fe9d6a61660505b4346d6ebdb2ef0cf075a7728cd84cb26ea3e477b5bd86a94a49a27d79423994afb60a", [[], ["Chef", "Center", "Middle", 0, 0, 16, "Roboto"], []]);
|
||||||
|
|||||||
48
tests/browser/03_recipe_load.js
Normal file
48
tests/browser/03_recipe_load.js
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* Regression tests for recipe loading behaviour.
|
||||||
|
*
|
||||||
|
* @author C85297 [95289555+C85297@users.noreply.github.com]
|
||||||
|
* @copyright Crown Copyright
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
const utils = require("./browserUtils.js");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
before: browser => {
|
||||||
|
browser
|
||||||
|
.resizeWindow(1280, 800)
|
||||||
|
.url(browser.launchUrl)
|
||||||
|
.useCss()
|
||||||
|
.waitForElementNotPresent("#preloader", 10000);
|
||||||
|
},
|
||||||
|
|
||||||
|
"Recipe load preserves populated arguments": browser => {
|
||||||
|
const inputFormat = "HH:mm:ss a MMM DD, YYYY ";
|
||||||
|
const input = "10:20:30 pm Sep 26, 2019 ";
|
||||||
|
|
||||||
|
utils.loadRecipe(
|
||||||
|
browser,
|
||||||
|
"Translate DateTime Format",
|
||||||
|
input,
|
||||||
|
[
|
||||||
|
"Standard date and time",
|
||||||
|
inputFormat,
|
||||||
|
"UTC",
|
||||||
|
"DD/MM/YYYY HH:mm:ss",
|
||||||
|
"UTC"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
browser.execute(() => {
|
||||||
|
return Array.from(document.querySelectorAll("#rec-list li.operation .arg"))
|
||||||
|
.map(arg => arg.value);
|
||||||
|
}, [], function({value}) {
|
||||||
|
browser.expect(value[1]).to.equal(inputFormat);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
after: browser => {
|
||||||
|
browser.end();
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -51,14 +51,17 @@ function setInput(browser, input, type=true) {
|
|||||||
*/
|
*/
|
||||||
function bake(browser) {
|
function bake(browser) {
|
||||||
browser
|
browser
|
||||||
|
// Let any pending debounced inputChange/stateChange (~20ms each) fire so the
|
||||||
|
// worker has the latest input buffer before we ask it to bake.
|
||||||
|
.pause(50)
|
||||||
// Ensure we're not currently busy
|
// Ensure we're not currently busy
|
||||||
.waitForElementNotVisible("#output-loader", 5000)
|
.waitForElementNotVisible("#output-loader", 10000)
|
||||||
.expect.element("#bake span").text.to.equal("BAKE!");
|
.expect.element("#bake span").text.to.equal("BAKE!");
|
||||||
|
|
||||||
browser
|
browser
|
||||||
.click("#bake")
|
.click("#bake")
|
||||||
.waitForElementNotVisible("#stale-indicator", 5000)
|
.waitForElementNotVisible("#stale-indicator", 10000)
|
||||||
.waitForElementNotVisible("#output-loader", 5000);
|
.waitForElementNotVisible("#output-loader", 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @function
|
/** @function
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import {
|
|||||||
import TestRegister from "../lib/TestRegister.mjs";
|
import TestRegister from "../lib/TestRegister.mjs";
|
||||||
import "./tests/nodeApi.mjs";
|
import "./tests/nodeApi.mjs";
|
||||||
import "./tests/operations.mjs";
|
import "./tests/operations.mjs";
|
||||||
|
import "./tests/PGP.mjs";
|
||||||
import "./tests/File.mjs";
|
import "./tests/File.mjs";
|
||||||
import "./tests/Dish.mjs";
|
import "./tests/Dish.mjs";
|
||||||
import "./tests/NodeDish.mjs";
|
import "./tests/NodeDish.mjs";
|
||||||
|
|||||||
69
tests/node/tests/PGP.mjs
Normal file
69
tests/node/tests/PGP.mjs
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
* PGP node tests.
|
||||||
|
*
|
||||||
|
* @author C85297 [95289555+C85297@users.noreply.github.com]
|
||||||
|
* @copyright Crown Copyright 2026
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import assert from "assert";
|
||||||
|
import kbpgp from "kbpgp";
|
||||||
|
import * as es6promisify from "es6-promisify";
|
||||||
|
|
||||||
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
|
import it from "../assertionHandler.mjs";
|
||||||
|
import GeneratePGPKeyPair from "../../../src/core/operations/GeneratePGPKeyPair.mjs";
|
||||||
|
|
||||||
|
const promisify = es6promisify.default ? es6promisify.default.promisify : es6promisify.promisify;
|
||||||
|
|
||||||
|
const PUBLIC_KEY_BLOCK = /-----BEGIN PGP PUBLIC KEY BLOCK-----[\s\S]*-----END PGP PUBLIC KEY BLOCK-----/;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a PGP key pair and import the generated public key.
|
||||||
|
*
|
||||||
|
* @param {string} keyType
|
||||||
|
* @returns {Promise<Object>}
|
||||||
|
*/
|
||||||
|
async function generateAndImportPublicKey(keyType) {
|
||||||
|
const operation = new GeneratePGPKeyPair();
|
||||||
|
const generatedKeyPair = await operation.run("", [
|
||||||
|
keyType,
|
||||||
|
"",
|
||||||
|
"User",
|
||||||
|
"akb@notreal.gchq.gov.uk"
|
||||||
|
]);
|
||||||
|
|
||||||
|
const publicKey = generatedKeyPair.match(PUBLIC_KEY_BLOCK);
|
||||||
|
|
||||||
|
assert(publicKey, "Generated key pair should contain an ASCII-armoured public key");
|
||||||
|
|
||||||
|
return promisify(kbpgp.KeyManager.import_from_armored_pgp)({
|
||||||
|
armored: publicKey[0],
|
||||||
|
opts: {
|
||||||
|
"no_check_keys": true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
TestRegister.addApiTests([
|
||||||
|
it("Generate PGP Key Pair: ECC keys should include ECDSA signing and ECDH encryption subkeys", async () => {
|
||||||
|
const publicKey = await generateAndImportPublicKey("ECC-256");
|
||||||
|
const subkeyAlgorithms = publicKey.subkeys.map(subkey => subkey.key.type);
|
||||||
|
|
||||||
|
assert.strictEqual(
|
||||||
|
publicKey.primary.key.type,
|
||||||
|
kbpgp.const.openpgp.public_key_algorithms.ECDSA,
|
||||||
|
"Generated ECC PGP primary key should use ECDSA"
|
||||||
|
);
|
||||||
|
|
||||||
|
assert(
|
||||||
|
subkeyAlgorithms.includes(kbpgp.const.openpgp.public_key_algorithms.ECDSA),
|
||||||
|
"Generated ECC PGP key should include an ECDSA signing subkey"
|
||||||
|
);
|
||||||
|
|
||||||
|
assert(
|
||||||
|
subkeyAlgorithms.includes(kbpgp.const.openpgp.public_key_algorithms.ECDH),
|
||||||
|
"Generated ECC PGP key should include an ECDH encryption subkey"
|
||||||
|
);
|
||||||
|
})
|
||||||
|
]);
|
||||||
@ -79,7 +79,46 @@ TestRegister.addApiTests([
|
|||||||
string: "some iv some iv1",
|
string: "some iv some iv1",
|
||||||
option: "utf8",
|
option: "utf8",
|
||||||
},
|
},
|
||||||
|
ivLength: 16,
|
||||||
mode: "OFB",
|
mode: "OFB",
|
||||||
|
inputType: "Hex",
|
||||||
|
outputType: "Raw",
|
||||||
|
gcmTag: {
|
||||||
|
option: "Hex",
|
||||||
|
string: ""
|
||||||
|
},
|
||||||
|
aad: {
|
||||||
|
option: "Hex",
|
||||||
|
string: ""
|
||||||
|
},
|
||||||
|
ivFromInput: "Off"
|
||||||
|
});
|
||||||
|
assert.equal(result.toString(), "a slightly longer sampleinput?");
|
||||||
|
}),
|
||||||
|
|
||||||
|
it("AES decrypt: IV from input", () => {
|
||||||
|
const result = AESDecrypt("4a123af235a507bbc9d5871721d61b98504d569a9a5a7847e2d78315fec7736f6d6520697620736f6d6520697631", {
|
||||||
|
key: {
|
||||||
|
string: "some longer key1",
|
||||||
|
option: "utf8",
|
||||||
|
},
|
||||||
|
iv: {
|
||||||
|
string: "",
|
||||||
|
option: "Hex",
|
||||||
|
},
|
||||||
|
ivLength: 16,
|
||||||
|
mode: "OFB",
|
||||||
|
inputType: "Hex",
|
||||||
|
outputType: "Raw",
|
||||||
|
gcmTag: {
|
||||||
|
option: "Hex",
|
||||||
|
string: ""
|
||||||
|
},
|
||||||
|
aad: {
|
||||||
|
option: "Hex",
|
||||||
|
string: ""
|
||||||
|
},
|
||||||
|
ivFromInput: "From end"
|
||||||
});
|
});
|
||||||
assert.equal(result.toString(), "a slightly longer sampleinput?");
|
assert.equal(result.toString(), "a slightly longer sampleinput?");
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -127,6 +127,7 @@ import "./tests/NormaliseUnicode.mjs";
|
|||||||
import "./tests/NTLM.mjs";
|
import "./tests/NTLM.mjs";
|
||||||
import "./tests/OTP.mjs";
|
import "./tests/OTP.mjs";
|
||||||
import "./tests/ParseEthernetFrame.mjs";
|
import "./tests/ParseEthernetFrame.mjs";
|
||||||
|
import "./tests/ParseIPv4Header.mjs";
|
||||||
import "./tests/ParseIPRange.mjs";
|
import "./tests/ParseIPRange.mjs";
|
||||||
import "./tests/ParseObjectIDTimestamp.mjs";
|
import "./tests/ParseObjectIDTimestamp.mjs";
|
||||||
import "./tests/ParseQRCode.mjs";
|
import "./tests/ParseQRCode.mjs";
|
||||||
@ -148,6 +149,7 @@ import "./tests/Rabbit.mjs";
|
|||||||
import "./tests/RAKE.mjs";
|
import "./tests/RAKE.mjs";
|
||||||
import "./tests/Regex.mjs";
|
import "./tests/Regex.mjs";
|
||||||
import "./tests/Register.mjs";
|
import "./tests/Register.mjs";
|
||||||
|
import "./tests/RemoveANSIEscapeCodes.mjs";
|
||||||
import "./tests/RegularExpression.mjs";
|
import "./tests/RegularExpression.mjs";
|
||||||
import "./tests/RenderMarkdown.mjs";
|
import "./tests/RenderMarkdown.mjs";
|
||||||
import "./tests/RisonEncodeDecode.mjs";
|
import "./tests/RisonEncodeDecode.mjs";
|
||||||
|
|||||||
@ -68,6 +68,32 @@ TestRegister.addTests([
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Encode text: empty encoding",
|
||||||
|
input: "hello",
|
||||||
|
expectedOutput: "Invalid encoding",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Encode text",
|
||||||
|
"args": [""]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Decode text: empty encoding",
|
||||||
|
input: "68 65 6c 6c 6f",
|
||||||
|
expectedOutput: "Invalid encoding",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "From Hex",
|
||||||
|
"args": ["Space"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "Decode text",
|
||||||
|
"args": [""]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Generate Base64 Windows PowerShell",
|
name: "Generate Base64 Windows PowerShell",
|
||||||
input: "ZABpAHIAIAAiAGMAOgBcAHAAcgBvAGcAcgBhAG0AIABmAGkAbABlAHMAIgAgAA==",
|
input: "ZABpAHIAIAAiAGMAOgBcAHAAcgBvAGcAcgBhAG0AIABmAGkAbABlAHMAIgAgAA==",
|
||||||
|
|||||||
@ -41,6 +41,17 @@ TestRegister.addTests([
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Series chart escapes x-axis values in serialized SVG",
|
||||||
|
input: `s,x"><script>globalThis.seriesChartInjected=1</script><g a=",1`,
|
||||||
|
unexpectedMatch: /<script>|__data__=/,
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Series chart",
|
||||||
|
"args": ["Line feed", "Comma", "", 1, "red"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "Heatmap chart",
|
name: "Heatmap chart",
|
||||||
input: "100 100\n200 200\n300 300\n400 400\n500 500",
|
input: "100 100\n200 200\n300 300\n400 400\n500 500",
|
||||||
|
|||||||
@ -74,7 +74,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
"CBC", "Raw", "Hex",
|
"CBC", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -90,7 +91,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
||||||
"CBC", "Raw", "Hex",
|
"CBC", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -106,7 +108,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
||||||
"CTR", "Raw", "Hex",
|
"CTR", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -122,7 +125,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
"CBC", "Raw", "Hex",
|
"CBC", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -138,7 +142,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
"CFB", "Raw", "Hex",
|
"CFB", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -154,7 +159,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
"OFB", "Raw", "Hex",
|
"OFB", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -170,7 +176,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
"CTR", "Raw", "Hex",
|
"CTR", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -186,7 +193,8 @@ The following algorithms will be used based on the size of the key:
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
"ECB", "Raw", "Hex",
|
"ECB", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -204,7 +212,8 @@ Tag: 16a3e732a605cc9ca29108f742ca0743`,
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
"GCM", "Raw", "Hex",
|
"GCM", "Raw", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -222,7 +231,8 @@ Tag: 3b5378917f67b0aade9891fc6c291646`,
|
|||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "ffeeddccbbaa99887766554433221100"},
|
{"option": "Hex", "string": "ffeeddccbbaa99887766554433221100"},
|
||||||
"GCM", "Raw", "Hex",
|
"GCM", "Raw", "Hex",
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -238,7 +248,8 @@ Tag: 3b5378917f67b0aade9891fc6c291646`,
|
|||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CBC", "Hex", "Hex",
|
"CBC", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -254,7 +265,8 @@ Tag: 3b5378917f67b0aade9891fc6c291646`,
|
|||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CFB", "Hex", "Hex",
|
"CFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -270,7 +282,8 @@ Tag: 3b5378917f67b0aade9891fc6c291646`,
|
|||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"OFB", "Hex", "Hex",
|
"OFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -286,7 +299,8 @@ Tag: 3b5378917f67b0aade9891fc6c291646`,
|
|||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CTR", "Hex", "Hex",
|
"CTR", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -304,7 +318,8 @@ Tag: 70fad2ca19412c20f40fd06918736e56`,
|
|||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -322,7 +337,8 @@ Tag: 61cc4b70809452b0b3e38f913fa0a109`,
|
|||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -338,7 +354,8 @@ Tag: 61cc4b70809452b0b3e38f913fa0a109`,
|
|||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"ECB", "Hex", "Hex",
|
"ECB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -354,7 +371,8 @@ Tag: 61cc4b70809452b0b3e38f913fa0a109`,
|
|||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CBC", "Hex", "Hex",
|
"CBC", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -370,7 +388,8 @@ Tag: 61cc4b70809452b0b3e38f913fa0a109`,
|
|||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CFB", "Hex", "Hex",
|
"CFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -386,7 +405,8 @@ Tag: 61cc4b70809452b0b3e38f913fa0a109`,
|
|||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"OFB", "Hex", "Hex",
|
"OFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -402,7 +422,8 @@ Tag: 61cc4b70809452b0b3e38f913fa0a109`,
|
|||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CTR", "Hex", "Hex",
|
"CTR", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -420,7 +441,8 @@ Tag: 86db597d5302595223cadbd990f1309b`,
|
|||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -438,7 +460,8 @@ Tag: aeedf3e6ca4201577c0cf3e9ce58159d`,
|
|||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -454,7 +477,8 @@ Tag: aeedf3e6ca4201577c0cf3e9ce58159d`,
|
|||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"ECB", "Hex", "Hex",
|
"ECB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -470,7 +494,8 @@ Tag: aeedf3e6ca4201577c0cf3e9ce58159d`,
|
|||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CBC", "Hex", "Hex",
|
"CBC", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -486,7 +511,8 @@ Tag: aeedf3e6ca4201577c0cf3e9ce58159d`,
|
|||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CFB", "Hex", "Hex",
|
"CFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -502,7 +528,8 @@ Tag: aeedf3e6ca4201577c0cf3e9ce58159d`,
|
|||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"OFB", "Hex", "Hex",
|
"OFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -518,7 +545,8 @@ Tag: aeedf3e6ca4201577c0cf3e9ce58159d`,
|
|||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"CTR", "Hex", "Hex",
|
"CTR", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -536,7 +564,8 @@ Tag: 821b1e5f32dad052e502775a523d957a`,
|
|||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -554,7 +583,8 @@ Tag: a8f04c4d93bbef82bef61a103371aef9`,
|
|||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -570,7 +600,46 @@ Tag: a8f04c4d93bbef82bef61a103371aef9`,
|
|||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
"ECB", "Hex", "Hex",
|
"ECB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AES Encrypt: AES-256-GCM, Binary, AAD, prepend IV to output",
|
||||||
|
input: "7a0e643132750e96d805d11e9e48e281fa39a41039286423cc1c045e5442b40bf1c3f2822bded3f9c8ef11cb25da64dda9c7ab87c246bd305385150c98f31465c2a6180fe81d31ea289b916504d5a12e1de26cb10adba84a0cb0c86f94bc14bc554f3018",
|
||||||
|
expectedOutput: `1748e7179bd56570d51fa4ba287cc3e51287f188ad4d7ab0d9ff69b3c29cb11f861389532d8cb9337181da2e8cfc74a84927e8c0dd7a28a32fd485afe694259a63c199b199b95edd87c7aa95329feac340f2b78b72956a85f367044d821766b1b7135815571df44900695f1518cf3ae38ecb650f
|
||||||
|
|
||||||
|
Tag: a8f04c4d93bbef82bef61a103371aef9`,
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Encrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
"GCM", "Hex", "Hex",
|
||||||
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Prepend"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AES Encrypt: AES-256-GCM, Binary, AAD, append IV to output",
|
||||||
|
input: "7a0e643132750e96d805d11e9e48e281fa39a41039286423cc1c045e5442b40bf1c3f2822bded3f9c8ef11cb25da64dda9c7ab87c246bd305385150c98f31465c2a6180fe81d31ea289b916504d5a12e1de26cb10adba84a0cb0c86f94bc14bc554f3018",
|
||||||
|
expectedOutput: `1287f188ad4d7ab0d9ff69b3c29cb11f861389532d8cb9337181da2e8cfc74a84927e8c0dd7a28a32fd485afe694259a63c199b199b95edd87c7aa95329feac340f2b78b72956a85f367044d821766b1b7135815571df44900695f1518cf3ae38ecb650f1748e7179bd56570d51fa4ba287cc3e5
|
||||||
|
|
||||||
|
Tag: a8f04c4d93bbef82bef61a103371aef9`,
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Encrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
"GCM", "Hex", "Hex",
|
||||||
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Append"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -776,9 +845,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
|
16,
|
||||||
"CBC", "Hex", "Raw",
|
"CBC", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -793,9 +864,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
||||||
|
16,
|
||||||
"CBC", "Hex", "Raw",
|
"CBC", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -810,9 +883,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
{"option": "Hex", "string": "00000000000000000000000000000000"},
|
||||||
|
16,
|
||||||
"CTR", "Hex", "Raw",
|
"CTR", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -827,9 +902,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
|
16,
|
||||||
"CBC", "Hex", "Raw",
|
"CBC", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -844,9 +921,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
|
16,
|
||||||
"CFB", "Hex", "Raw",
|
"CFB", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -861,9 +940,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
|
16,
|
||||||
"OFB", "Hex", "Raw",
|
"OFB", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -878,9 +959,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
|
16,
|
||||||
"CTR", "Hex", "Raw",
|
"CTR", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -895,9 +978,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
|
16,
|
||||||
"ECB", "Hex", "Raw",
|
"ECB", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -912,9 +997,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Raw",
|
"GCM", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": "16a3e732a605cc9ca29108f742ca0743"},
|
{"option": "Hex", "string": "16a3e732a605cc9ca29108f742ca0743"},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -929,9 +1016,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
{"option": "Hex", "string": "00112233445566778899aabbccddeeff"},
|
||||||
{"option": "Hex", "string": "ffeeddccbbaa99887766554433221100"},
|
{"option": "Hex", "string": "ffeeddccbbaa99887766554433221100"},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Raw",
|
"GCM", "Hex", "Raw",
|
||||||
{"option": "Hex", "string": "3b5378917f67b0aade9891fc6c291646"},
|
{"option": "Hex", "string": "3b5378917f67b0aade9891fc6c291646"},
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -946,9 +1035,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CBC", "Hex", "Hex",
|
"CBC", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -963,9 +1054,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CFB", "Hex", "Hex",
|
"CFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -980,9 +1073,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"OFB", "Hex", "Hex",
|
"OFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -997,9 +1092,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CTR", "Hex", "Hex",
|
"CTR", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1014,9 +1111,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": "70fad2ca19412c20f40fd06918736e56"},
|
{"option": "Hex", "string": "70fad2ca19412c20f40fd06918736e56"},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1031,9 +1130,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": "61cc4b70809452b0b3e38f913fa0a109"},
|
{"option": "Hex", "string": "61cc4b70809452b0b3e38f913fa0a109"},
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1048,9 +1149,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
{"option": "Hex", "string": "51e201d463698ef5f717f71f5b4712af"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"ECB", "Hex", "Hex",
|
"ECB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1065,9 +1168,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CBC", "Hex", "Hex",
|
"CBC", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1082,9 +1187,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CFB", "Hex", "Hex",
|
"CFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1099,9 +1206,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"OFB", "Hex", "Hex",
|
"OFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1116,9 +1225,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CTR", "Hex", "Hex",
|
"CTR", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1133,9 +1244,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": "86db597d5302595223cadbd990f1309b"},
|
{"option": "Hex", "string": "86db597d5302595223cadbd990f1309b"},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1150,9 +1263,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": "aeedf3e6ca4201577c0cf3e9ce58159d"},
|
{"option": "Hex", "string": "aeedf3e6ca4201577c0cf3e9ce58159d"},
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1167,9 +1282,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
{"option": "Hex", "string": "6801ed503c9d96ee5f9d78b07ab1b295dba3c2adf81c7816"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"ECB", "Hex", "Hex",
|
"ECB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1184,9 +1301,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CBC", "Hex", "Hex",
|
"CBC", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1201,9 +1320,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CFB", "Hex", "Hex",
|
"CFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1218,9 +1339,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"OFB", "Hex", "Hex",
|
"OFB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1235,9 +1358,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"CTR", "Hex", "Hex",
|
"CTR", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1252,9 +1377,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": "821b1e5f32dad052e502775a523d957a"},
|
{"option": "Hex", "string": "821b1e5f32dad052e502775a523d957a"},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1269,9 +1396,11 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"GCM", "Hex", "Hex",
|
"GCM", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": "a8f04c4d93bbef82bef61a103371aef9"},
|
{"option": "Hex", "string": "a8f04c4d93bbef82bef61a103371aef9"},
|
||||||
{"option": "UTF8", "string": "additional data"}
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -1286,9 +1415,106 @@ The following algorithms will be used based on the size of the key:
|
|||||||
"args": [
|
"args": [
|
||||||
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
{"option": "Hex", "string": "1748e7179bd56570d51fa4ba287cc3e5"},
|
||||||
|
16,
|
||||||
"ECB", "Hex", "Hex",
|
"ECB", "Hex", "Hex",
|
||||||
{"option": "Hex", "string": ""},
|
{"option": "Hex", "string": ""},
|
||||||
{"option": "Hex", "string": ""}
|
{"option": "Hex", "string": ""},
|
||||||
|
"Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AES Decrypt: IV from input, with too short input",
|
||||||
|
input: "1748e7179bd56570d51fa4ba287cc3e5",
|
||||||
|
expectedOutput: "Input is too short to contain an IV of 16 bytes.",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Decrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
16,
|
||||||
|
"ECB", "Hex", "Hex",
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
"From start"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AES Decrypt: AES-256-ECB with IV from input start, Binary",
|
||||||
|
input: "1748e7179bd56570d51fa4ba287cc3e57e8521ba3f356ef692a51841807e141464aadc07bbc0ef2b628b8745bae356d245682a220688afca7be987b60cb120681ed42680ee93a67065619a3beaac11111a6cd88a6afa9e367722cb57df343f8548f2d691b295184da4ed5f3b763aaa8558502cb348ab58e81986337096e90caa",
|
||||||
|
expectedOutput: "7a0e643132750e96d805d11e9e48e281fa39a41039286423cc1c045e5442b40bf1c3f2822bded3f9c8ef11cb25da64dda9c7ab87c246bd305385150c98f31465c2a6180fe81d31ea289b916504d5a12e1de26cb10adba84a0cb0c86f94bc14bc554f3018",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Decrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
16,
|
||||||
|
"ECB", "Hex", "Hex",
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
"From start"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AES Decrypt: AES-256-ECB with IV from input end, Binary",
|
||||||
|
input: "7e8521ba3f356ef692a51841807e141464aadc07bbc0ef2b628b8745bae356d245682a220688afca7be987b60cb120681ed42680ee93a67065619a3beaac11111a6cd88a6afa9e367722cb57df343f8548f2d691b295184da4ed5f3b763aaa8558502cb348ab58e81986337096e90caa1748e7179bd56570d51fa4ba287cc3e5",
|
||||||
|
expectedOutput: "7a0e643132750e96d805d11e9e48e281fa39a41039286423cc1c045e5442b40bf1c3f2822bded3f9c8ef11cb25da64dda9c7ab87c246bd305385150c98f31465c2a6180fe81d31ea289b916504d5a12e1de26cb10adba84a0cb0c86f94bc14bc554f3018",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Decrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
16,
|
||||||
|
"ECB", "Hex", "Hex",
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
"From end"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AES Decrypt: AES-256-GCM with IV from input start, Binary, AAD",
|
||||||
|
input: "1748e7179bd56570d51fa4ba287cc3e51287f188ad4d7ab0d9ff69b3c29cb11f861389532d8cb9337181da2e8cfc74a84927e8c0dd7a28a32fd485afe694259a63c199b199b95edd87c7aa95329feac340f2b78b72956a85f367044d821766b1b7135815571df44900695f1518cf3ae38ecb650f",
|
||||||
|
expectedOutput: "7a0e643132750e96d805d11e9e48e281fa39a41039286423cc1c045e5442b40bf1c3f2822bded3f9c8ef11cb25da64dda9c7ab87c246bd305385150c98f31465c2a6180fe81d31ea289b916504d5a12e1de26cb10adba84a0cb0c86f94bc14bc554f3018",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Decrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
16,
|
||||||
|
"GCM", "Hex", "Hex",
|
||||||
|
{"option": "Hex", "string": "a8f04c4d93bbef82bef61a103371aef9"},
|
||||||
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"From start"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AES Decrypt: AES-256-GCM with 12-byte IV from input start, Binary, AAD",
|
||||||
|
input: "1748e7179bd56570d51fa4ba623c81f4605da9ac3df29c67c43abe4aad5230dca82a98ab31f042fe871b81a0a1e8b8af41044d46f627828e7d11eca2d04ac27f4e7c7c9a20da87854df9868a2ddbd67d85f7db92f9ff1272cfb7955a2d279dbe715965011fddf6e730e79e7b22f89817",
|
||||||
|
expectedOutput: "7a0e643132750e96d805d11e9e48e281fa39a41039286423cc1c045e5442b40bf1c3f2822bded3f9c8ef11cb25da64dda9c7ab87c246bd305385150c98f31465c2a6180fe81d31ea289b916504d5a12e1de26cb10adba84a0cb0c86f94bc14bc554f3018",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "AES Decrypt",
|
||||||
|
"args": [
|
||||||
|
{"option": "Hex", "string": "2d767f6e9333d1c77581946e160b2b7368c2cdd5e2b80f04ca09d64e02afbfe1"},
|
||||||
|
{"option": "Hex", "string": ""},
|
||||||
|
12,
|
||||||
|
"GCM", "Hex", "Hex",
|
||||||
|
{"option": "Hex", "string": "c311c9144f8ae145ec46e2c69179a4b7"},
|
||||||
|
{"option": "UTF8", "string": "additional data"},
|
||||||
|
"From start"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -10,138 +10,144 @@ import {ASCII_TEXT, UTF8_TEXT, ALL_BYTES} from "../../samples/Ciphers.mjs";
|
|||||||
|
|
||||||
// RSA-1024
|
// RSA-1024
|
||||||
const ALICE_PRIVATE = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
const ALICE_PRIVATE = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
Version: Keybase OpenPGP v2.0.77
|
Version: Keybase OpenPGP v2.1.17
|
||||||
Comment: https://keybase.io/crypto
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
xcEYBFsNaYsBBAC9rnmjTzLLBCey2gq9un+XXP089sP3AONhSivdJlJEEWjt999o
|
xcEYBGoXHs0BBADB6Loj+NX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b52
|
=HBWf
|
||||||
-----END PGP PRIVATE KEY BLOCK-----`;
|
-----END PGP PRIVATE KEY BLOCK-----`;
|
||||||
|
|
||||||
const ALICE_PUBLIC = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
const ALICE_PUBLIC = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
Version: Keybase OpenPGP v2.0.77
|
Version: Keybase OpenPGP v2.1.17
|
||||||
Comment: https://keybase.io/crypto
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
xo0EWw1piwEEAL2ueaNPMssEJ7LaCr26f5dc/Tz2w/cA42FKK90mUkQRaO3332iD
|
xo0EahcezQEEAMHouiP41c1AGBU0IO0VjE2+O9WKc8Cpbv+ymy+MI6EOsiSoZ/Z+
|
||||||
y8zXxNwSTWzHIi2n8YuUT9PvQ08UC91VcojQoNBn1+bvskMqK2XnzuelFqyk45cv
|
hjqyMumx1loeH4K0QClzcWfeAtKrXs8JjQonByKtuneRjITNnasCEmWmqZbea5qa
|
||||||
XJRUUZWvhgQ8MugBPg8mDAjdOwQF8sZ45moGp3+y3D8UqOs1kktFh+OdABEBAAHN
|
p9+s6A6m+VHUehrtIvipNaq/Bfrynk9RwRMoAoTYJBUyPWaSLzzaV0zNABEBAAHN
|
||||||
AMK0BBMBCgAeBQJbDWmLAhsvAwsJBwMVCggCHgECF4ADFgIBAhkBAAoJEIQkZUjf
|
AMK0BBMBCgAeBQJqFx7NAhsvAwsJBwMVCggCHgECF4ADFgIBAhkBAAoJEBt1IEsq
|
||||||
mOSF4+UD/AmZ7Nc5VpO0t+w4b8XtytxGFYHn3PhA1rI98b5aPkFCkDAJgDRTZ6mM
|
342M/VsEALQX4Lc7Udc9Obc5AnxABhzDZnCaFHYeZFJwyWtHpIN60gGFkz9vePji
|
||||||
7fvpr3FYbxs8p/sGtuOHyW98RmAIvhuGGuaVkG10swFYY7Xh8i3I0ulWf8ncQxgm
|
0DP1Kbeyo6awzUIzA8tuIGgZXQCJ04KPCP8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Xr9zoucjQwQWeRKwAQYoiovzxA4XV8gGyrdAsrIPUFL
|
SI4z/bbROkoNv73VCWM4o9r0DMASHK2Dyd71vOoOFjM/GtpGgQvjAKB82Db7+wsG
|
||||||
p7PmUBG4YJV/7sVozzRwVq+jS8Jo0xYbGJMv2DuAnXXrYCZWZRqRscr1Wlc+CUAC
|
T6V6bxpvY1sMOxCjphsLs2u2IvZLHqlc/v8CCXLHoiN3v6PVwkYG17UyZoDbCVt3
|
||||||
mxYZjC1DVVrAXr0jTqYTk+jjhemTTAtUelgMhcX82wP9EEU66hCYFUayjn4bBlR1
|
0SCZ5jJ7gCf+MpC9RseIteW5MtbFtKb6FwGgi9GNQQQAr4PFi8aXZ71lmB7/c/8f
|
||||||
yEvMpJd8JSTHR/dZH8t3Ri6R2AYRqBxro0JEXDhL9iDnuPQVxsbgq2YlhHrPJI8o
|
XAzsWRto9v64xtlZwpQ5GSOPvwzNjQfZf3Q4lKormkoqTxxC1tsxRxvbr51ZwfJU
|
||||||
pKuxV7wrXrupzwFfKixJMNwsAPk/nSc4qIZvXTi2fmyAZDJYUgsm6CwkxumaVvId
|
8LCfKZz9p+M1ncX6nyJBJupmesqfrjWizzuEYqo8D4q0jaoWq6lEsUWLSBcJXKaA
|
||||||
VNGRmxqGSRTuEIntW03Cwfs=
|
kHFtNAeebzImsGV9hhKv+f0=
|
||||||
=PuGL
|
=IODM
|
||||||
-----END PGP PUBLIC KEY BLOCK-----`;
|
-----END PGP PUBLIC KEY BLOCK-----`;
|
||||||
|
|
||||||
// ECC-384
|
// ECC-384
|
||||||
const BOB_PRIVATE = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
const BOB_PRIVATE = `-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
Version: Keybase OpenPGP v2.0.77
|
Version: Keybase OpenPGP v2.1.17
|
||||||
Comment: https://keybase.io/crypto
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
xcAABFsNafYBAYDHiv+tCi4267xI6iTmBr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42KMOcZHPIAwEKCQABAFwA
|
||||||
AlsNafYACgkQNBtaoVz6VrvTVAD+LD063VrU7vlJ7xQwtMun4G3FW+RKgb7Rsww8
|
UyvBBcchnSFCguG8EbEeA+DFKS62fvhqMHyMLGtfDUvChwQYEwoADwUCahclbQUJ
|
||||||
B1mt68F5dQGAm8ctxECzEMmyO8jSkjOLkG6u8zLQWFm9MBZqcdmt6EUDf1dA/3xu
|
A8JnAAIbDAAKCRBd32ij8+qSJ1+sAX4wkp3GZiRAtUZujC3bJ0ukYJjieNHFapA6
|
||||||
/y59qEGb0j4w
|
r+0ku3mR/9OFDbVaTPEcL7nhgGY94q8BfRvczdClIK0rdY/bopQDq4uERoiB/bsH
|
||||||
=I/Gz
|
1VFadIEvMZeIppWGb8d93IpZErGT9xQI8A==
|
||||||
|
=XC/n
|
||||||
-----END PGP PRIVATE KEY BLOCK-----`;
|
-----END PGP PRIVATE KEY BLOCK-----`;
|
||||||
|
|
||||||
const BOB_PUBLIC = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
const BOB_PUBLIC = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
Version: Keybase OpenPGP v2.0.77
|
Version: Keybase OpenPGP v2.1.17
|
||||||
Comment: https://keybase.io/crypto
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
xj0EWw1p9gEBgMeK/60KLjbrvEjqJOYGuE4p01sotYhgwbU6gTV/2qlP6cBUoVHN
|
xm8EahclbRMFK4EEACIDAwSvC1SlbUU7/QJFldLQGfAeyhu0mRvTIcxzANM9SdkI
|
||||||
QAVcqpCOowMRKQARAQABzQDCZAQTAQoAHgUCWw1p9gIbLwMLCQcDFQoIAh4BAheA
|
dS2ArnVOZCB7cnfj5AF1nAjphKCv+01LAkGpCF6dUrvDwDeicMaq+E1OPVc+G0bH
|
||||||
AxYCAQIZAQAKCRCEcIHWt/IPg+sqAYC6goCyOCYD/DytOW3I2cb12iDyFOSDsOx6
|
O4qQwJgyRLV/GNUZ0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MMPAdZrevBeXUBgJvHLcRAsxDJsjvI0pIzi5Bu
|
Dm9LNugBf27462A7iEkTab0nOQXtd6+L3PeHRUPUT1CFq+74M5GABr0wobJ5CCaQ
|
||||||
rvMy0FhZvTAWanHZrehFA39XQP98bv8ufahBm9I+MA==
|
NxQH++IKvwF+MSD0JajEVgi99qzSQOTZe8UGArddSCIJuUxNwEzaxvT6DombpLJ2
|
||||||
=K9ht
|
O4yYklR/xwoJzlYEahclbRIIKoZIzj0DAQcCAwRjn9T4UunA8a8ZuWP31AJheebC
|
||||||
|
AcPFWBGxdkxFeX65heVpMipOZ97EczRkitfAmiwt7cREq6yhvZ42KMOcZHPIAwEK
|
||||||
|
CcKHBBgTCgAPBQJqFyVtBQkDwmcAAhsMAAoJEF3faKPz6pInX6wBfjCSncZmJEC1
|
||||||
|
Rm6MLdsnS6RgmOJ40cVqkDqv7SS7eZH/04UNtVpM8RwvueGAZj3irwF9G9zN0KUg
|
||||||
|
rSt1j9uilAOri4RGiIH9uwfVUVp0gS8xl4imlYZvx33cilkSsZP3FAjw
|
||||||
|
=BHOx
|
||||||
-----END PGP PUBLIC KEY BLOCK-----`;
|
-----END PGP PUBLIC KEY BLOCK-----`;
|
||||||
|
|
||||||
TestRegister.addTests([
|
TestRegister.addTests([
|
||||||
@ -205,29 +211,46 @@ TestRegister.addTests([
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "PGP Sign/Verify: RSA, All bytes",
|
||||||
|
input: ALL_BYTES,
|
||||||
|
expectedMatch: /Signed by PGP key ID: 2ADF8D8C\nPGP fingerprint: 7afe93ff7614167c3fe831fe1b75204b2adf8d8c\nSigned on .*\n----------------------------------\n/,
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "PGP Sign",
|
||||||
|
"args": [ALICE_PRIVATE, ""]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "PGP Verify",
|
||||||
|
"args": [ALICE_PUBLIC]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "PGP Decrypt and Verify: UTF8, Alice -> Bob",
|
name: "PGP Decrypt and Verify: UTF8, Alice -> Bob",
|
||||||
input: `-----BEGIN PGP MESSAGE-----
|
input: `-----BEGIN PGP MESSAGE-----
|
||||||
Version: Keybase OpenPGP v2.0.77
|
Version: Keybase OpenPGP v2.1.17
|
||||||
Comment: https://keybase.io/crypto
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
wTwDhHCB1rfyD4MBAX9ld8xGcf2v+X+pwINN0R0TvkWxNesKOQIKPV01AH8JG0J+
|
wX4DEY2FMRPYAl0SAgMEKY2yuB8s16oRWWhJ1RsxNhR8byKFUyFZvi0ETIORMYu+
|
||||||
+yFqLXqDHgYSLANNamfSwQoBOTWuh/5V6gpiXVm2oLHPv997AtoD/kVQrqylF5Xo
|
kkLWgFlVjqPV9q2eVtuVK9f+S/OIm0pztImhq5ZNMDB8r7s0wX4YskSrWRpMKwRr
|
||||||
HUsqPGtSgBA5WPX8tMoHKuqWxEy9FviLnIv73OZN0Ph70uo2E+QIv0Qx27znK0Jy
|
CtoNlPS3//fT3Ll4a2tn8guxyC7lAtmJ6nxZj+qpSZLSwQwBhFlgARdqlp4eTAhF
|
||||||
KDSERvcldgShmVbDP3Pxtxkfr9xa2gar5f0OPovOmKGsTGciQJqPkclRwzIXg12L
|
PRcqHVCqZYSTdjAyerLtfZDaswEwLgGxsshRSJ7BDHxg7NqRcdFkChrWT0s4JpnV
|
||||||
hyd2ElYOMf6vg/yOc06sX4Ih1Tn6JkYqMVJydykMv3g4Z8OXTfwrMLxwO1n3ZB/T
|
/Woq0xcApim1bpyHXG/tT4oM3hbjfpulb92gq2TUNdzb9lJGaKbLHl/0zkoBvHDE
|
||||||
OLdhBdsnREnyCqntBVjMKoRTQhfwq48n7b6caZ+aCPISdDIyDKBpxEzXaNBeEY2V
|
pxtr021JXERB8MNDIIpDESpjCrZ20YCHNr/sBqVm0yM7YGrDLlV+n7oUgL4HK2FU
|
||||||
GCqORM9WhsQ4A6pAx2SP694qH5vgOwrYrgeOU17oK++mzd1GyU2CXoFi73/PANJD
|
tehxUEt4rca81UesYu/Wul6mHh/7Ft4jJuZuf/w9fCWQ6z+9MAEOBXdzWUp5BCyF
|
||||||
TdC3hGr+S4XeuqZ368QG1cBWhNybsOu5sM2YbArb71ZMYuLDp+VolJbEkVf4c/dD
|
ce1STpICAdtRHInJ9zR08qn0ahrwHsvHPFPVIQJDargD5MSqav/3LS2TYqKYYKHy
|
||||||
pVEOaX39NVKe6HcpOiw+CFO6GEkQqCXNprWK6ivBHzkAlF2pjjqlS6qhWxFPicSD
|
TUCxIWqA77Qk3rEaFX+eHxTW4BTlMPArA7ffywkgJAPzrLL+gEgtOLCv2RhNZevR
|
||||||
+1ZKM1fmZu99bhTmdqE3MJx//QMu7mvlHaM85OQkWhWPBxGw/60GVBX9YtvUtfMS
|
weglQRtcuh5N/F9fsmPfsi80R0//LpEeyFX6GueXDw81+AKG9pOTI71Ny8H4W0eA
|
||||||
IOE1W/Zqmqzq+4frwnzWwYv9/U1RwIs/qlFVnzliREOzW+om8EncSSd7fQ==
|
B5dCiOFNHZKCZUlA6GFa04X/XgmfPzTPMtgizbT72/2kfwxJGZY4ngdMVLqfhnVA
|
||||||
=fEAT
|
nfyQLFrOF9giJqDEsjtPXJ0h20stMLMykPUIK0UUf9vPthE86ugCY1XcGQWsuB4U
|
||||||
|
jmdH1dqEUk29TaUz/97s
|
||||||
|
=Ah/0
|
||||||
-----END PGP MESSAGE-----
|
-----END PGP MESSAGE-----
|
||||||
`,
|
`,
|
||||||
expectedOutput: `Signed by PGP key ID: DF98E485
|
expectedOutput: `Signed by PGP key ID: 2ADF8D8C
|
||||||
PGP fingerprint: e94e06dd0b3744a0e970de9d84246548df98e485
|
PGP fingerprint: 7afe93ff7614167c3fe831fe1b75204b2adf8d8c
|
||||||
Signed on Tue, 29 May 2018 15:44:52 GMT
|
Signed on Wed, 27 May 2026 17:18:20 GMT
|
||||||
----------------------------------
|
----------------------------------
|
||||||
${UTF8_TEXT}`,
|
${UTF8_TEXT}`,
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
@ -238,19 +261,19 @@ ${UTF8_TEXT}`,
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "PGP Decrypt: ASCII, Alice -> Bob",
|
name: "PGP Decrypt: ASCII, Alice",
|
||||||
input: `-----BEGIN PGP MESSAGE-----
|
input: `-----BEGIN PGP MESSAGE-----
|
||||||
Version: Keybase OpenPGP v2.0.77
|
Version: Keybase OpenPGP v2.1.17
|
||||||
Comment: https://keybase.io/crypto
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
wYwDPtlTQFIjCzoBBACSlbN7tmQVxR5ZD0rvCwXUkxO3RU8WgBkkmrTCUs9a+xrS
|
wYwDOfwkCKoimvoBA/98ONH8b+HoaDOVLhtF+9Pz5Sk/NZ43htOpm/3+b2B81GKZ
|
||||||
F9HuKcpX/N6XrwTXyuX3BN2tGys4zd6nHV8jYqBoIyWJsWe3viTa1dh/x4183+GP
|
fcUfJYzItyt4X5Ps1ksfrArokG6blkIHPwZdcF7TJ9rWy/cC9S3zP/LF893xT9Z7
|
||||||
fP61gizi3pj0gi2vfGnMhnThbdiO32PVKAeHLHBK+r3XlXZ0kzZCQKRgd55yr9Kk
|
buWj1BjqfNy15WtGJnnQeCJVI4ya0cb3G/I/zAF/mT6R/JcldbJ1OTz9Zy5pZtKi
|
||||||
Aa4SR+qpvtdobkDzbnbhcPLR6CQ8TMjTiNXEpgTc1i0JcP8jaMVFzBt8qgmDMdqU
|
AQL7B8IscCxsx9jxc1ZR3swn+fr603BVP6/mXRRtKIa5DXZR5uMU9ChZ5AYQeHXe
|
||||||
H2qMY1O7hezH3fp+EZzCAccJMtK7VPk13WAgMRH22HirG4aK1i75IVOtjBgObzDh
|
ZzstlcSJWJvuF+uJy3Yc07ttzqQtOQGLh0iBeALK7BWqLsUBqKabZSHTZ4uFdkv9
|
||||||
8zKua7QLi6wJD/AtQ+D3/NgVpzoXwdoLvTjEcAyy+YWNWkJF/jvx3XV1Q/Fz7sHJ
|
86ZebPsfjVlhz4oFYenBUq1C15Zpvut28pHpgh2TLuXPHKkmTwI2Zz9LvVRjBW7A
|
||||||
/bspORYvbi591S4U0m4pikwiOZk=
|
rmDPrpTfy9MOrkjkY7zQSevi
|
||||||
=AVb/
|
=/Zwh
|
||||||
-----END PGP MESSAGE-----`,
|
-----END PGP MESSAGE-----`,
|
||||||
expectedOutput: ASCII_TEXT,
|
expectedOutput: ASCII_TEXT,
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
@ -262,21 +285,22 @@ H2qMY1O7hezH3fp+EZzCAccJMtK7VPk13WAgMRH22HirG4aK1i75IVOtjBgObzDh
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "PGP Verify: ASCII, Alice",
|
name: "PGP Verify: ASCII, Alice",
|
||||||
input: `-----BEGIN PGP SIGNED MESSAGE-----
|
input: `-----BEGIN PGP MESSAGE-----
|
||||||
Hash: SHA256
|
Version: Keybase OpenPGP v2.1.17
|
||||||
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
|
yMB1AnicO8LLzMDFaPlHhWOV0qxfjKcnljJkiTsIOiok5+fm5ucp5GYWlyRmpyqU
|
||||||
-----BEGIN PGP SIGNATURE-----
|
ZCSWKBSk5hfkpCrkggTKM1LzFEqKKjPz0hVK8hVSUosz0/MUivNzU0syQGJA/UC1
|
||||||
|
Jak5lQpp+fk5BUX5+WkKmcUgtaV5KalFqcUlmbmJJSCTUxWAGlLzSjNLKhWAimA6
|
||||||
iLMEAQEIAB0WIQRLbJy6MLpYOr9qojE+2VNAUiMLOgUCXRTsvwAKCRA+2VNAUiML
|
wfqK9Q7NYWFg5GJgY2UCOYyBi1MA5tqzj1kYZqaFSuxmUvBnvvAzZOOuyT9vnT75
|
||||||
OuaHBADMMNtsuN92Fb+UrDimsv6TDQpbJhDkwp9kZdKYP5HAmSYAhXBG7N+YCMw+
|
5GVzY2WfOB8H08l5vCZNbBUegsqPPh2aXPQgo8GglTPO2e7qY75g49mzDm+8POfH
|
||||||
v2FSpUu9jJiPBm1K1SEwLufQVexoRv6RsBNolRFB07sArau0s0DnIXUchCZWvyTP
|
nstrb2/93JHrXD5fbcbuVrsFJ01XWE2Xy7HtTgrasGG7ySLZqLStBj2r0n4dTX7g
|
||||||
1KsjBnDr84U2b11H58g4DlTT4gQrz30rFuHz9AGmPAtDHbSXIA==
|
MV1ETCdx6nqHA+4as4Oy9040BACRHYIP
|
||||||
=vnk/
|
=rkte
|
||||||
-----END PGP SIGNATURE-----`,
|
-----END PGP MESSAGE-----`,
|
||||||
expectedOutput: `Signed by PGP key ID: DF98E485
|
expectedOutput: `Signed by PGP key ID: 2ADF8D8C
|
||||||
PGP fingerprint: e94e06dd0b3744a0e970de9d84246548df98e485
|
PGP fingerprint: 7afe93ff7614167c3fe831fe1b75204b2adf8d8c
|
||||||
Signed on Thu, 27 Jun 2019 16:20:15 GMT
|
Signed on Wed, 27 May 2026 19:03:45 GMT
|
||||||
----------------------------------
|
----------------------------------
|
||||||
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.`,
|
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.`,
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
|
|||||||
@ -41,5 +41,16 @@ TestRegister.addTests([
|
|||||||
"args": ["Hex", "Text output"]
|
"args": ["Hex", "Text output"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Parse Ethernet frame escapes packet data HTML",
|
||||||
|
input: "000000000000ffffffffffff08003c696d67207372633d78206f6e6572726f723d616c6572742831293e3c7363726970743e616c6572742832293c2f7363726970743e",
|
||||||
|
expectedOutput: "<img src=x onerror=alert(1)><script>alert(2)</script>",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Parse Ethernet frame",
|
||||||
|
"args": ["Hex", "Packet data"]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
23
tests/operations/tests/ParseIPv4Header.mjs
Normal file
23
tests/operations/tests/ParseIPv4Header.mjs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Parse IPv4 header tests.
|
||||||
|
*
|
||||||
|
* @author C85297 [95289555+C85297@users.noreply.github.com]
|
||||||
|
* @copyright Crown Copyright 2026
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
|
|
||||||
|
TestRegister.addTests([
|
||||||
|
{
|
||||||
|
name: "Parse IPv4 header: Correctly formatted HTML output",
|
||||||
|
input: "45 00 00 3c 1c 46 40 00 40 06 b1 e6 c0 a8 00 01 c0 a8 00 02 3c 73 63 72 69 70 74 3e 61 6c 65 72 74 28 31 33 33 37 29 3c 2f 73 63 72 69 70 74 3e",
|
||||||
|
expectedOutput: "<script>alert(1337)</script>",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
op: "Parse IPv4 header",
|
||||||
|
args: ["Hex", "Data (raw)"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]);
|
||||||
@ -59,6 +59,7 @@ TestRegister.addTests([
|
|||||||
"option": "Hex",
|
"option": "Hex",
|
||||||
"string": "$R0"
|
"string": "$R0"
|
||||||
},
|
},
|
||||||
|
16,
|
||||||
"CTR", "Hex", "Raw",
|
"CTR", "Hex", "Raw",
|
||||||
{
|
{
|
||||||
"option": "Hex",
|
"option": "Hex",
|
||||||
@ -67,7 +68,8 @@ TestRegister.addTests([
|
|||||||
{
|
{
|
||||||
"option": "Hex",
|
"option": "Hex",
|
||||||
"string": ""
|
"string": ""
|
||||||
}
|
},
|
||||||
|
"Off"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
62
tests/operations/tests/RemoveANSIEscapeCodes.mjs
Normal file
62
tests/operations/tests/RemoveANSIEscapeCodes.mjs
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/**
|
||||||
|
* @author Louis-Ladd [lewisharshman1@gmail.com]
|
||||||
|
* @copyright Crown Copyright 2025
|
||||||
|
* @license Apache-2.0
|
||||||
|
*/
|
||||||
|
import TestRegister from "../../lib/TestRegister.mjs";
|
||||||
|
|
||||||
|
TestRegister.addTests([
|
||||||
|
{
|
||||||
|
"name": "Remove ANSI Escape Codes: text using x1b escape code",
|
||||||
|
"input": "\x1b[31mHello, \x1b[31mWorld!",
|
||||||
|
"expectedOutput": "Hello, World!",
|
||||||
|
"recipeConfig": [
|
||||||
|
{
|
||||||
|
"op": "Remove ANSI Escape Codes",
|
||||||
|
"args": [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Remove ANSI Escape Codes: text with incomplete codes",
|
||||||
|
"input": "\x1b[31 Hello, World!",
|
||||||
|
"expectedOutput": "ello, World!",
|
||||||
|
"recipeConfig": [
|
||||||
|
{
|
||||||
|
"op": "Remove ANSI Escape Codes",
|
||||||
|
"args": [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Remove ANSI Escape Codes: cursor commands and clear screen",
|
||||||
|
"input": "\x1b[2J\x1b[H\x1b[3BHello, World!",
|
||||||
|
"expectedOutput": "Hello, World!",
|
||||||
|
"recipeConfig": [
|
||||||
|
{
|
||||||
|
"op": "Remove ANSI Escape Codes",
|
||||||
|
"args": [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Remove ANSI Escape Codes: text containing javascript escape representation of ansi escape codes",
|
||||||
|
// input/output expressed in hex to avoid accidental interpretation of Javascript escapes and to make the test case explicit
|
||||||
|
"input": "5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 48 65 6c 6c 6f 2c 20 5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 57 6f 72 6c 64 21",
|
||||||
|
"expectedOutput": "5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 48 65 6c 6c 6f 2c 20 5c 30 33 33 5b 33 32 3b 31 3b 33 3b 34 3b 39 6d 57 6f 72 6c 64 21",
|
||||||
|
"recipeConfig": [
|
||||||
|
{
|
||||||
|
"op": "From Hex",
|
||||||
|
"args": ["Auto"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "Remove ANSI Escape Codes",
|
||||||
|
"args": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"op": "To Hex",
|
||||||
|
"args": ["Space", 0]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
]);
|
||||||
Loading…
x
Reference in New Issue
Block a user