Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6872001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:52:21+00:00 2026-05-27T03:52:21+00:00

For a fun project I want to support the SASL Mechanisms for authentication, especially

  • 0

For a fun project I want to support the SASL Mechanisms for authentication, especially PLAIN and DIGEST-MD5.

My question is: how can I store the users’ password securely if I need to support those two ways of authentication?

With only PLAIN auth it would be really easy, I just store the password with bcrypt and compare the user submitted password with the stored pw using the bcrypt_compare function.

But how can I store the password securely when also DIGEST-MD5 should be possible?
Should I store the whole calculated response and use that also for the PLAIN comparison?
Or is there some other way?

//Edit: Regarding the “fun”-project. At the moment it is a fun project but no one knows if it will be a non-fun project at some point. And I don’t want to decrease the security just because it’s a fun project..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:52:22+00:00Added an answer on May 27, 2026 at 3:52 am

    The DIGEST-MD5 specification tells you what a server needs to store for that authentication method:

    3.9 Storing passwords

    Digest authentication requires that the authenticating agent
    (usually the server) store some data derived from the user’s name
    and password in a “password file” associated with a given realm.
    Normally this might contain pairs consisting of username and H({
    username-value, ":", realm-value, ":", passwd })
    , which is
    adequate to compute H(A1) as described above without directly
    exposing the user’s password.

    …so all you need to store for DIGEST-MD5 is H({ username-value, ":", realm-value, ":", passwd }).

    You could separately store a bcrypt hash to use for PLAIN authentication, or you could just use the DIGEST-MD5 value. If you stored separate values then you could allow your users to selectively turn off DIGEST-MD5 authentication, which would allow you to remove that (easily-bruteforced) information from the database for those users.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project for fun but i want to grab just the
I am working on a little fun project(webcalender) and I want to use mongoDB.
I'm working on a fun project where I need a simple key/value store that
I want to develop simple Serverless LAN Chat program just for fun. How can
As a bit of a fun project I'm implementing a Beatnik interpreter in Ruby.
Just for fun I created a project that created about 5 GB of memory
I am currently working on Project Euler for fun, and use Haskell for practicing.
I just solved the first problem from Project Euler in JavaFX for the fun
Arg. Inheriting projects is SO much fun. Especially when they don't work well, and
Just for fun, how close can we get to debug an application in C#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.