Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypt function returning Byte Array instead of string #6

Closed
rspicer opened this issue Aug 15, 2017 · 2 comments
Closed

Encrypt function returning Byte Array instead of string #6

rspicer opened this issue Aug 15, 2017 · 2 comments

Comments

@rspicer
Copy link

rspicer commented Aug 15, 2017

Hi there! I'm new to using this library, so forgive any stupid questions :). When I call the encrypt function, it returns a byte array... although, in the documentation, it says it's supposed to return a string. My implementation relies on the ciphertext being returned as a string - if I'm missing something, and it can't be, is there an encoding for the byte array I can use to convert it in to a string?

Thanks for your help!

@mattsb42-aws
Copy link
Member

Hmm, the docs should all indicate a bytes return value; I'll check on that and fix the points I missed.

It is intentional that it is returning bytes rather than a string, as it it returning the raw encrypted message, which will almost always include non-ascii characters. If you need a string we generally recommend base64 encoding the bytes.

@rspicer
Copy link
Author

rspicer commented Aug 15, 2017

That works - cheers mate! Thanks much for the quick answer!

@rspicer rspicer closed this as completed Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants