diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json
index 77e3d319..d8373c2f 100755
--- a/src/core/config/Categories.json
+++ b/src/core/config/Categories.json
@@ -313,6 +313,7 @@
"SHA1",
"SHA2",
"SHA3",
+ "SM3",
"Keccak",
"Shake",
"RIPEMD",
diff --git a/src/core/operations/HAS160.mjs b/src/core/operations/HAS160.mjs
index aa1439ae..0ca62019 100644
--- a/src/core/operations/HAS160.mjs
+++ b/src/core/operations/HAS160.mjs
@@ -20,11 +20,17 @@ class HAS160 extends Operation {
this.name = "HAS-160";
this.module = "Crypto";
- this.description = "HAS-160 is a cryptographic hash function designed for use with the Korean KCDSA digital signature algorithm. It is derived from SHA-1, with assorted changes intended to increase its security. It produces a 160-bit output.
HAS-160 is used in the same way as SHA-1. First it divides input in blocks of 512 bits each and pads the final block. A digest function updates the intermediate hash value by processing the input blocks in turn.
The message digest algorithm consists of 80 rounds.";
+ this.description = "HAS-160 is a cryptographic hash function designed for use with the Korean KCDSA digital signature algorithm. It is derived from SHA-1, with assorted changes intended to increase its security. It produces a 160-bit output.
HAS-160 is used in the same way as SHA-1. First it divides input in blocks of 512 bits each and pads the final block. A digest function updates the intermediate hash value by processing the input blocks in turn.
The message digest algorithm consists, by default, of 80 rounds.";
this.infoURL = "https://wikipedia.org/wiki/HAS-160";
this.inputType = "ArrayBuffer";
this.outputType = "string";
- this.args = [];
+ this.args = [
+ {
+ name: "Rounds",
+ type: "number",
+ value: 80
+ }
+ ];
}
/**
@@ -33,7 +39,7 @@ class HAS160 extends Operation {
* @returns {string}
*/
run(input, args) {
- return runHash("has160", input);
+ return runHash("has160", input, {rounds: args[0]});
}
}
diff --git a/src/core/operations/MD2.mjs b/src/core/operations/MD2.mjs
index ecfa699c..9fca4939 100644
--- a/src/core/operations/MD2.mjs
+++ b/src/core/operations/MD2.mjs
@@ -20,11 +20,17 @@ class MD2 extends Operation {
this.name = "MD2";
this.module = "Crypto";
- this.description = "The MD2 (Message-Digest 2) algorithm is a cryptographic hash function developed by Ronald Rivest in 1989. The algorithm is optimized for 8-bit computers.
Although MD2 is no longer considered secure, even as of 2014, it remains in use in public key infrastructures as part of certificates generated with MD2 and RSA.";
+ this.description = "The MD2 (Message-Digest 2) algorithm is a cryptographic hash function developed by Ronald Rivest in 1989. The algorithm is optimized for 8-bit computers.
Although MD2 is no longer considered secure, even as of 2014, it remains in use in public key infrastructures as part of certificates generated with MD2 and RSA. The message digest algorithm consists, by default, of 18 rounds.";
this.infoURL = "https://wikipedia.org/wiki/MD2_(cryptography)";
this.inputType = "ArrayBuffer";
this.outputType = "string";
- this.args = [];
+ this.args = [
+ {
+ name: "Rounds",
+ type: "number",
+ value: 18
+ }
+ ];
}
/**
@@ -33,7 +39,7 @@ class MD2 extends Operation {
* @returns {string}
*/
run(input, args) {
- return runHash("md2", input);
+ return runHash("md2", input, {rounds: args[0]});
}
}
diff --git a/src/core/operations/SHA0.mjs b/src/core/operations/SHA0.mjs
index 93345eb2..34c4d1df 100644
--- a/src/core/operations/SHA0.mjs
+++ b/src/core/operations/SHA0.mjs
@@ -20,11 +20,17 @@ class SHA0 extends Operation {
this.name = "SHA0";
this.module = "Crypto";
- this.description = "SHA-0 is a retronym applied to the original version of the 160-bit hash function published in 1993 under the name 'SHA'. It was withdrawn shortly after publication due to an undisclosed 'significant flaw' and replaced by the slightly revised version SHA-1.";
+ this.description = "SHA-0 is a retronym applied to the original version of the 160-bit hash function published in 1993 under the name 'SHA'. It was withdrawn shortly after publication due to an undisclosed 'significant flaw' and replaced by the slightly revised version SHA-1. The message digest algorithm consists, by default, of 80 rounds.";
this.infoURL = "https://wikipedia.org/wiki/SHA-1#SHA-0";
this.inputType = "ArrayBuffer";
this.outputType = "string";
- this.args = [];
+ this.args = [
+ {
+ name: "Rounds",
+ type: "number",
+ value: 80
+ }
+ ];
}
/**
@@ -33,7 +39,7 @@ class SHA0 extends Operation {
* @returns {string}
*/
run(input, args) {
- return runHash("sha0", input);
+ return runHash("sha0", input, {rounds: args[0]});
}
}
diff --git a/src/core/operations/SHA1.mjs b/src/core/operations/SHA1.mjs
index 41a0105a..ee744d56 100644
--- a/src/core/operations/SHA1.mjs
+++ b/src/core/operations/SHA1.mjs
@@ -20,11 +20,17 @@ class SHA1 extends Operation {
this.name = "SHA1";
this.module = "Crypto";
- this.description = "The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.
However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.";
+ this.description = "The SHA (Secure Hash Algorithm) hash functions were designed by the NSA. SHA-1 is the most established of the existing SHA hash functions and it is used in a variety of security applications and protocols.
However, SHA-1's collision resistance has been weakening as new attacks are discovered or improved. The message digest algorithm consists, by default, of 80 rounds.";
this.infoURL = "https://wikipedia.org/wiki/SHA-1";
this.inputType = "ArrayBuffer";
this.outputType = "string";
- this.args = [];
+ this.args = [
+ {
+ name: "Rounds",
+ type: "number",
+ value: 80
+ }
+ ];
}
/**
@@ -33,7 +39,7 @@ class SHA1 extends Operation {
* @returns {string}
*/
run(input, args) {
- return runHash("sha1", input);
+ return runHash("sha1", input, {rounds: args[0]});
}
}
diff --git a/src/core/operations/SHA2.mjs b/src/core/operations/SHA2.mjs
index c9599d24..3d015d26 100644
--- a/src/core/operations/SHA2.mjs
+++ b/src/core/operations/SHA2.mjs
@@ -20,7 +20,7 @@ class SHA2 extends Operation {
this.name = "SHA2";
this.module = "Crypto";
- this.description = "The SHA-2 (Secure Hash Algorithm 2) hash functions were designed by the NSA. SHA-2 includes significant changes from its predecessor, SHA-1. The SHA-2 family consists of hash functions with digests (hash values) that are 224, 256, 384 or 512 bits: SHA224, SHA256, SHA384, SHA512.