-
Notifications
You must be signed in to change notification settings - Fork 139
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
How to encrypt a Video File #21
Comments
same issue here. what is the basic idea to encrypt any kind of file ? |
@Pruthvirajcodewave @nabeelItilite you've likely moved on from this by now, but with the current API you'd need to load the entirety of the file from disk into a base64 string and then pass it across the bridge to be encrypted. I don't recommend doing this, as it'd be quite slow. I need to encrypt media files in the app I'm working on, so even though it'll take some native work, I plan to fork this repository, and add a couple of native functions on both the iOS and Android sides for encrypting files on-disk, without having to go across the JS bridge. Luckily, @tectiv3 has already done almost all the work required for this, and it should be relatively simple to follow the existing code on each platform and make functions for encrypting files by path. Each side would have to use native APIs to:
|
@mrmurphy It's been a while since you commented here but I'm wondering if you managed to add this feature in a fork. If that's the case could you open a PR here? I'm in need of exactly the same thing. Thank you! |
@mrmurphy I was wondering the same thing too |
Below is how to encrypt a text. Is there a way to encrypt video file by passing the path ?
const encrypt = (text, keyBase64) => {
var ivBase64 = "base64 random 16 bytes string";
return Aes.encrypt(text, keyBase64, ivBase64).then(cipher => ({ cipher, iv: ivBase64 }));
};
The text was updated successfully, but these errors were encountered: