mirror of
https://github.com/status-im/dappconnect-sdks.git
synced 2025-02-10 15:46:24 +00:00
16 lines
275 B
TypeScript
16 lines
275 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'
|
|
)
|
|
}
|