加密双向文件夹同步,以确保我的Dropbox数据 [英] Two-way folder sync with encryption to secure my Dropbox data

查看:211
本文介绍了加密双向文件夹同步,以确保我的Dropbox数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想写一点点.NET脚本/工具,确实至少大部分同样喜欢 SecretSync BoxCryptor ,但没有存储在公司的网络服务器的加密密钥。

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.

首先,它听起来很简单:你有两个文件夹 - 一个decryped-folder和和加密-folder。在这两个文件夹中有一个 FileSystemWatcher的所以工具得到通知,当一个文件发生了变化。 如果在decryped-folder一个文件的更改,它就会将文件加密并将其写入了加密-folder。如果在加密的-folder一个文件的变化,它解密该文件并将其写入到解密-folder

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. If a file changes in the "decryped"-folder, it encrypts the file and writes it to the "encrypted"-folder. If a file changes in the "encrypted"-folder, it decrypts the file and writes it to the "decrypted"-folder.

没有问题为止。

但是,如果用户运行的应用程序(如 KeePass的例如)会发生什么直接从decryped - 夹?同步和加密过程现在将遇到的问题,因为这些文件是从应用锁定。 有没有成才,我可以做些什么来避免这个问题的处理,因此应用程序仍然可以同步和加密过程旁边跑?

But what happens if the users runs a application (like KeePass for example) directly from the "decryped"-folder? The sync and encryption process will now run into problems because the files are locked from the application. Is there someting i can do to avoid this problem handled, so the application can still run beside the sync and encryption process?

感谢您的帮助!

更新:我还是没能找到这个问题的答案。当使用FileSystemWatcher的一流的同步很容易申请的加密/解密,但你正在运行(因为阻止文件的流或应用程序)到问题的文件锁。我也试过微软同步框架。文件同步适用于它,但我不知道如何加密/解密在飞行中的文件。

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.

也许有人有一个小的工作code样本。

Maybe someone has a little working code sample.

推荐答案

伊万诺夫的答案启发你也许应该看看到的 AlphaVSS 。这是卷影复制服务围绕着.NET包装。

Inspired by the answer of Ivanov you should maybe take a look into AlphaVSS. It is a .Net wrapper around the Volume Shadow Copy Service.

通过这个在手,你可以做一个快照,在regulary基础(如每隔15分钟),并从解密文件夹出了VSS的复制文件,而不是复制到加密的文件夹。为了提高速度,你仍然可以使用FileSystemWatcher的简单地记录哪些文件,因为最后一个副本已被更改,并从卷影副本只复制这些文件。

With this in hand you could make a snapshot in a regulary basis (like every 15 minutes) and copy the files instead from the decrypt folder out of the VSS copy into the encrypt folder. To increase the speed you could still use the FileSystemWatcher to simply log which files have been changed since the last copy and copy only these files from the shadow copy.

这篇关于加密双向文件夹同步,以确保我的Dropbox数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆