enable/disable e2e encryption
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user