Skip to content

crypto.js throws Malformed UTF-8 data #12

@spammads

Description

@spammads

When providing the correct passwords I get an exception on

var decrypted = CryptoJS.AES.decrypt(encrypted, key, {
          iv: iv,
          padding: CryptoJS.pad.Pkcs7,
          mode: CryptoJS.mode.CBC
        }).toString(CryptoJS.enc.Utf8);
        return decrypted;

saying

Malformed UTF-8 data

According to this comment maybe it helps to convert encrypted to string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions