4

Is there a safe way to do crypto that will always produce the same result for a given input?

My use case is transferring deltas of huge files, to a backup server. The backup server has no knowledge of what's in the byte stream (and it shouldn't).

In order to transfer only the changed parts of the file, any block that hasn't changed would need to return the same cyphertext. This allows the server and client to detect identical ranges which don't need to be transferred again (pretty much how rsync works).

I've been looking at a CTR cypher, but as far as I understand I'd need to reuse the IV over time to end up with equally encrypted blocks, which is obviously a no-go.

Is this even possible, or am I violating some basic principle of crypto here?

David Cary
  • 5,664
  • 4
  • 21
  • 35
  • 2
    Also, you may wish to look into the architecture of tarsnap, which was designed to efficiently solve content-aware deduplication of encrypted backups. – Stephen Touset Aug 28 '14 at 18:21