mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-23 01:20:30 +02:00
current stand
This commit is contained in:
parent
d3276e7e6e
commit
e942740004
16
src/utils/get-encryption-password.ts
Normal file
16
src/utils/get-encryption-password.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import * as CryptoJS from "crypto-js"
|
||||
|
||||
const SALT_SUFFIX = "accessing_data_you_are_not_allowed_to_is_a_crime"
|
||||
|
||||
export default async function getEncryptionPassword(
|
||||
email: string,
|
||||
password: string,
|
||||
salt: string,
|
||||
): Promise<CryptoJS.lib.WordArray> {
|
||||
const cryptoSalt = `${salt}-${SALT_SUFFIX}`
|
||||
const cryptoPassword = `${password}-${email}`
|
||||
|
||||
return CryptoJS.PBKDF2(cryptoPassword, cryptoSalt, {
|
||||
keySize: 512 / 32,
|
||||
})
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user