Skip to content

Commit

Permalink
Revert "replace md with sha256 (#23)"
Browse files Browse the repository at this point in the history
This reverts commit f65504c.
  • Loading branch information
Github Actions committed Feb 22, 2024
1 parent f65504c commit b0919a0
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 { sha256 } from "node-forge";
import { md } 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 sha = sha256.create();
const md5 = md.md5.create();

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

return key;
Expand Down

0 comments on commit b0919a0

Please sign in to comment.