Choosing Parameters - argon2-cffi 23.1.0 documentation (2024)

Back to top

Toggle table of contents sidebar

Note

You can probably just use argon2.PasswordHasher with its default values and be fine.But it’s good to double check using argon2-cffi’s CLI client, whether its defaults are too slow or too fast for your use case.

Finding the right parameters for a password hashing algorithm is a daunting task.As of September 2021, we have the official Internet standard RFC 9106 to help use with it.

It comes with two recommendations in section 4, that (as of argon2-cffi 21.2.0) you can load directly from the argon2.profiles module: argon2.profiles.RFC_9106_HIGH_MEMORY (called “FIRST RECOMMENDED”) and argon2.profiles.RFC_9106_LOW_MEMORY (“SECOND RECOMMENDED”) into argon2.PasswordHasher.from_parameters().

Please use the CLI interface together with its --profile argument to see if they work for you.

If you need finer tuning, the current recommended best practice is as follow:

  1. Choose whether you want Argon2i, Argon2d, or Argon2id (type).If you don’t know what that means, choose Argon2id (argon2.low_level.Type.ID).

  2. Figure out how many threads can be used on each call to Argon2 (parallelism, called “lanes” in the RFC).They recommend 4 threads.

  3. Figure out how much memory each call can afford (memory_cost).The APIs use Kibibytes (1024 bytes) as base unit.

  4. Select the salt length.16 bytes is sufficient for all applications, but can be reduced to 8 bytes in the case of space constraints.

  5. Choose a hash length (hash_len, called “tag length” in the documentation).16 bytes is sufficient for password verification.

  6. Figure out how long each call can take.One recommendation for concurrent user logins is to keep it under 0.5 ms.The RFC used to recommend under 500 ms.The truth is somewhere between those two values: more is more secure, less is a better user experience.argon2-cffi’s current defaults land with ~50ms somewhere in the middle, but the actual time depends on your hardware.

    Please note though, that even a verification time of 1 second won’t protect you against bad passwords from the “top 10,000 passwords” lists that you can find online.

  7. Measure the time for hashing using your chosen parameters.Start with time_cost=1 and measure the time it takes.Raise time_cost until it is within your accounted time.If time_cost=1 takes too long, lower memory_cost.

argon2-cffi’s CLI will help you with this process.

Note

Alternatively, you can also refer to the OWASP cheatsheet.

Choosing Parameters - argon2-cffi 23.1.0 documentation (2024)
Top Articles
Is Pet Insurance Worth It & How Does It Work?
How to find a pet insurance policy | CHOICE
Elleypoint
Overton Funeral Home Waterloo Iowa
Cold Air Intake - High-flow, Roto-mold Tube - TOYOTA TACOMA V6-4.0
Brady Hughes Justified
Mrh Forum
Affidea ExpressCare - Affidea Ireland
Senior Tax Analyst Vs Master Tax Advisor
Craigslist Kennewick Pasco Richland
Sprague Brook Park Camping Reservations
Arrests reported by Yuba County Sheriff
Craigslistdaytona
Med First James City
No Strings Attached 123Movies
Leeks — A Dirty Little Secret (Ingredient)
Las 12 mejores subastas de carros en Los Ángeles, California - Gossip Vehiculos
Aspen Mobile Login Help
[Cheryll Glotfelty, Harold Fromm] The Ecocriticism(z-lib.org)
Terry Bradshaw | Biography, Stats, & Facts
St Clair County Mi Mugshots
Xfinity Outage Map Fredericksburg Va
Gazette Obituary Colorado Springs
Www.craigslist.com Austin Tx
Macu Heloc Rate
Beaufort 72 Hour
Papa Johns Mear Me
Paris Immobilier - craigslist
Bidrl.com Visalia
O'reilly's In Monroe Georgia
Tom Thumb Direct2Hr
The Procurement Acronyms And Abbreviations That You Need To Know Short Forms Used In Procurement
Ehome America Coupon Code
Plasma Donation Racine Wi
How Do Netspend Cards Work?
Aid Office On 59Th Ashland
Fridley Tsa Precheck
Culver's Hartland Flavor Of The Day
Eleceed Mangaowl
Timberwolves Point Guard History
Shane Gillis’s Fall and Rise
11526 Lake Ave Cleveland Oh 44102
Emulating Web Browser in a Dedicated Intermediary Box
Ucsc Sip 2023 College Confidential
Academic Notice and Subject to Dismissal
Hdmovie2 Sbs
Barback Salary in 2024: Comprehensive Guide | OysterLink
Tommy Gold Lpsg
7 Sites to Identify the Owner of a Phone Number
Emmi-Sellers
Latest Posts
Article information

Author: Francesca Jacobs Ret

Last Updated:

Views: 5450

Rating: 4.8 / 5 (48 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Francesca Jacobs Ret

Birthday: 1996-12-09

Address: Apt. 141 1406 Mitch Summit, New Teganshire, UT 82655-0699

Phone: +2296092334654

Job: Technology Architect

Hobby: Snowboarding, Scouting, Foreign language learning, Dowsing, Baton twirling, Sculpting, Cabaret

Introduction: My name is Francesca Jacobs Ret, I am a innocent, super, beautiful, charming, lucky, gentle, clever person who loves writing and wants to share my knowledge and understanding with you.