libsodium-laravel icon indicating copy to clipboard operation
libsodium-laravel copied to clipboard

Maybe use serialize and check the payload

Open bitbeans opened this issue 9 years ago • 1 comments

If a project switched from the original Laravel encrypter to this (without clearing the browser cache), there will be an error:

Undefined offset: 1

in https://github.com/scrothers/libsodium-laravel/blob/master/src/SodiumLibrary.php#L228

Maybe we should check the payload before the decryption starts: https://github.com/bitbeans/lencryption/blob/master/src/Lencryption.php#L89

bitbeans avatar Mar 06 '16 06:03 bitbeans

Actually, I like the idea of encapsulating in base64 like you are. I'm currently re-working the code to better maintain it right now as well.

I'm working on some interoperable libraries for Node.js and PHP currently, my PHP work up is here: https://github.com/simpleapisecurity/php

My Laravel package based off that is here: https://github.com/simpleapisecurity/laravel

I eventually plan on deprecating this in exchange for the other, it's a lot faster in phpunit (I didn't check why, I'll determine why afterward).

I'm also working on code documentation, and better commenting right now. You're more than welcome to see where I head :)

I'm definitely going to use your code sample though, I'll of course credit you in the commit.

scrothers avatar Mar 06 '16 06:03 scrothers