-
Notifications
You must be signed in to change notification settings - Fork 518
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
Stream Decryption of Media files a chunk at a time #196
Comments
Sorry for the long lag responding. RNCryptor is not very well suited to encrypting video. See the FAQ "Does RNCryptor support random access decryption?". See also #161. |
@SweetEvil , did you succeed in decrypting the file in chunks? |
@nishabe Yes, I ended up using RabbitMQ encryption and decryption instead. |
@SweetEvil I'm trying to do the same thing, can you please provide an example on how to play encrypted video in chunks? |
@walshahed Actually, I had to drop RNCryptor and did it by writing my own encryption with Rabbit Algorithm. |
@SweetEvil I have local encrypted mp4 file, I need to decrypt the file and play it using AVplayer but it takes long time to decrypt the whole file before playing |
Just FYI - you can random-access decrypt with CBC (the readme seems to imply this is not possible). You just can't encrypt random access. And, of course, you miss out on the HMAC check. Just read on a block boundary, and use the previous block as an "IV". (Or read a block ahead and throw out the first block.) In the past I've written a CGDataProvider that does this. |
@dunhamsteve Thanks for adding the comment. There's already been some work down this road for RNCryptor (as a new format, not the existing RNCryptor format). Yes, the readme is misleading; it creates restrictions and breaks various other things, but it is possible. |
I haven't looked at this in great detail yet, is it worth exploring or should I look into something else? I think I understand the concept but the readme is misleading. Would this process not involve setting the IV manually (which the readme essentially says don't/can't)? If that is the case I take it, it would require modification to the code to allow this? |
This absolutely would require large code changes. It won’t be made part of RNCryptor; it would be a new format. |
Thanks for the response, I’ll see if I can find some other way of doing it then :) |
I have a
mp4 video file
which i am encrypting to save and decrypting to play viaAVPlayer
. Its working fine when i am decrypting whole file at once but my file is quite big and taking 100% CPU usage and lot of memory. So, I need to decrypt encrypted file in chunks.I tried to decrypt file in chunks but its not playing video as AVPlayer is not recognizing decrypted chunk data maybe data is not stored sequentially while encrypting file. I have tried
chacha20, AES, AES.CTR & AES.CBC
protocols to encrypt and decrypt files but to no avail.I need help regarding this issue, Kindly guide me to the right way to achieve this.
The text was updated successfully, but these errors were encountered: