Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ How Password Hashing Algorithms Work and Why You Never Ever Write Your Own

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š How Password Hashing Algorithms Work and Why You Never Ever Write Your Own


๐Ÿ’ก Newskategorie: IT Security Nachrichten
๐Ÿ”— Quelle: veracode.com

Are you fascinated with cryptography? You're not alone: a lot of engineers are. Occasionally, some of them decide to go as far as to write their own custom cryptographic hash functions and use them in real-world applications. While understandably enticing, doing so breaks the number 1 rule of the security community:??๏ฝฏdon't write your own crypto.๏พ‚?

How do hashing algorithms work and what's special about password hashing? What does it take for an algorithm to get ready for widespread production use? Is security through obscurity a good idea? Let's see.๏พ‚?

How does password hashing work?๏พ‚?

Before storing a user's password in your application's database, you're supposed to apply a cryptographic hash function to it. (You're not storing passwords in plain text, right? Good. Just asking.)๏พ‚?

Any cryptographic hash function converts an arbitrary-length input (a.k.a. "message") into a fixed-length output (a.k.a. "hash", "message digest"). A??๏ฝฏsecure cryptographic hash function??๏ฝฏmust be:๏พ‚?

  • Deterministic: hashing the same input should always render the same output.๏พ‚?
  • One-way: generating an input message based on a given output should be infeasible.๏พ‚?
  • Collision-resistant: finding two input messages that hash to the same output should also be infeasible.๏พ‚?
  • Highly randomized: a small change in input should lead to a significant and uncorrelated change in output (a.k.a. "the avalanche effect"). Without this property, applying cryptoanalysis methods will allow making predictions about the input based on the output.๏พ‚?

Now, there's general cryptographic hashing, and then there's password hashing that is somewhat special.๏พ‚?

Standard cryptographic hash functions are designed to be fast, and when you're hashing passwords, it becomes a problem.??๏ฝฏPassword hashing must be slow.??๏ฝฏYou want to make it as hard as possible for the attacker to apply brute force attacks to passwords in your database should it ever leak. This is why you want to make passwords hashing computationally expensive. How expensive? Well, it's a tradeoff between convenience for your legitimate users when they validate their passwords and making brute-force attacks hard for the attacker.๏พ‚?

To make hashing computationally expensive, a special kind of functions is commonly used:??๏ฝฏkey derivation functions??๏ฝฏ(KDFs). Under the hood, KDFs invoke hashing functions, but they add a random salt before hashing, and then apply numerous (usually thousands or tens of thousands) iterations of hashing. Ideally, they make brute force attacks both CPU-intensive and memory-intensive.๏พ‚?

A key derivation function produces a derived key from a base key and other parameters. In a password-based key derivation function, the base key is a password and the other parameters are a salt value and an iteration count๏พ‚?(RFC 2898: Password-Based Cryptography Specification Version 2.0).

In password hashing discussions, the terms "hash function" (such as MD5 or SHA-1) and "key derivation function" (such as PBKDF2 or Argon2) are often used interchangeably although they're technically not the same.๏พ‚?

Why shouldn't you write your own password hashing algorithm?๏พ‚?

Both writing a custom hashing algorithm and creating your own implementation of a well-known algorithm are bad ideas. Why?๏พ‚?

You probably don't have the skills. Let's face it: cryptography is hard, and messing up an algorithm or implementation is easy, even for professionals. Should you go for creating your own password hashing, some of the things you'd need to take care of include:๏พ‚?

  • Ensuring??๏ฝฏpre-image resistance??๏ฝฏto prevent calculating the input based on the hash output.๏พ‚?
  • Ensuring??๏ฝฏhigh collision resistance??๏ฝฏto prevent finding two inputs that hash to the same output.๏พ‚?
  • Randomization and the??๏ฝฏavalanche effect??๏ฝฏto make sure attackers can't easily find hashing patterns and correlations between the input and the output.๏พ‚?
  • Resilience to a wide array of๏พ‚?side-channel attacks??๏ฝฏ(that is, attacks based on algorithm implementation details and examining the physical effects caused by invoking the implementation), such as timing attacks and cache attacks.๏พ‚?
  • Minimizing any efficiency gains attainable by attackers through the use of??๏ฝฏcracking-optimized hardware??๏ฝฏsuch as ASIC, FPGA, and GPUs.๏พ‚?

This is a lot on your plate - even more so given that??๏ฝฏyou won't have access to qualified testers??๏ฝฏfrom the cryptography community to help you find (inevitable) vulnerabilities.๏พ‚?

You'll likely want to depend on secrecy and obscurity??๏ฝฏby keeping your algorithm private. Doing so breaks the fundamental doctrine of cryptography known as the๏พ‚?Kerckhoff's๏พ‚?principle:??๏ฝฏ"a cryptosystem should be secure even if everything about the๏พ‚?system, except the key, is public knowledge."??๏ฝฏSecurity by obscurity can provide a short-term advantage but relying on it long-term is a bad practice:๏พ‚?

  • Hiding vulnerabilities prevents revealing and repairing them as part of an open๏พ‚?discussion and๏พ‚?increases the probability of exploits.๏พ‚?
  • If your password database ever leaks, there's a good chance that the source code of your application will leak along with it, and as soon as your untested algorithm becomes known to the attacker, they'll have an easy time cracking it.๏พ‚?

You'll put sensitive user data at risk. Leaking sensitive user data is one of the worst things that can happen to a business. This is something that instantly undermines trust, turns customers away, and is very expensive to remediate. Some companies and lots of developers are prone to the Not Invented Here fallacy, but password hashing is probably the worst thing you can choose to re-implement.๏พ‚?

Most importantly,??๏ฝฏyou won't know when your algorithm gets broken.๏พ‚?

Established algorithms and implementations benefit from??๏ฝฏyears of testing and polishing??๏ฝฏby large communities of cryptography experts who help reveal and fix vulnerabilities without any malicious intent.๏พ‚?

Since your own algorithm and/or implementation won't be available to anyone with a good will, attackers will be the only category of people willing to crack it. Once they do that, they won't give you a heads-up;๏พ‚?you'll only know when sensitive data of your users is๏พ‚?compromised,๏พ‚?and your business is in serious trouble.๏พ‚?

But what if you??๏ฝฏreally??๏ฝฏwant to level up your cryptography and learn by doing?๏พ‚?

That's great! Go forward and practice. Read reference implementations of existing algorithms, play with your own implementations, reach out to the community for advice, and have a great time learning something new and exciting!๏พ‚?

Just don't use whatever you've written in your production applications.๏พ‚?

To learn more, read our vulnerability decoder on insecure crypto.๏พ‚?

...



๐Ÿ“Œ How Password Hashing Algorithms Work and Why You Never Ever Write Your Own


๐Ÿ“ˆ 97.61 Punkte

๐Ÿ“Œ Telling the Truth About Defects in Technology Should Never, Ever, Ever Be Illegal. EVER.


๐Ÿ“ˆ 39.11 Punkte

๐Ÿ“Œ Hashing a file vs hashing its content


๐Ÿ“ˆ 36.89 Punkte

๐Ÿ“Œ HashPump - A Tool To Exploit The Hash Length Extension Attack In Various Hashing Algorithms


๐Ÿ“ˆ 32.14 Punkte

๐Ÿ“Œ HashPump- A Tool To Exploit The Hash Length Extension Attack in Various Hashing Algorithms


๐Ÿ“ˆ 32.14 Punkte

๐Ÿ“Œ Donโ€™t Get Salted: A Beginnerโ€™s Guide to Hashing Algorithms


๐Ÿ“ˆ 32.14 Punkte

๐Ÿ“Œ Ipa up to 4.8.0 Password Hashing Long Password resource consumption


๐Ÿ“ˆ 30.5 Punkte

๐Ÿ“Œ Lifetime Windows user, switched to Ubuntu for my first ever build, never ever going back!


๐Ÿ“ˆ 29.78 Punkte

๐Ÿ“Œ Hashing Password And Generating User Token In Your Schema


๐Ÿ“ˆ 29.75 Punkte

๐Ÿ“Œ Microsoft wants to let you dub videos using your own voice in your own language, new patent reveals


๐Ÿ“ˆ 28.7 Punkte

๐Ÿ“Œ How you can create your own custom chatbot with your own custom data using Google Gemini API all for free


๐Ÿ“ˆ 28.7 Punkte

๐Ÿ“Œ Do you use bcrypt or other 3rd-party npm packages when hashing user password?


๐Ÿ“ˆ 28.42 Punkte

๐Ÿ“Œ Huawei releases it's own desktop PC with their own OS based on Linux and their own ARM CPU.


๐Ÿ“ˆ 28.42 Punkte

๐Ÿ“Œ Why do you personally use Linux, and if you switched to it for your personal/home computer why did you switch.


๐Ÿ“ˆ 28.39 Punkte

๐Ÿ“Œ Admit It: You Have a Box of Cords You'll Never, Ever Use Again


๐Ÿ“ˆ 28.34 Punkte

๐Ÿ“Œ Algorithms 101: How to use graph algorithms


๐Ÿ“ˆ 27.4 Punkte

๐Ÿ“Œ Why you can trust Dashlane password management: Never breached, always secure


๐Ÿ“ˆ 26.73 Punkte

๐Ÿ“Œ When, how, why did you start your Linux journey? How did you discover Linux, what had drawn you to it, and what's keeping you there now?


๐Ÿ“ˆ 26.71 Punkte

๐Ÿ“Œ Python Secure Password Management: Hashing and Encryption #๏ธโƒฃ๐Ÿ”โœจ


๐Ÿ“ˆ 26.26 Punkte

๐Ÿ“Œ Changes to default password hashing algorithm and umask settings


๐Ÿ“ˆ 26.26 Punkte

๐Ÿ“Œ [Unstable Update] Changes to default password hashing algorithm and umask settings


๐Ÿ“ˆ 26.26 Punkte

๐Ÿ“Œ Secure Password Hashing in Java: Best Practices and Code Examples


๐Ÿ“ˆ 26.26 Punkte

๐Ÿ“Œ Why I Will Never Use Alpine Linux Ever Again


๐Ÿ“ˆ 26.08 Punkte

๐Ÿ“Œ Sure, you can implement your own cryptographic service provider for a standard algorithm, but why would you?


๐Ÿ“ˆ 25.9 Punkte











matomo