You are not logged in.

#1 2015-11-11 22:07:31

garchws
Member
Registered: 2015-10-31
Posts: 18

How Can One Use Hashes to Ensure that Two Dropbox Folders are Synced?

**Problem:** Right now I have two computers (both running Arch on xfce4) connected to Dropbox.  Superficially, Dropbox places an icon in the taskbar which tells you if it is adequately synced to the cloud; however, I've recently come into issues in the past when taking this indicator at face value.  So I've been trying to brainstorm a way to *ensure* that my Dropbox folders are actually synced up.

**Proposed Solution:** My best guess is to use hashes. This is similar to the strategy employed by Git to ensure that repositories are the same: here, you can just compare repository commit hashes and, if they are the same, be more than 99.9% certain that your repositories are identical.

**Questions:**

1. Can one use hashes to ensure that two Dropbox folders are synced?

2. Are there any obvious pitfalls to this method that I'm missing?

3. Using this strategy, would it be possible to know ahead of time -- while both of my computers are syncing -- that they are NOT in sync (i.e., could I somehow access the Dropbox hashes ahead of time even before the Dropbox folders are fully synced)?

Offline

#2 2015-11-11 23:08:25

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,720

Re: How Can One Use Hashes to Ensure that Two Dropbox Folders are Synced?

1. Hashes are an excellent way to determine that two files are identical.  Not that it matters for what you are doing, use a strong hash such as a 256 bit SHA-2.  Not that anyone would, but MD5 and SHA-1 can be spoofed.
2. How do you plan to exchange hashes?  That is the critical piece.
3. Yes.

BTW, for a 1Meg file, that probability for SHA-256 is about 99.9999999999999999999999999999999%
(1 - 1.4 x 10^-33)
http://crypto.stackexchange.com/questio … hed-values

Last edited by ewaller (2015-11-11 23:09:14)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2015-11-11 23:20:19

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: How Can One Use Hashes to Ensure that Two Dropbox Folders are Synced?

This is something the client should do for you. If the client claims to be connected and synced (green check), then it is either saying the truth or it is lying about its connection status (blue arrow circle). Long story short, if either of these happen problems happen regularly enough to make you think about a hackish solution, then I'd say this service is not fit to hold your data.

Offline

#4 2015-11-11 23:26:16

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,720

Re: How Can One Use Hashes to Ensure that Two Dropbox Folders are Synced?

Awebb wrote:

This is something the client should do for you. If the client claims to be connected and synced (green check), then it is either saying the truth or it is lying about its connection status (blue arrow circle). Long story short, if either of these happen problems happen regularly enough to make you think about a hackish solution, then I'd say this service is not fit to hold your data.

*Cough*https://wiki.archlinux.org/index.php/Syncthing*Cough*


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB