diff --git a/src/core/operations/Bcrypt.mjs b/src/core/operations/Bcrypt.mjs deleted file mode 100644 index 53b8a92e..00000000 --- a/src/core/operations/Bcrypt.mjs +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @author n1474335 [n1474335@gmail.com] - * @copyright Crown Copyright 2016 - * @license Apache-2.0 - */ - -import Operation from "../Operation.mjs"; -import bcrypt from "bcryptjs"; -import { isWorkerEnvironment } from "../Utils.mjs"; - -/** - * Bcrypt operation - */ -class Bcrypt extends Operation { - - /** - * Bcrypt constructor - */ - constructor() { - super(); - - this.name = "Bcrypt"; - this.module = "Crypto"; - this.description = "bcrypt is a password hashing function designed by Niels Provos and David Mazi\xe8res, based on the Blowfish cipher, and presented at USENIX in 1999. Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the iteration count (rounds) can be increased to make it slower, so it remains resistant to brute-force search attacks even with increasing computation power.

Enter the password in the input to generate its hash."; - this.infoURL = "https://wikipedia.org/wiki/Bcrypt"; - this.inputType = "string"; - this.outputType = "string"; - this.args = [ - { - "name": "Rounds", - "type": "number", - "value": 10 - } - ]; - } - - /** - * @param {string} input - * @param {Object[]} args - * @returns {string} - */ - async run(input, args) { - const rounds = args[0]; - const salt = await bcrypt.genSalt(rounds); - - return await bcrypt.hash(input, salt, null, p => { - // Progress callback - if (isWorkerEnvironment()) - self.sendStatusMessage(`Progress: ${(p * 100).toFixed(0)}%`); - }); - - } - -} - -export default Bcrypt;