Hash functions - Blake2 Edition

Let's discuss pic related.

> What is it good for?
> How does it compare to other hash functions e.g. keccak
> Why haven't u used it in your own projects yet?

Attached: 1557333333796.png (280x280, 8K)

Other urls found in this thread:

youtube.com/watch?v=IUI5C9stAEM
github.com/zcash/zcash/issues/706
youtube.com/watch?v=U-mAGTDBitU
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.55.5265&rep=rep1&type=pdf
en.wikipedia.org/wiki/NIST_hash_function_competition
twitter.com/SFWRedditGifs

> What is it good for?
for hashing things
> How does it compare to other hash functions e.g. keccak
faster, support for keying/salting. based on djb's chacha20 which has lots of crypto-analysis and great design behind it (plus I'm obsessed by djb)
iirc it should also support some hashing of parts of input and then merging those into final hash (which should be equivalent to hashing it all at once) and thus enable more parallelism/distribution, but nobody bothers to implement it in libraries as it's not in high demand and adds to implementation complexity.
> Why haven't u used it in your own projects yet?
I do
there is pretty much no reason to use SHA over BLAKE2

Are you trying to sell me something user? Did you make BLAKE2? Will I be cool if I use BLAKE2?

I'm still confused about the whole NIST fiasco. Blake was a candidate but too close to SHA2, which still isn't any less safe apparently. So is Blake2 closer to SHA3 now?

Na just trying to confirm my choice of a hash function for my project. We've been using keccak for a while but we plan to design a new scheme. Blake2 seems to cover all our bases but I'm certainly no expert

BLAKE was competing for SHA3 and made it to finals.
maybe watch BLAKE2 creator's video on SHA3, he mentions what was a motivation for the new competition (there was an attack on MD5 and SHA1, which might be applied to SHA2 some day)
youtube.com/watch?v=IUI5C9stAEM
so BLAKE was already good, and BLAKE2 was redesigned (thanks to those 4 years of extensive performance and security analysis) to be even faster, replace HMAC, be more parallel, exploit SIMD capabilities of modern hardware better etc.
I'm pretty positive that it would win the SHA3 competition now.

quality post right there. I'll watch through it

For the sake of the discussion, I'm referencing to this debate on SHA3/keccak vs Blake2
github.com/zcash/zcash/issues/706

Imo they made a very interesting point about the political bias of NIST/NSA. Furthermore, quantum resistance might play a role in the decisions that have been made.

I think I'll uniformly use Blake2 across the whole project. Can't spot a single downside so far.

djb and collective he cooperates with is more trustworty than NIST, not even kidding. although his crypto stack isn't complete. BLAKE2 is kinda third party, but is based on ChaCha20 and authors cooperating - djb and Jean-Philippe co-created SipHash
>political bias of NIST/NSA
maybe funny points on crypto standardization: youtube.com/watch?v=U-mAGTDBitU
>Furthermore, quantum resistance might play a role
hashing is not known to be affected

the only downside is lack of hardware implementations, same goes for chacha20 vs AES. this might matter to cryptocurrency systems as ASIC designs require some additional research.

> maybe funny points on crypto standardization: [YouTube] [AWACS 2016] Standards for the black hat- Daniel J. Bernstein (embed)
That's just fucked up and will get you van'ed real quick. That being said, I agree.

> hashing is not known to be affected
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.55.5265&rep=rep1&type=pdf

this paper has already been challenged but if it's true it would reduce time and/or costs for a quantum adversary to about a third.

cryptocurrencies supporting ASIC's should all hang anyway imo. I'm more for a fair distribution of hash rate.

What a load of shit. Why not just use keccak or sha3, nobody will switch to your zoomer shit unless these two are broken. The first rule of crypto, that is don’t roll your own algo.

Broken hash functions would be the most painful to migrate from, just imagine rehashing all the pass hashes you have in your db.

Also I can’t imagine why would you use anything aside of one time pad, pen and paper, it’s the golden standard, anything else is zoomed and cringe.

> What a load of shit. Why not just use keccak or sha3, nobody will switch to your zoomer shit unless these two are broken. The first rule of crypto, that is don’t roll your own algo.
First of all, I'm still so confused about SHA3/keccak. According to wiki SHA3 is a subset of keccak. Therefor SHA3 = keccak? Someone really needs to clear that up

I'm not rolling my own hash function, just trying to optimize the previous algorithm to current standards. Right now Blake2 seems to be the hottest shit around and apparently has undergone more research than keccak. So why not?

SHA3 is standard based on a competition of various hash functions. it happened between 2008 and 2012 during which the competing hash functions were analyzed, observed, improved, etc. lots of public effort was involved.
Kekkac, BLAKE and three more made it to the final round. Kekkac won the SHA3 competition and thus was decided to become SHA3. thus yes, Kekkac == SHA3.
see en.wikipedia.org/wiki/NIST_hash_function_competition
same story with AES (originally Rijndael)

> Kekkac == SHA3.
Thank you so much user. Should be wiki headline tbqh

the "subset" here might means that it also decided on parameters such as number of rounds, block sizes, etc. there can be lots of variables and configurations

>people still using hass functions
Fucking plebs
I hope you at least protect your algorithms and code from collisions

cope maor

Attached: pigeonhole-principle.jpg (768x661, 68K)

Not an argument.
I have seen very bad practices when using hash functions.
People make programs for today, not for tomorrow or the next year.

capacity and output size would be the next step. I'm on it.

why not give us a quick rundown on proper hash function usage user? would love to get the H(BoggPill)

Attached: 1553533913835.png (785x720, 577K)

>I hope you at least protect your algorithms and code from collisions
The probability of a collision occurring is so staggeringly low with digests over 200 bits as to be entirely negligible. If you randomly guess 1.52 * 10^35 256-digests, there's a 1 in 100 million chance of a collision. It's not even worth considering at that point.

kek
ever heard of hash table? literally every map, struct or whatever shit you are using is implemented using hash table, it is a golden standard decades-old datatype.

why should I care how fast my hashing function is? shouldn't I be targetting a slow enough speed that hashes will not be cracked?

depends on usecase, key derivation hash functions exist
taken from BLAKE2's FAQ
>Q: Why do you want BLAKE2 to be fast? Aren't fast hashes bad?
>A: You want your hash function to be fast if you are using it to compute the secure hash of a large amount of data, such as in distributed filesystems (e.g. Tahoe-LAFS), cloud storage systems (e.g. OpenStack Swift), intrusion detection systems (e.g. Samhain), integrity-checking local filesystems (e.g. ZFS), peer-to-peer file-sharing tools (e.g. BitTorrent), or version control systems (e.g. git). You only want your hash function to be slow if you're using it to "stretch" user-supplied passwords, in which case see the next question.
>Q: So I shouldn't use BLAKE2 for hashing user passwords?
>A: You shouldn't use *any* general-purpose hash function for user passwords, not BLAKE2, and not MD5, SHA-1, SHA-256, or SHA-3. Instead you should use a password hashing function such as the PHC winner Argon2 with appropriate time and memory cost parameters, to mitigate the risk of bruteforce attacks—Argon2's core uses a variant of BLAKE2's permutation.

So what does the hash function look like?
I mean its just a function, write down the formula faggot

FUNCTION G( v[0..15], a, b, c, d, x, y )
| v[a] := (v[a] + v[b] + x) mod 2**w
| v[d] := (v[d] ^ v[a]) >>> R1
| v[c] := (v[c] + v[d]) mod 2**w
| v[b] := (v[b] ^ v[c]) >>> R2
| v[a] := (v[a] + v[b] + y) mod 2**w
| v[d] := (v[d] ^ v[a]) >>> R3
| v[c] := (v[c] + v[d]) mod 2**w
| v[b] := (v[b] ^ v[c]) >>> R4
| RETURN v[0..15]
END FUNCTION.

FUNCTION F( h[0..7], m[0..15], t, f )
| v[0..7] := h[0..7]
| v[8..15] := IV[0..7]
|
| v[12] := v[12] ^ (t mod 2**w)
| v[13] := v[13] ^ (t >> w)
|
| IF f = TRUE THEN
| | v[14] := v[14] ^ 0xFF..FF
| END IF.
|
| FOR i = 0 TO r - 1 DO
| | s[0..15] := SIGMA[i mod 10][0..15]
| |
| | v := G( v, 0, 4, 8, 12, m[s[ 0]], m[s[ 1]] )
| | v := G( v, 1, 5, 9, 13, m[s[ 2]], m[s[ 3]] )
| | v := G( v, 2, 6, 10, 14, m[s[ 4]], m[s[ 5]] )
| | v := G( v, 3, 7, 11, 15, m[s[ 6]], m[s[ 7]] )
| |
| | v := G( v, 0, 5, 10, 15, m[s[ 8]], m[s[ 9]] )
| | v := G( v, 1, 6, 11, 12, m[s[10]], m[s[11]] )
| | v := G( v, 2, 7, 8, 13, m[s[12]], m[s[13]] )
| | v := G( v, 3, 4, 9, 14, m[s[14]], m[s[15]] )
| END FOR
|
| FOR i = 0 TO 7 DO
| | h[i] := h[i] ^ v[i] ^ v[i + 8]
| END FOR.
|
| RETURN h[0..7]
END FUNCTION.

FUNCTION BLAKE2( d[0..dd-1], ll, kk, nn )
| h[0..7] := IV[0..7]
|
| h[0] := h[0] ^ 0x01010000 ^ (kk 1 THEN
| | FOR i = 0 TO dd - 2 DO
| | | h := F( h, d[i], (i + 1) * bb, FALSE )
| | END FOR.
| END IF.
|
| IF kk = 0 THEN
| | h := F( h, d[dd - 1], ll, TRUE )
| ELSE
| | h := F( h, d[dd - 1], ll + bb, TRUE )
| END IF.
|
| RETURN first "nn" bytes from little-endian word array h[].
END FUNCTION.

outplayed

Blowfish is the GOAT for password hashing

SHA-512 is good enough and supported everywhere. I hope that changes, but for now, it's a safer bet.

how is everything Schneier produced such trash?