Skip to content

cryptcheck: compare checksum for crypted remote #1102

Closed

Description

@stefano70

Having a local source and an encrypted remote, the only way to be sure that the remote is "bitperfect" is to download the encrypted remote file, decrypting it, then compare the file against the original.
This is time consuming, because we have to download files...

The suggestion is to encrypt a local file using the same nonce as the one stored in the ACD, then compare checksums for both the encrypted files.

It is MUCH faster to encrypt a local file than download the same file from the cloud.

Activity

  1. ajkis commented on Feb 5, 2017

    @ajkis

    The checksum support for crypt is planed, the sooner the better, since its tied with some other rclone features as well.

  2. ncw commented on Feb 5, 2017

    @ncw
    Member

    This is a good idea in theory...

    However it is a little tricy to implement

    • it would probably require a new checkcrypt command
    • crypt would need to implement an optional interface to return the hash of the encrypted file
    • crypt would need to implement another optional interface to crypt with a nonce and checksum a file
  3. ajkis commented on Feb 6, 2017

    @ajkis

    So without hash support any chance to support flags that are currently not working due no checksum ?
    For example file rename with sync, using crypt will mean full download and upload just when you rename some folder.

  4. naeloob commented on Feb 7, 2017

    @naeloob

    Nice!!
    +1
    That's what i was trying to ask for in #1091 (comment)

  5. Stonedestroyer commented on Feb 8, 2017

    @Stonedestroyer

    Google Drive supports returning MD5 and also Amazon I believe so it could be used to verify files.

  6. jrarseneau commented on Feb 8, 2017

    @jrarseneau

    +1..00 👍

  7. ncw commented on Feb 8, 2017

    @ncw
    Member

    @ajkis
    rclone verifies MD5SUMs in normal operation too - just not with crypt

  8. ncw commented on Feb 11, 2017

    @ncw
    Member

    I'm going to try to squeeze this in to the 1.36 release so people can check for corruptions.

  9. added this to the v1.36 milestone on Feb 11, 2017
  10. ajkis commented on Feb 12, 2017

    @ajkis

    👍
    would this allow for track renames as well ?

  11. ncw commented on Feb 12, 2017

    @ncw
    Member

    @ajkis No it is purely an integrity check

  12. ncw commented on Feb 12, 2017

    @ncw
    Member

    I've implemented rclone cryptcheck in this beta please give it a go!

    http://beta.rclone.org/v1.35-91-g01c747e-cryptcheck/ (uploaded in 15-30 mins)

    Here are the docs


    rclone cryptcheck checks a remote against a crypted remote. This is
    the equivalent of running rclone check, but able to check the
    checksums of the crypted remote.

    For it to work the underlying remote of the cryptedremote must support
    some kind of checksum.

    It works by reading the nonce from each file on the cryptedremote: and
    using that to encrypt each file on the remote:. It then checks the
    checksum of the underlying file on the cryptedremote: against the
    checksum of the file it has just encrypted.

    Use it like this

    rclone cryptcheck /path/to/files encryptedremote:path
    

    You can use it like this also, but that will involve downloading all
    the files in remote:path.

    rclone cryptcheck remote:path encryptedremote:path
    

    After it has run it will log the status of the encryptedremote:.

    Usage:
    rclone cryptcheck remote:path cryptedremote:path [flags]

  13. changed the title [-]compare checksum for crypted remote[/-] [+]cryptcheck: compare checksum for crypted remote[/+] on Feb 15, 2017
  14. calisro commented on Feb 27, 2017

    @calisro
    Member

    I'm getting differing results between my tests. Not sure why.

    I have a mount of the crypted drive on /data/Media3 and the local volume is /data/Media1

    
    rsync $OPT --inplace -rlxi --checksum -n --out-format="%n" \
    >    --include="*.nfo" \
    >    --include="*/" \
    >    --exclude="*" \
    >  /data/Media1/Videos/ /data/Media3/Videos/ | egrep -v "/$" |tee $TMPFILE
     Series/Fargo/tvshow.nfo
    Series/Fear.the.Walking.Dead/tvshow.nfo
    Series/Game.of.Thrones/tvshow.nfo
    Series/Happy.Valley/tvshow.nfo
    

    rsync reports 4 differences. I verified they are different.

    rclone   --include=tvshow.nfo  cryptcheck -v /data/Media1/Videos "riosgd-cryptp:Media/Videos" 
    
    2017/02/27 15:39:24 NOTICE: Encrypted Google drive root 'cloudp/lp08934q11u6a5gslo2ddds5b4/hkitmqcr303hk1a33m19ttdq24': 0 files not in Local file system at /data/Media1/Videos
    2017/02/27 15:39:24 NOTICE: Local file system at /data/Media1/Videos: 0 files not in Encrypted Google drive root 'cloudp/lp08934q11u6a5gslo2ddds5b4/hkitmqcr303hk1a33m19ttdq24'
    2017/02/27 15:39:24 INFO  : Encrypted Google drive root 'cloudp/lp08934q11u6a5gslo2ddds5b4/hkitmqcr303hk1a33m19ttdq24': Waiting for checks to finish
    2017/02/27 15:39:24 ERROR : Series/Happy.Valley/tvshow.nfo: hashes differ (riosgd-cryptp:Media/Videos) "634bdbfce3e34c26a4c1e1bc3775f647" vs (local:/data/Media1/Videos) "be5781293745490a0a1939f3c1150bf7"
    2017/02/27 15:39:25 NOTICE: Encrypted Google drive root 'cloudp/lp08934q11u6a5gslo2ddds5b4/hkitmqcr303hk1a33m19ttdq24': 1 differences found
    2017/02/27 15:39:25 Failed to cryptcheck: 1 differences found
    
    
    root@HS: ~
    ->#  diff /data/Media1/Videos/Series/Fargo/tvshow.nfo /data/Media3/Videos/Series/Fargo/tvshow.nfo
    11c11
    <     <episode>19</episode>
    ---
    >     <episode>20</episode>
    223c223
    <     <dateadded>2017-02-19 09:44:03</dateadded>
    ---
    >     <dateadded>2017-02-21 14:17:26</dateadded>
    
  15. ncw commented on Feb 28, 2017

    @ncw
    Member

    @calisro strange!

    If you download the files using rclone copy, do you see the 4 file differences or only the 1?

    Were there any other log messages when you did the rclone cryptcheck?

  16. calisro commented on Feb 28, 2017

    @calisro
    Member

    I replaced those files already but let me try to recreate it and save it.

  17. ncw commented on Mar 5, 2017

    @ncw
    Member

    As far as I can see this is done for the 1.36 release. If there are any outstanding problems - please open a new issue.

  18. Saviq commented on Mar 5, 2017

    @Saviq

    Does copy/sync/check with --checksum work on crypted remotes now, too?

  19. ncw commented on Mar 7, 2017

    @ncw
    Member

    @Saviq no - I'm afraid not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions