I am working on an encrypted filesystem that encrypts data just before writing it to disk and decrypts it right after reading from disk. Any file in disk is useless if not decrypted first. so far I changed standard read and write methods that filesystem reperesents.
the problem begins with mmap
used for memory mapping files. for example in ext4 filesystem, as far as I know it does not use standard I/O so should be encrypted/decrypted just like read/write system calls. So how can I decrypt data when its being read from disk and encrypt it when kernel wants to update memory mapped files?
I want to stay in my filesystem specific module if it is possible.
UPDATE: read/write works in terminal perfectly. but:
- I can not execute binary files in encrypted partition.
- when I copy files using a GUI based filesystem (pcmanfm for example), result file is corrupted.
so should I edit any other system calls like I did with read/write?