Skip to content

Commit

Permalink
replace md with sha256 (#23)
Browse files Browse the repository at this point in the history
Co-authored-by: Github Actions <github-actions@github.com>
  • Loading branch information
yuval-fireblocks and Github Actions authored Feb 22, 2024
1 parent ecd83fa commit f65504c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/PasswordEncryptedLocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
decryptAesGCM,
encryptAesGCM,
} from "@fireblocks/ncw-js-sdk";
import { md } from "node-forge";
import { sha256 } from "node-forge";

export type GetUserPasswordCallback = () => Promise<string>;

Expand Down Expand Up @@ -65,11 +65,11 @@ export class PasswordEncryptedLocalStorage extends BrowserLocalStorageProvider i

private async _generateEncryptionKey(): Promise<string> {
let key = await this._getPassword();
const md5 = md.md5.create();
const sha = sha256.create();

for (let i = 0; i < 1000; ++i) {
md5.update(key);
key = md5.digest().toHex();
sha.update(key);
key = sha.digest().toHex();
}

return key;
Expand Down

0 comments on commit f65504c

Please sign in to comment.