Skip to content
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

Can it be mounted in a VFS to hold files? #3

Closed
lonnietc opened this issue Mar 8, 2022 · 4 comments
Closed

Can it be mounted in a VFS to hold files? #3

lonnietc opened this issue Mar 8, 2022 · 4 comments

Comments

@lonnietc
Copy link

lonnietc commented Mar 8, 2022

Hello,

I am searching for something that would allow me to have 8 databases inside of a single-image VFS that I could mount with m Go application and then start using each database from within the container.

Originally I was looking at a ZipFS approach to have all 8 databases inside a single zip file that I could mount as a VFS with my application, but I do not think that zipfs allows for you to dynamically change the files and that they must be static, but could be wrong.

This is where I found your bencrypt and am wondering if it might work in this use case?

An thoughts would be greatly appreciated.

@awgh
Copy link
Owner

awgh commented Mar 9, 2022

@lonnietc You can call OpenAndDecrypt to decrypt the Zip file and load it into memory. Then you can operate on it in memory. To write those changes back to disk, you will have to call SaveAndEncrypt periodically or at the end, depending on what you're doing.

I would recommend that you check out my friend's more evolved version called Pandora's Box, which lives here: https://github.com/capnspacehook/pandorasbox

He's actually built out the documentation, the application interface, and added memguard protections.

Cheers!

@awgh awgh closed this as completed Mar 9, 2022
@lonnietc
Copy link
Author

lonnietc commented Mar 9, 2022

@awgh Thanks for your quick response on this and I will look into it more.

Although I do understand your idea of reading the databases into memory to operate on them, that would be very problematic in that they could grow to be very large indeed.

I was seeing some type of volume in which the databases could reside but still effectively be "on-disk" although just in a virtual disk. Maybe like a virtual machine disk that grows as it is being filled with files inside which is more of what I have been seeking.

Thanks again

@awgh
Copy link
Owner

awgh commented Mar 9, 2022

@lonnietc Ahh, you want an encrypted volume, not a "virtual filesystem".

Check out cryptoloop or maybe even TrueCrypt if that's still around. Instructions for setting up an encrypted loopback volume are here: https://h3g3m0n.wordpress.com/2007/04/16/quick-simple-encrypted-loopback-filesystem/

@lonnietc
Copy link
Author

lonnietc commented Mar 9, 2022

Thanks so very much and I will definitely look into it more. I truly appreciate all of your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants