decrypt(data) { const ciphertext = data.msg const key = this.chatService.getPasscode const bytes = CryptoJS.AES.decrypt(ciphertext, key) const plaintext = bytes.toString(CryptoJS.enc.Utf8) console.log(data.msg) console.log(key) console.log(bytes.toString(CryptoJS.enc.Utf8)) return {msg: plaintext} } encrypt(msg: string) { const plaintext = msg const key = this.chatService.getPasscode const ciphertext = CryptoJS.AES.encrypt(plaintext, key) console.log(msg) console.log(key) return ciphertext.toString() }