mirror of
https://github.com/gchq/CyberChef.git
synced 2025-06-17 19:55:18 -04:00
Merge 9a193affbf
into c57556f49f
This commit is contained in:
commit
50db810c6c
4 changed files with 45 additions and 7 deletions
|
@ -989,6 +989,27 @@ smothering ampersand abreast`;
|
|||
"QV\u0010\u0004UDWQ");
|
||||
}),
|
||||
|
||||
it("XOR: should throw 'Invalid Characters in key' error when key contains invalid characters", () => {
|
||||
const invalidKeys = [
|
||||
{ string: "zz 00 11", option: "Hex" },
|
||||
|
||||
{ string: "4~ 00 11", option: "Hex" }
|
||||
];
|
||||
invalidKeys.forEach(invalidKey => {
|
||||
assert.throws(() => {
|
||||
chef.XOR("fe023da5", { key: invalidKey, filterKey: false });
|
||||
}, /Invalid Characters in key/);
|
||||
});
|
||||
}),
|
||||
|
||||
it("XOR: should not throw 'Invalid Characters in key' error when key contains only valid characters", () => {
|
||||
assert.strictEqual(chef.XOR("fe023da5", {
|
||||
key: "736f6d65",
|
||||
filterKey: false
|
||||
}).toString(),
|
||||
"\u0015\n]W@\u000b\fP");
|
||||
}),
|
||||
|
||||
it("XPath expression", () => {
|
||||
assert.strictEqual(
|
||||
chef.XPathExpression("<contact-info><company>abc</company></contact-info>", {xPath: "contact-info/company"}).toString(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue