diff --git a/scripts/encrypt-data.js b/scripts/encrypt-data.js index 54aaf5d..ab41bc3 100644 --- a/scripts/encrypt-data.js +++ b/scripts/encrypt-data.js @@ -92,7 +92,7 @@ class Encrypter { return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8'); } static hash(clearText) { - return crypto.createHash('sha256', this.key).update(clearText).digest('base64'); + return crypto.createHmac('sha256', this.key).update(clearText).digest('base64'); } } Encrypter.algorithm = 'aes-256-cbc'; diff --git a/src/shared/Encrypter.ts b/src/shared/Encrypter.ts index 48c8c25..8916776 100644 --- a/src/shared/Encrypter.ts +++ b/src/shared/Encrypter.ts @@ -38,6 +38,6 @@ export class Encrypter { } static hash(clearText: string): string { - return crypto.createHash('sha256', this.key).update(clearText).digest('base64'); + return crypto.createHmac('sha256', this.key).update(clearText).digest('base64'); } } \ No newline at end of file