Two-way folder sync with encryption to secure my Dropbox data

I'd like to write a little .NET script/tool which does at least mostly the same like SecretSync or BoxCryptor, but without storing the encryption key on a company's web servers.

First it sounds very simple: You have two folder - a "decryped"-folder and and "encrypted"-folder. On both folders there is an FileSystemWatcher so the tool gets notified when a file has changed. Если файл изменяется в «дешифрованной» папке, он шифрует файл и записывает его в «зашифрованную» папку. Если файл изменяется в «зашифрованной» -папке, он расшифровывает файл и записывает его в «дешифрованную» -папку.

Пока нет проблем.

Но что произойдет, если пользователи запустят приложение (например, KeePass например) прямо из "расшифрованной" папки? Теперь в процессе синхронизации и шифрования будут возникать проблемы, поскольку файлы заблокированы из приложения. Is there someting i can do to avoid this problem handled, so the application can still run beside the sync and encryption process?

Thanks for any help!

Update: I still couldn't find a answer to this question. When using FileSystemWatcher-class for syncing it is easy to apply the encryption/decryption, but you are running into problems with file locks (because of the streams or applications blocking the files). I also tried Microsoft Sync Framework. File sync works with it, but i don't know how to encrypt/decrypt the files on the fly.

Maybe someone has a little working code sample.

12
задан ulrichb 4 December 2012 в 15:55
поделиться