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

Encoder max string length #91

Open
JeromeGill opened this issue Feb 5, 2018 · 4 comments
Open

Encoder max string length #91

JeromeGill opened this issue Feb 5, 2018 · 4 comments
Labels
left-open-for-visibility This is either already fixed, or the solution is easily understood. Leaving open for easy discovery.

Comments

@JeromeGill
Copy link

Does anyone have any suggestions how to handle really big strings? (mysql dumps is my use case)

line 323 of ParagonIE\Halite\Symmetric\Crypto calls
(string) ParagonIE\ConstantTime\Base64UrlSafe::encode(message)

The output is truncated to 65534 characters, despite the message being considerably longer.

Do I need to use a different encoder? Any recommendations?

@paragonie-scott
Copy link
Member

This isn't a limitation of Halite. This is a limitation of MySQL. Change your column type to a higher size (e.g. MEDIUMTEXT) to allow longer messages.

@JeromeGill
Copy link
Author

I thought the same at first, but I can confirm i'm using LONGTEXT, and that it is the line referenced above that does the truncation.

I split the dumps into segments which works fine as a solution. I was just wondering what was going on.

@paragonie-scott
Copy link
Member

paragonie-scott commented Feb 5, 2018

What version of Halite are you using? What OS? What version of the OS? What version of PHP? Which extensions are enabled?

Because, as far as I can tell, this isn't a bug in our software.

Both unit tests are passing for me.

@paragonie-scott
Copy link
Member

If you enable strict mode on MySQL, do you get errors when you try to save data to your database?

@paragonie-scott paragonie-scott added the left-open-for-visibility This is either already fixed, or the solution is easily understood. Leaving open for easy discovery. label Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
left-open-for-visibility This is either already fixed, or the solution is easily understood. Leaving open for easy discovery.
Projects
None yet
Development

No branches or pull requests

2 participants