fix(core): Upgrade crypto-js to address CVE-2023-46233 (#7519)
[GH Advisory](https://github.com/advisories/GHSA-xwcq-pm8m-c4vf)
This commit is contained in:
committed by
GitHub
parent
df89685e15
commit
65e5593233
@@ -7,13 +7,15 @@ export class Cipher {
|
||||
constructor(private readonly instanceSettings: InstanceSettings) {}
|
||||
|
||||
encrypt(data: string | object) {
|
||||
const { encryptionKey } = this.instanceSettings;
|
||||
return AES.encrypt(
|
||||
typeof data === 'string' ? data : JSON.stringify(data),
|
||||
this.instanceSettings.encryptionKey,
|
||||
encryptionKey,
|
||||
).toString();
|
||||
}
|
||||
|
||||
decrypt(data: string) {
|
||||
return AES.decrypt(data, this.instanceSettings.encryptionKey).toString(enc.Utf8);
|
||||
const { encryptionKey } = this.instanceSettings;
|
||||
return AES.decrypt(data, encryptionKey).toString(enc.Utf8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user