How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (2024)

Hacker News new | past | comments | ask | show | jobs | submit login

ww520 on May 29, 2020 | parent | context | favorite | on: SHA-1 collisions now cost $45k [pdf]


How safe is SHA-256 now? Or Is SHA-512 needed in the near future?

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (2)

LeoPanthera on May 29, 2020 | next [–]


Well, there's already a SHA-512.

But none of the SHA family of hashes have ever been recommended for passwords, not because they are weak, but because they are too fast.

For other purposes, the logical successor to SHA-256/512 is SHA-3:

https://en.wikipedia.org/wiki/SHA-3

But this is far from the only choice. Hashing algorithms are trendy right now, and there's plenty to choose from.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (3)

dependenttypes on May 29, 2020 | parent | next [–]


I am not sure why you mentioned passwords. Collision attacks do not affect the use of hash functions for password hashing.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (4)

ww520 on May 29, 2020 | parent | prev | next [–]


For collision avoidance, not for cryptographic hashing.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (5)

easterncalculus on May 29, 2020 | prev | next [–]


SHA-256 is still secure for plenty of applications, but for awhile it's been regarded as a suboptimal choice for password hashing. SHA512 is probably overkill.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (6)

zenhack on May 29, 2020 | parent | next [–]


"for a while" suggests that this was ever a recommended choice, which is not the case. As others have pointed out, for password hashing you want a specialized algorithm, not a general purpose cryptographic hash function. This is true regardless of whether the hash function is "compromised;" it just wasn't designed for that application in the first place.

Algorithms designed for password hashing are intentionally both compute and memory intensive, to make guessing slower, whereas general cryptographic hash functions are by contrast intended to be fast, as most applications will want that. The idea is that password hashing algorithms should be fast enough to keep up with a human and no faster; if you already know he password the performance is not a hindrance but if you have to guess it makes doing so impractical.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (7)

easterncalculus on May 29, 2020 | root | parent | next [–]


That's a fair point, I didn't want to come off like it was ever a great choice. I definitely would argue that people are more aware now than they used to be, so thanks for clarifying that.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (8)

eadan on May 29, 2020 | parent | prev | next [–]


Not only sub-optimal, but unsuitable. Use algorithms specifically designed for password hashing: argon2 / scrypt etc.

SHA256, SHA512 and Blake* algorithms are suitable for secure checksums and HMACs, but not password hashing

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (9)

dependenttypes on May 29, 2020 | root | parent | next [–]


I disagree, I would argue that they are optimal for passwords with sufficient entropy (which includes passwords generated by a password manager)

> argon2

It uses BLAKE2 internally

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (10)

willcipriano on May 29, 2020 | root | parent | next [–]


If you have two solutions and the first solution requires humans behave in a certain manner (getting them to use high entropy passwords) and the second does not. The second is more secure.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (11)

dependenttypes on May 29, 2020 | root | parent | next [–]


I do not see how this is relevant to what I said.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (12)

willcipriano on May 29, 2020 | root | parent | next [–]


The method you purpose is less secure as humans often use low entropy passwords even when you ask them not to. If you are building a system only for humans that use high entropy passwords (are you really willing to bet the farm on that just to save a couple clock cycles) or other machines it might work but I also see no benefit to that approach so you might as well just bcrypt it and call it a day anyway.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (13)

dependenttypes on May 29, 2020 | root | parent | next [–]


I proposed no method. I simply made the statement that typical cryptographic hash functions are optimal (and better than the alternatives) for high entropy passwords. I said nothing regarding low-entropy passwords.

> I also see no benefit to that approach

- less primitives

- faster

- less memory usage

- no concern regarding cycles

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (14)

0x0 on May 29, 2020 | root | parent | prev | next [–]


Secure checksums should have high performance. Password hashing should have low performance (ie high cost).

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (15)

dependenttypes on May 29, 2020 | root | parent | next [–]


Please justify why hashing a high entropy password should have a high cost. I can't see any benefit arising from this. If anything you lose entropy if you use something like pbkdf due to cycles.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (16)

0x0 on May 29, 2020 | root | parent | next [–]


Because it slows down anyone looking to crack/reverse the passwords? The only thing protecting your high entropy password is the cost of the hash. If you could run infinite attempts in 2 seconds then even your high entropy password would fail.

Anyways, most people don't use high entropy passwords, so there's little point in arguing against this IMHO.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (17)

dependenttypes on May 29, 2020 | root | parent | next [–]


> Because it slows down anyone looking to crack/reverse the passwords?

Good luck brute-forcing through 2^256 passwords. The speed of the hash function should not matter.

If you still want a slow hash function though then just use more rounds.

> The only thing protecting your high entropy password is the cost of the hash

No, not really. It is the fact that the password is high entropy, combined with the preimage resistance of the hash.

> If you could run infinite attempts in 2 seconds then even your high entropy password would fail.

So would your pkdf.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (18)

dependenttypes on May 29, 2020 | prev [–]


Safe enough, but why not use a modern hash function instead?

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (19)

ww520 on May 29, 2020 | parent [–]


What are some of the modern hashing alternative for uniqueness? Mainly for speed, bit distribution, and collision risk while having small hash size. Not for cryptographic purpose.

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (20)

dependenttypes on May 29, 2020 | root | parent [–]


Depends on what you want to do. For hash tables and macs there is siphash. There is also Chaskey (although this is optimised for embedded systems I think).

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (21)

eadan on May 29, 2020 | root | parent [–]


Also in the super fast, but not designed to be cryptographically secure category:

xxhash (https://github.com/Cyan4973/xxHash) with 32/64 bit output. The latest version, xxh3, supports up to 128 bit output.

meow hash (https://github.com/cmuratori/meow_hash)

The recently released Blake3 which is designed to be cryptographically secure is very fast also (https://github.com/BLAKE3-team/BLAKE3)

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (22)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
How safe is SHA-256 now? Or Is SHA-512 needed in the near future? (2024)

FAQs

How safe is SHA-256 now? Or Is SHA-512 needed in the near future? ›

The choice between SHA

SHA
Secure Hash Algorithms, SHA-0 to SHA-3. Shorthand abstraction, a term presented in the 2007 book What Is Intelligence? by James R. Flynn. Sidereal hour angle, in astronomy.
https://en.wikipedia.org › wiki › Sha
-256 vs SHA-512 depends on the specific requirements of the application, the level of security needed, and the available computational resources. Both SHA-256 and SHA-512 are secure, but they differ in the internals of how they operate and the levels of security they provide.

Should I use sha512 or SHA-256? ›

SHA-2 (including SHA-256) offers a nice balance between speed and security, while SHA-512 has a larger hash size and is slower but offers higher security. Thus, when choosing between SHA-256 vs. SHA-512 algorithms, you must consider the trade-off between speed and security.

Is SHA-512 still secure? ›

Difference between SHA-3 and SHA-512

However, both are deemed secure for general use today.

Is SHA-256 still being used? ›

The secure hash algorithm with a digest size of 256 bits, or the SHA 256 algorithm, is one of the most widely used hash algorithms. While there are other variants, SHA 256 has been at the forefront of real-world applications.

Why is SHA-512 not used? ›

First, the SHA-512 hash fails to take advantage of SHA-256 acceleration instructions. Second, this implementation was found to be needlessly slow.

Is SHA512 overkill? ›

SHA-512 Weaknesses

512-bit hashes are overkill in many non-critical use cases. Requires 64-bit architecture to reach optimal performance.

What is the most secure SHA algorithm? ›

To the time of writing, SHA-256 is still the most secure hashing algorithm out there. It has never been reverse engineered and is used by many software organizations and institutions, including the U.S. government, to protect sensitive information.

Why is SHA-256 not secure? ›

I understand that sha256 is not good for hashing passwords because it's too fast, so attackers can brute-force the output of commonly used passwords. I recently used Google Ads API and other ad platforms to upload conversions. A hashed (using sha256) user email is included in the uploaded conversion.

Is SHA-256 enough for passwords? ›

SHA-256 alone is not sufficient for password storage. It requires at least the addition of a salt and a very high number of iterations.

Is SHA512 vulnerable? ›

SHA-512 is vulnerable to pre-image attacks. Two variants of SHA-512, which are SHA-512/224 and SHA-512/256, are also susceptible to collision attacks.

Is there a better algorithm than SHA-256? ›

SHA-256 is a secure algorithm and is the most widely used. It is computed with 32-bit words. SHA-512 offers better security than SHA-256, but it is not widely used as of now. It is computed with 64-bit words.

What are the cons of SHA-256? ›

Advantages and Disadvantages
AdvantagesDisadvantages
SHA-256 is a cornerstone of blockchain technology, ensuring the integrity and immutability of blocks.Being deterministic, the same input will always produce the same hash, which may lead to potential vulnerabilities in some scenarios.
3 more rows

Has SHA-256 been cracked? ›

Hashing Function Uncrackable, For Now

On the Bitcoin network, SHA256 helps to prove that the data from a transaction block has not been tampered with. It is a one-way function, meaning the output cannot be used to determine the input.

Is SHA512 still secure? ›

SHA512 or technically SHA2 is one of the most secure hash functions available today. Though there are quite a few types of attacks on SHA, none of them are completely successful. Actually, its not so easy to decrypt the output from a hash function. There are different types of attacks employed to decrypt SHA.

Is SHA512 reversible? ›

How does SHA512 Hash Calculator work? By entering the plain text in the above field, the SHA512 Hash Calculator generates 64 characters of SHA512 hash string which are not reversible. The generated SHA512 Hash will allow users to secure their important data.

Is SHA3 512 safe? ›

SHA-3 (and its variants SHA3-224, SHA3-256, SHA3-384, SHA3-512), is considered more secure than SHA-2 (SHA-224, SHA-256, SHA-384, SHA-512) for the same hash length.

Is SHA512 slower than SHA-256? ›

SHA512 eats data 512 bits at a time, while SHA256 eats it 256 bits at time. Both internally use 8 "registers", which are either 64 or 32 bits wide. Assuming you have the hardware registers to match, this would make SHA512 about twice as fast.

What is the difference between SHA-256 and SHA512 VPN? ›

Now, let's contrast SHA512 vs SHA256 in detail! SHA-256 is a secure algorithm and is the most widely used. It is computed with 32-bit words. SHA-512 offers better security than SHA-256, but it is not widely used as of now.

Is SHA512 enough? ›

From a security standpoint, no, and of course it's not fine. SHA-512 is not meant to be cryptographically secure. There is a reason things like bcrypt exist.

What is the difference between HMAC SHA-256 and 512? ›

The HMAC-SHA-256 algorithms operate on 512-bit blocks of data, while the HMAC-SHA-384 and HMAC-SHA-512 algorithms operate on 1024-bit blocks of data.

Top Articles
What's a Good ROI For Rental Property?
Is social security taxable?
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated:

Views: 5265

Rating: 4.2 / 5 (63 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.