Irad K
2017-06-11 16:52:16 UTC
My case is rather simple to explain, and I'm struggling to find in which
layer should I implement it.
Basically I've got files that are rather sensitive so I keep them
encrypted, and I'd like to let only certain processes the ability to
interact with them as they were regular files (all other processes who
attempt to touch those files, will see them as encrypted).
For that I'm willing to use AES256 which is a simple encryption method with
symmetric key.
Now, for every access to a file contents (either read/write or map) I want
to be able to perform the following flow :
1. READ: after reading the raw data (encrypted), it will get decrypted with
the symmetric key that the process has.
2. WRITE: before writing, the contents get encrypted with the symmetric key
that the process has.
3. MMAP: the same for file mmap, I wish to decrypt the file contents before
they mapped to memory.
I'm asking is just some direction about where to start from .. which layer
should I apply to implement these ideas disregarding the OS (osx or linux).
After I read the manuals I found out that the only way to control file
actions is using the API in fuse_lowlevel.h or fuse.h, both let you set a
vector of file operations called fuse_operation or fuse_lowlevel_ops.
I've tried to play with these api's, but when I tested it, it seems that
when I read or write or map the file, it doesn't goes through the operation
I just defined in the vector I mentioned above.
thanks
Irad
layer should I implement it.
Basically I've got files that are rather sensitive so I keep them
encrypted, and I'd like to let only certain processes the ability to
interact with them as they were regular files (all other processes who
attempt to touch those files, will see them as encrypted).
For that I'm willing to use AES256 which is a simple encryption method with
symmetric key.
Now, for every access to a file contents (either read/write or map) I want
to be able to perform the following flow :
1. READ: after reading the raw data (encrypted), it will get decrypted with
the symmetric key that the process has.
2. WRITE: before writing, the contents get encrypted with the symmetric key
that the process has.
3. MMAP: the same for file mmap, I wish to decrypt the file contents before
they mapped to memory.
I'm asking is just some direction about where to start from .. which layer
should I apply to implement these ideas disregarding the OS (osx or linux).
After I read the manuals I found out that the only way to control file
actions is using the API in fuse_lowlevel.h or fuse.h, both let you set a
vector of file operations called fuse_operation or fuse_lowlevel_ops.
I've tried to play with these api's, but when I tested it, it seems that
when I read or write or map the file, it doesn't goes through the operation
I just defined in the vector I mentioned above.
thanks
Irad