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

  • Home
  • SEARCH
  • 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 8570721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:37:20+00:00 2026-06-11T18:37:20+00:00

I want to authenticate users for a folder from a MySQL 5.1 database with

  • 0

I want to authenticate users for a folder from a MySQL 5.1 database with AuthType Basic.
The passwords are stored in plain text (they are not really passwords, so doesn’t matter).
The password format for apache however only allows for SHA1, MD5 on Linux systems as described here.

How could I generate the right format with an SQL query ? Seems like apache format is a binary format with a lenght of 20, but the mysql SHA1 function return 40 long.

My SQL query is something like this:

SELECT CONCAT('{SHA}', BASE64_ENCODE(SHA1(access_key))) FROM user_access_keys INNER JOIN users ON user_access_keys.user_id = users.id WHERE name = %s

where base64_encode is a stored function (Mysql 5.1 doesn’t have TO_BASE64 yet). This query returns a 61 byte BLOB which is not the same format that apache uses. How could I generate the same format ?

You can suggest other method for this too. The point is that I want to authenticate users from a MySQL5.1 database using plain text as password.

  • 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-06-11T18:37:21+00:00Added an answer on June 11, 2026 at 6:37 pm

    The document you refer to does not mean to imply non-Linux by “Unix-only”, therefore crypt() is available to you. Since you seem unconcerned about security I’d suggest this is the easiest option alongside MySQL’s encrypt function. You may want to use a constant seed value in your queries.

    SELECT ENCRYPT(access_key, 'SA') FROM user_access_keys INNER JOIN users ON user_access_keys.user_id = users.id WHERE name = %s
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using FOSUserBundle to authenticate users from database and now I want add authentication
string emailfield=txtEmail.Text.ToString(); string url = http://localhost:3076/user/Authenticate-Users.aspx?email=+emailfield; I want to encrypt the querystring and then
I want to authenticate users against our AD so I understand that I need
i want to authenticate users using firstname and lastname This is the code i
I have an application in which I want to authenticate a user from a
I'm looking to build a RESTful API in node.js and want to authenticate users
I want to use devise' token_authenticatable helper to authenticate users against the system. I
We have an application that uses Windows authentication to authenticate users with the database,
I want to use facebook graph api to authenticate users on my webapp which
I want to access a shared mailbox (NOT FOLDER) via Javamail API (1.4.5) using

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.