Skip to content

williamscales/hash_back

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HashBack

HashBack is a simple file snapshotting utility for Windows designed for cryptographic verification of backup integrity.

Capabilities

  1. Make a backup of a given list of files (a snapshot)
  2. Inspect existing snapshots
  3. Delete existing snapshots

Example Usage

An invocation of HashBack could look like this:

$ hash_back create_snapshot --include_files=

Snapshots

A snapshot of a given list of files is a complete image of the state of those files at a certain point in time. A snapshot consists of a FileSet and a HashTree along with the blocks corresponding to the files in the snapshot.

A FileSet comprises FileSetMember objects, each of which stores metadata about a single file in the backup set. The metadata include the file’s original path on disk and a list of the SHA-256 hashes of the blocks which make up the file.

A HashTree is a binary tree where each leaf node contains the SHA-256 hash of a block. Each non-leaf node stores the hash of the concatenation of its children.

Given a list of files, the steps to make a snapshot are: #. Initialize a FileSet. #. For each file in the input do the following:

  1. Break the file into blocks and encrypt each block. We now operate on the encrypted blocks.
  2. Compute the SHA-256 hash of each block.
  3. Add a FileSetMember containing metadata and a list of the SHA-256 hashes of the blocks making up the file.
  1. Initialize a HashTree of depth log2(N), where N is the smallest power of 2 greater than or equal to the number of blocks.
  2. Fill the binary tree leaf nodes from left to right with the hashes of the pieces.
  3. Fill any excess leaf nodes with zeroes
  4. The set of blocks along with the Merkle tree comprises a snapshot.

License

Copyright 2014 William Scalesh

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages