There are different ways to encrypt the cloud. One of them is to place a crypto disk in the cloud. In the
previous article, we wrote why it is not always convenient. In the same article, we will look at the topic of a crypto disk in the cloud from the other side.

Can a crypto disk and a cloud coexist?
To save you a click of the mouse, we recall how to begin the previous article. In it, we said that the easiest way is to place the files in a cryptocontainer, and place the file of the container itself on Google Drive. Then, to work with files on another device, you had to load the container, open it, view / edit files, and copy the container back to the cloud. But with such a scheme, there is a problem of traffic overspending. What if the size of the crypto disk is a few gigabytes, and you need to change the file, the size is only a few kilobytes? Yes, all these few gigabytes will be uploaded to the cloud again.
All this is true only for cloud storage that does not support delta sync, that is, for the same Google Drive. However, some other cloud storages, such as Yandex.Disk and Dropbox, support delta updates, which means that the crypto disk can safely “live” in the cloud.
Delta sync principle
The principle of delta synchronization (delta updates) is very simple: not the entire file is copied to the cloud, but only what has changed. In other words, let you have a large file size, say 1 GB. In it, you changed some part. This part will be sent to the cloud. Similarly, the same part will be downloaded from the cloud to all other devices using the same account. As a result, both synchronization time and network load are reduced.
Initially, delta sync only supported Dropbox. Later Yandex.Disk joined it. As far as we know, so far delta updates support only these two repositories. The OneDrive cloud drive only supports delta sync for MS Office files.
From this we can conclude that the Yandex.Disk and Dropbox repositories can be used not only for storing crypto disks, but also for any other large files you are working on. True, there are exceptions. If the file format implies packaging, for example, video, music and similar formats, then delta synchronization does not work and you will have to overwrite the entire file again.
There are debates about the effectiveness of delta updates in the network,
some bloggers claim that there is no point in it. Well, let's see together.
Next, we will show how delta synchronization works on the example of the CyberSafe Disk application (it can be downloaded for free from
the developer’s website ). You can use this principle with any other crypto disk, for example, with containers of the same trucrypt.
')
Delta sync in action
The first step is to install
Yandex.Disk and specify your credentials (Fig. 1). So that no other files interfere with synchronization, we use a new account created specifically for writing the article (Fig. 2).

Fig. 1. Log in Yandex.Disk

Fig. 2. Contents of the default YandexDisk folder
Next, run the CyberSafe Disk (or a trukript - all the markers are different in taste and color), go to the
Virtual Safe section and click the
Create button. As the path to save the crypto disk, select the YandexDisk folder, specify the actual size - 500 MB (default is 100 MB), enter the file name, password, and click the
Accept button. At the time of creating the crypto disk, it is better to turn off Yandex.Disk synchronization - in order not to confuse the application and get the actual synchronization time.

Fig. 3. Creating a crypto disk

Fig. 4. Sync off
We wait until the crypto disk is created, then select it in the program and click the Mount button (Fig. 5). Further, as usual - enter the password and start working with it.

Fig. 5. CyberSafe Disk program
I put one relatively large file on a crypto disk - a 270 MB movie and one small text file, as shown in Figure 6.

Fig. 6. Crypto disk is mounted as H, files are placed on it.
At the end of the work with the crypto disk, we will unmount it (the
Unmount button in the program), turn on synchronization and detect the start and end of synchronization. Unmounting the disk is necessary for the cloud disk client to be able to access the file - because CyberSafe Disk uses exclusive access and no other program can read the file while it is mounted. In practice, the synchronization can and can not be turned off, it just starts after Yandex.Disk can access the file.
If you have Windows 10, you can also see the Yandex.Disk network usage. Prior to the synchronization of the crypto disk on the test machine, the use of the Yandex.Disk network was 83.5 MB, which is shown in Fig. 7

Fig. 7. Using the network until full synchronization of the crypto disk
So, now 9:19. Let's see how long it takes to complete synchronization of the created crypto disk. At a speed of 1.2 MB / s, it took about 8 minutes to synchronize a 500 MB sized crypto disk (Fig. 9). Sync end time is 9:27.

Fig. 8. Crypto disk synchronization in progress.

Fig. 9. Full sync completed
And now let's see how much traffic Yandex.Disk application used. After synchronization, the use of traffic by the application was 618 MB. That is, the application consumed 534.5 MB of traffic.

Fig. 10. Use of traffic after full synchronization (before delta synchronization)
Disable sync. We mount the crypto disk again and make changes to the text file. I just added another line (fig. 11).

Fig. 11. This time the drive is mounted as J
Next, unmount the disk, look at the time and start the synchronization. It is now 9:35 (fig. 12). It should be noted that with delta synchronization you need a little more time to start the synchronization itself. The application must understand which part of the file to send to the cloud.

Fig. 12. Delta sync start time
In our case, the minute was gone for everything, maybe a little more, no one noticed up to a second, but at 9:36 the application reported that the crypto disk (test.vdf) was synchronized.

Fig. 13. Delta sync completed. Time 9:36
Let's see how much traffic the application has spent (Fig. 14). Only 1 MB.

Fig. 14. Traffic use after delta synchronization
Let's do the same experiment with OneDrive. Place our crypto disk in the OneDrive folder and start synchronization. The use of traffic before the first synchronization is 45.3 MB (see Fig. 14). In fig. 15 shows the start time of synchronization (9:57), the use of traffic before synchronization, and the fact that OneDrive sends our file to the cloud is visible in size.

Fig. 15. First synchronization of a crypto disk using OneDrive
The end time of the first synchronization is shown in fig. 16 - 10 hours and 7 minutes. The first synchronization was spent 10 minutes, by the way, 2 minutes more than in the case of Yandex.Disk. Traffic usage is depicted in Fig. 17. It was 45.3 MB, it became 582 MB, that is, 536.7 MB was downloaded to the cloud.

Fig. 16. The end time of the first synchronization of OneDrive

Fig. 17. Traffic after the first synchronization of OneDrive
Further, the same algorithm: disable synchronization, mount the disk, make changes (I traditionally add another line to the file), unmount, enable synchronization. In fig. 18 shows the path to the crypto disk - note that the crypto disk is mounted from the OneDrive folder.

Fig. 18. Making changes to the crypto disk
The launch of the second OneDrive sync occurred at 10:16. What's next? And then OneDrive megabytes per megabyte begins to transfer the file to the cloud again (Fig. 20).

Fig. 19. Start the second synchronization OneDrive

Fig. 20. Delta sync is clearly not supported ...
The second synchronization was completed at 10:27, that is, it took about the same 10 minutes, see fig. 21. The use of traffic confirms that the delta updates are not supported and OneDrive takes the lead in traffic consumption (Figure 22).

Fig. 21. The time of the completion of the second synchronization

Fig. 22. Using OneDrive traffic after the second sync
I think comments are unnecessary here - and so everything is clear. Using delta synchronization saves time and traffic, as well as the use of synchronization of crypto disks on mobile devices. Initial synchronization can be performed via Wi-Fi, and delta updates take up very little traffic and are quite appropriate in 3G networks.