mirror of
https://github.com/status-im/status-web.git
synced 2025-03-03 13:40:57 +00:00
16 lines
278 B
TypeScript
16 lines
278 B
TypeScript
import pbkdf2 from "pbkdf2";
|
|
|
|
const AESKeyLength = 32; // bytes
|
|
|
|
export async function createSymKeyFromPassword(
|
|
password: string
|
|
): Promise<Uint8Array> {
|
|
return pbkdf2.pbkdf2Sync(
|
|
Buffer.from(password, "utf-8"),
|
|
"",
|
|
65356,
|
|
AESKeyLength,
|
|
"sha256"
|
|
);
|
|
}
|