Skip to main content

Hashing

Hashing is a process that takes input data and produces a hash value, a fixed-size string of characters, also referred to as digest. This hash value uniquely represents the data, and any change in the data, no matter how small, should lead to a change in the hash value. Hashing should not be confused with encryption or encoding; hashing is one-way, and you can’t reverse the process to get the original data. It helps protect data’s integrity and ensure password confidentiality.

Hash Functions​

AlgorithmOutput SizeSecurityTypical Use
MD5128-bitWeakChecksums, legacy systems
SHA-1160-bitWeak/ModerateLegacy digital signatures
SHA-256256-bitStrongModern security, blockchain
SHA-3224-512-bitStrongNext-gen secure hashing
Argon2Memory-hardStrongPassword hashing
ScryptMemory-hardStrongPassword hashing
BcryptAdaptiveStrongPassword hashing
PBKDF2AdaptiveStrongPassword hashing
yescryptMemory-hardStrongPassword hashing

Hashing Commands​

md5sum filename.txt        # Generate MD5 hash
sha1sum filename.txt # Generate SHA-1 hash
sha256sum filename.txt # Generate SHA-256 hash
sha512sum filename.txt # Generate SHA-512 hash
openssl dgst -sha256 filename.txt # Generate SHA-256 hash using OpenSSL
sha3sum -a 256 filename.txt # Generate SHA-3-256 hash

Password Cracking​

You can’t “decrypt” password hashes. They’re not encrypted. You have to crack the hashes by hashing many different inputs (such as rockyou.txt as it covers many possible passwords), potentially adding the salt if there is one and comparing it to the target hash. Once it matches, you know what the password was. Tools like Hashcat and John the Ripper are commonly used for these purposes.

hashcat -m <hash_type> -a 0 target_hash.txt wordlist.txt
john --wordlist=wordlist.txt --format=<hash_type> target_hash.txt

UUID (Universally Unique Identifier)​

A UUID is a 128-bit number used to uniquely identify information in computer systems. They are often represented as 32 hexadecimal characters, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (including the hyphens). UUIDs are widely used in software development for unique identifiers.