-
Notifications
You must be signed in to change notification settings - Fork 311
Large file encryption/decryption #63
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
Conversation
|
What's the point to moving to AES-CTR? |
|
OpenSSL with CBC mode adds PKCS7 padding to each chunk (for us, 8192 bytes), which adds 16 bytes of overhead to each chunk. We also have to transform the IV after each chunk and we'd end up making a sort of counter anyway. |
src/File.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might return FALSE
src/File.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe more informative: "Incorrect key length." ?
src/File.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about 32-bit PHP and files > 2GB. Wouldn't that overflow the integer and give us something that's potentially non-exact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we error on file sizes >= (PHP_INT_MAX - 1) >> 1?
Now with return value checking Remove nbproject
|
Okay, that commit satisfied the code warts you spotted (thanks @defuse!).
If @zooko has any spare cycles to tell me, quickly, if I'm doing it wrong, that would be greatly appreciated too! (For quick reference, this is a "read the whole file, verify MAC, then decrypt" approach, so no random access within the file -- maybe a separate class can be made for that?) |
|
I'm sorry! I can't look at this right now.
Regards,
Zooko
|
|
As per this comment in r/netsec I've added some basic documentation to this PR. I migrated the old documentation header from Storing MACs in an array and re-verifying them on decryption (after the final HMAC has been verified) has been implemented, so race conditions against the filesystem should be effectively mitigated. |
|
Should I resubmit or just force push to my branch? |
|
Closing in favor of #78 |
Differences from
Crypto:Changes to
Crypto:Core.Things we would like to test for before merging:
This should close #39 (and #38?) when it's merged.