mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Added a range of GOST operations
This commit is contained in:
parent
1bc88728f0
commit
fa228b2571
16 changed files with 1047 additions and 36 deletions
|
@ -28,7 +28,7 @@ class Streebog extends Operation {
|
|||
this.outputType = "string";
|
||||
this.args = [
|
||||
{
|
||||
"name": "Size",
|
||||
"name": "Digest length",
|
||||
"type": "option",
|
||||
"value": ["256", "512"]
|
||||
}
|
||||
|
@ -41,13 +41,16 @@ class Streebog extends Operation {
|
|||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
const [length] = args;
|
||||
|
||||
const algorithm = {
|
||||
version: 2012,
|
||||
mode: "HASH",
|
||||
length: parseInt(length, 10)
|
||||
};
|
||||
|
||||
try {
|
||||
const length = parseInt(args[0], 10);
|
||||
const gostDigest = new GostDigest({
|
||||
name: "GOST R 34.11",
|
||||
version: 2012,
|
||||
length: length
|
||||
});
|
||||
const gostDigest = new GostDigest(algorithm);
|
||||
|
||||
return toHexFast(gostDigest.digest(input));
|
||||
} catch (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue