rust-embed
rust-embed copied to clipboard
Is there a way to encrypt embedded file? Maybe before/after hooks?
Thanks for your work.
I just found out https://github.com/anvie/litcrypt.rs. I'm wondering if there is a way to encrypt the content of some files using it.
What can you suggest?
Thanks frederikhors. At this point rust-embed only supports folders so if we do add such a feature it would have to be an entire folder. We do have a compress feature which does something similar.
Yeah. It would be ok too. Because I can encrypt some words in the entire folder.
I feel like "encrypt" could be too vague and niche, it might be best to just use a build script to encrypt the files, and then use RustEmbed on the output directory of that script.
I feel like "encrypt" could be too vague and niche, it might be best to just use a build script to encrypt the files, and then use RustEmbed on the output directory of that script.
I do not understand: I need to "decrypt" content of those file at runtime.
I feel like "encrypt" could be too vague and niche, it might be best to just use a build script to encrypt the files, and then use RustEmbed on the output directory of that script.
I do not understand: I need to "decrypt" content of those file at runtime.
I guess then you could just do the XOR "encryption" manually then, instead of using litcrypt at all. I didn't look closely enough at the library to realize that what I said earlier wouldn't work.
So this would be a new feature litcrypt which would encrypt the entire folder and expects the LITCRYPT_ENCRYPT_KEY env variable. That seems fine I guess.
Just wondering if its worth exposing a generic interface for this sort of stuff which can be implemented by the application instead of putting it under a feature. Maybe before/after hooks.
I don't think the library should have a specific feature just for encryption, especially if we only provide a specific algorithm. It sounds like there's a need for a pre-embed hook (maybe by passing in the procedural macro that should annotate the file data once it's been read from disk?).
I guess then you could just do the XOR "encryption" manually then, instead of using
litcryptat all.
I do not understand, can you write a small example? @BBaoVanC
Maybe before/after hooks.
It sounds like there's a need for a pre-embed hook
I think the same. Hooks seem perfect for cases like this.
I'll change the title.
i fw it