enable/disable e2e encryption

This commit is contained in:
2023-05-28 21:45:47 +02:00
parent 37e677ec6a
commit 13d6364ffe
9 changed files with 372 additions and 59 deletions

View File

@@ -17,3 +17,7 @@ export const decrypt = (encryptedMessage: string, key: string): string => {
export const encrypt = (unencryptedMessage: string, key: string): string => {
return CryptoJS.AES.encrypt(encryptionPrefix + unencryptedMessage, key).toString()
}
export const generateEncryptionKey = () => {
return CryptoJS.lib.WordArray.random(16).toString(CryptoJS.enc.Hex)
}