diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 09ee8d15..8da20880 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -344,6 +344,7 @@ "CTPH", "Compare SSDEEP hashes", "Compare CTPH hashes", + "Dahua", "HMAC", "Bcrypt", "Bcrypt compare", diff --git a/src/core/operations/Dahua.mjs b/src/core/operations/Dahua.mjs new file mode 100644 index 00000000..05c120ae --- /dev/null +++ b/src/core/operations/Dahua.mjs @@ -0,0 +1,78 @@ +/** + * @author Oscar Molnar [tymscar@gmail.com] + * @copyright Crown Copyright 2016 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import crypto from 'crypto'; + +/** + * Dahua operation + */ +class Dahua extends Operation { + + /** + * Dahua constructor + */ + constructor() { + super(); + + this.name = "Dahua"; + this.module = "Crypto"; + this.description = "Dahua is a hashing standard used on many DVRs and network cameras."; + this.inputType = "string"; + this.outputType = "string"; + this.args = []; + } + + /** + * Compresses the input into the final ascii array + * + * @param {Number[]} input + * @returns {String[]} + */ + compressor(input) { + let j=0, i =0 + let output = Array(8).fill('') + while (iString.fromCharCode(character)) + return answer.join('') + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + return this.dhash(input); + } + +} + +export default Dahua;