Hashing or Message Digest
-
Hashing is method to achieve Integrity
What is Hashing? Transforming String into FIXED-LENGTH string Value. From Hash Message cannot be retrieved back. Hash function should not generate same value for different input strings.
MD5 started producing that and hence considered broken.
Kumar > | Hash Function | > random_string
- Why to use Hash
- How GPU can crack a Hash?
They contain numerous cores that can execute instructions simultaneously, making them well-suited for tasks like hashing, which involve performing the same operation on multiple inputs simultaneously.
GPUs can test a large number of password guesses(Brute force) in parallel, making them much faster at trying different combinations.
But Argon2 hash is GPU resistant.
Hashing Algorithms
Hash Algorithm | Detials | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SHA1, SHA0(broken) | Published: 1995. Input: 2128 bit. Output Hash(bits): 160 | ||||||||||||
SHA256(not broken) | Published: 2012. Input: 2128 bit. Output Hash(bits): 256 | ||||||||||||
SHA3_512(Keccak) | Published: 2015. Input: 264 bit. Output Hash(bits): 512 | ||||||||||||
MD4,MD5(broken) | Published: 2015. Input: Infinite. Output Hash(bits): 128
MD4 Implementation
|
||||||||||||
Argon2 |
How Argon2 is GPU resistant? Argon2 is a memory-hard hashing algorithm, meaning that it requires a lot of memory to be computed. Since GPU typically have less memory available compared to CPUs. As a result, even though GPUs can perform computations quickly, they may struggle with the memory requirements of Argon2. While GPUs excel at parallel computations, Argon2 is designed to require significant serial computation as well. This means that even though GPUs can try many password guesses in parallel, they may still be limited by the sequential nature of certain parts of the Argon2 algorithm. Argon2 allows for the adjustment of parameters(such as the memory cost, time cost, and parallelism degree) By appropriately configuring these parameters, it's possible to tune Argon2 to be less susceptible to GPU-based attacks
|
||||||||||||
bcrypt(based on Blowfish cipher) Output: Fixed 60 characters |
Go Code to produce bcrypt hash See everytime different hash is produced even for same password
|
MAC
(Message + Pvt Key) > |Hash function| > MAC
HMAC(Hashed MAC)
secret Key ->(XOR) <- Inner Pad Secret Key-> (XOR) <- Outer Pad
\/ \/
M1 M2
|M-1| Message | M2 |