4

Encfs documentation explains how to create two new folders (raw storage and mounted folder).

Once a new file is created in the mounted folder, it is automatically encrypted and saved to the raw storage.

I want to encrypt existing files in a directory without copying them twice.

Is there a way to do so?

Alex
  • 155

1 Answers1

3

Let's compare encfs with a simple file encryption

Encrypt a file using openssl

openssl enc -aes-256-cbc -salt -in file.txt -out file.enc  
rm file.txt

What happens?

  • the contents of file.txt get read exactly once.
  • the contents of file.enc get written exactly once.
  • a directory entry for file.txt is removed

(you probably want to securely wipe file.txt but I'll skip that)

Encrypt a file using encfs

 cp /normal/file.txt /encrypted/file.txt
 rm /normal/file.txt

What happens?

  • the contents of /normal/file.txt get read exactly once.
  • the contents of /encrypted/file.txt get written exactly once.
  • a directory entry for /normal/file.txt is removed

Conclusion

There's no scope for reducing the amount of IO