Skip to content

Module to hash files and Bytearrays to compare files check integrity and find duplicates

Notifications You must be signed in to change notification settings

Kriegel/PowerHash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

PowerHash

Module to hash (checksum) files and Bytearrays to compare files, check integrity and find duplicates

This is currently in beta / Testing stage! Tested with PowerShell 5.1 and 7 Windows only.

This Module is using the cryptographic classes out of the .NET Framework AND the non-cryptographic hash functions out of the following C# Project https://github.com/brandondahler/Data.HashFunction

Currently there is only one Function in this Module to checksum Files.

  • Get-PwFileHash

Use hashes with care!

In computer science, a collision is a situation that occurs when two distinct pieces of data have the same hash value, checksum, fingerprint, or cryptographic digest.

Every hash function with more inputs than outputs will necessarily have collisions.

See: https://en.wikipedia.org/wiki/Collision_resistance

Why not using the build in PowerShell cmdlet Get-FileHash ?

To find duplicate Files or to do Integrity checks after a copy (backup) of data files, there is no need for Cryptographic secure hash functions. The only need for the result of a hash function here is collision-resistance and Speed. So this Module offers non-cryptographic hash functions to archive this.

Get-PwFileHash offers the same Cryptographic secure hash functions like the build in Get-FileHash cmdlet, plus the (faster) non cryptographic hash functions.

Cryptographic and Non-Cryptographic Hash Functions

A cryptographic hash function aims to guarantee a number of security properties. Most importantly that it's hard to find collisions or pre-images and that the output appears random. (There are a few more properties, and "hard" has well defined bounds in this context, but that's not important here.) Many Cryptographic hash functions are no longer considered secure. Like MD5 or many of the SHA functions.

Non cryptographic hash functions just try to avoid collisions for non malicious input. Some aim to detect accidental changes in data (CRCs), others try to put objects into different buckets in a hash table with as few collisions as possible.

In exchange for weaker guarantees they are typically (much) faster.

See also: https://dadario.com.br/cryptographic-and-non-cryptographic-hash-functions/

About

Module to hash files and Bytearrays to compare files check integrity and find duplicates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published