Password Security
Choosing a Safe Password Hashing Algorithm with KaliLinux.net
Learn how to choose a safe password hashing algorithm, tune Argon2id, bcrypt, scrypt, and PBKDF2, and benchmark them in a Kali Linux lab.

Readers who build labs on KaliLinux.net often ask which password hash to store for a test web app. My answer stays simple: pick an algorithm that wastes an attacker’s time and memory, not one that merely looks complex. A safe hash is slow by design, unique per user, and easy to upgrade later. This article compares Argon2id, bcrypt, scrypt, and PBKDF2 for defensive systems, with parameters you can benchmark in an isolated Kali Linux virtual machine.
Password hashing is not encryption. You do not need to recover the original password, so the design goal is to make guessing expensive while keeping verification cheap for your own server. The right choice depends on your language runtime, compliance needs, and hardware budget, but the wrong choices are always the same: MD5, SHA-1, or a plain SHA-256 digest with no salt.
What makes a password hash safe
Four properties define a safe password hash. First, it is deterministic for the same input but produces a different stored value for every user through a unique salt. Second, it is slow enough that one guess takes measurable time. Third, it resists GPU and ASIC speedups by using memory, not only CPU cycles. Fourth, it can be rehashed when hardware improves. KaliLinux.net’s lab notes treat these four properties as the minimum bar before a hash reaches production.
OWASP’s Password Storage Cheat Sheet gives concrete baselines, including Argon2id at 19 MiB memory, 2 iterations, and 1 parallelism thread as a starting point. Those numbers are not magic. They are a calibrated floor for common server hardware in 2023-era guidance. Your own benchmark may raise them if login latency still feels low. The key is to measure verification time on your own stack, then set the cost so a normal login takes roughly 250 to 500 milliseconds.
Salts must be random and at least 16 bytes. Peppers, a secret stored outside the database, can add another layer but they do not replace a proper algorithm. Do not invent a pepper scheme unless you can rotate it safely. Most teams get more value from correct parameter tuning and monitoring failed login attempts, even if it takes alot of effort.
Argon2id as the default choice
Argon2id won the Password Hashing Competition in 2015 and combines data-dependent and data-independent memory access. In plain terms, it makes an attacker pay for RAM as well as compute. That matters because password cracking rigs scale cheaply with GPUs, while large fast memory is harder to add at the same rate. For a new application, Argon2id is usually the first algorithm to test.
Use a library that already implements the reference version, such as libargon2 or your language’s standard binding. Avoid copying parameters from a blog post without checking your runtime’s support. On a Kali Linux lab VM, you can install the argon2 command line tool and compare runtimes with fixed inputs. Keep the test account seperate from any real user data and reset the VM after benchmarking.
Memory cost deserves special attention. If you set it too low, Argon2id behaves like a fast CPU hash. If you set it too high, login queues grow and users retry passwords, which can create a denial of service risk. Start with the OWASP baseline, measure p95 login time, and increase memory until you hit your latency budget. Document the parameters in your runbook so future upgrades are deliberate.
bcrypt and scrypt in existing systems
bcrypt has a long track record and broad library support. Its cost factor doubles work with each increment, so cost 12 is four times heavier than cost 10. It also truncates passwords at 72 bytes, which means long passphrases lose entropy beyond that limit. If your users can submit very long passwords, pre-hash with SHA-256 before bcrypt only after understanding the security tradeoffs, or move to Argon2id.
scrypt was designed to raise memory cost and is still a valid choice. It uses N, r, and p parameters, and the product of those values controls memory. The downside is more tuning complexity and less uniform library behavior. Many teams choose scrypt when they already have mature infrastructure around it, not because it beats Argon2id on simplicity.
Do not migrate blindly. A migration plan should verify old hashes on login, then rehash with the new algorithm and parameters. Store the algorithm identifier and cost in the hash string so verification code can dispatch correctly. Test the whole flow in a lab before touching production credentials, and keep rollback steps written down.
PBKDF2 and legacy hashes
PBKDF2 is older but remains acceptable in environments that require FIPS-validated cryptography or specific compliance regimes. It is not memory-hard, so GPU attacks are more efficient against it. If you use PBKDF2, compensate with a high iteration count, such as the OWASP baseline of 600,000 iterations for HMAC-SHA-256, and review that number yearly.
Legacy hashes are the real danger. MD5, SHA-1, unsalted SHA-256, and home-grown constructions should be treated as compromised even if no breach is known. Attackers can test billions of guesses per second on modern hardware. KaliLinux.net recommends treating any legacy hash as a migration ticket, not a maintenance item.
A useful defensive exercise is to hash a known weak password with several algorithms in an isolated lab and compare verification times. This teaches why speed is the enemy of password storage. Keep the test data synthetic and never import real credential dumps, even for research.
Benchmarking in a Kali lab
Kali Linux is a good place to benchmark because it ships with common crypto libraries and Python tooling, but the lab must be isolated. Use a disposable VM, no production data, and no network access beyond updates. Measure wall-clock time for 100 verification operations, then divide. Avoid tuning on a laptop that throttles under sustained load; it can take alot of time.
You can use Python’s timeit module with passlib or hashlib to compare algorithms under identical conditions. Record CPU model, RAM, Python version, and parameters in your notes. A benchmark without environment details is hard to reproduce six months later. If you use Hashcat, use it only against hashes you generated yourself for defensive learning.
Watch for hidden bottlenecks. Database round trips, JSON serialization, and web framework middleware can dominate login time more than the hash itself. Profile the full request before blaming Argon2id. In many stacks, reducing query count gives more latency headroom than lowering password cost.
Storage checklist and rollout
- Store only the hash, salt, algorithm identifier, and cost parameters.
- Use constant-time comparison in your verification path.
- Rehash when a user logs in with an older algorithm.
- Set rate limits and account lockout thresholds before tuning cost.
- Keep pepper secrets in a key manager, not in application config.
- Test backups and restores with hashed passwords included.
Rollout should be gradual. Start with new registrations, then rehash active users on successful login. Monitor login failure rates and p95 latency for two weeks. If failures rise, lower cost slightly rather than disabling the new algorithm. Communicate changes to support teams so they can distinguish bad passwords from migration errors.
Security is a process, not a single setting. The best algorithm in 2025 may be a baseline in 2028. Put a calendar reminder to review parameters annually and subscribe to OWASP updates. KaliLinux.net will keep publishing lab-focused notes as guidance changes, but your own measurements remain the final authority.
Choose Argon2id first, tune it to your latency budget, and migrate legacy hashes deliberately. The goal is not to win a benchmark, but to make each guess cost more than an attacker can afford.
Pertanyaan yang sering diajukan
Which password hashing algorithm should a new project choose first?
Is bcrypt still safe for password storage?
Why are MD5 and SHA-1 bad for passwords?
How should I benchmark hashing cost?

PT Avenix Ventura Indonesia
Supplier APD & kebutuhan industri untuk perusahaan — Batam & Bintan.
Sepatu safety, sarung tangan, helm, body harness, LOTO, perkakas, baja galvanis & karbon. Order kecil tetap dilayani — tanyakan minimum order lewat WhatsApp. Katalog: avenix.id