Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
copying twice? you create the encrypted folder, copy the files once .. and rename the encrypted folder... ? –  akira May 10 '12 at 9:06

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
cp && rm => mv ? –  akira May 10 '12 at 11:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.