Skip to content

sodium.crypto_secretbox () or decrypted.toString(); does not handle UTF8 characters #50

@agnasg

Description

@agnasg

Not sure if this is an issue or maybe I need to put charset="UTF-8" somewhere but if the original plaintext has UTF8 characters the resulting decrypted text returns garbage.
For example:
plaintext = 'El camión tenía piñas';

ciphertext.toString('hex') == bbbbe889db929838ddd6b62b0712479655c4abb10890bdd835d3298436234746d19da673c8

decrypted.toString() == El cami�n ten�a pi�as

I was about to swap the bytes but it seemed crazy, so I preferred to ask.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions