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 8273689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:33:00+00:00 2026-06-08T07:33:00+00:00

And I need to secure some area’s on my web store for admin use.

  • 0

And I need to secure some area’s on my web store for admin use.
The problem is the authentication of the user: the salt + hash is failing.

This is my code for creating a password (using PHP5.x):

$salt = rand(0, 999999999999);<br>
$passEncr = sha1($pass1 + $salt);

This variable $passEncr is inserted into the database together with its salt.

At the login page I’ve got the following check:

$password = $_POST['password']; // hash+salt in the database

$storedSalt = $row['salt']; // salt from database<br>
if (sha1($password + $storedSalt) == $row['password']) 

Now the problem I’m experiencing is that some hashes appear to be the same.
If I try to log in with an alphanumeric password, I succeed, no matter what the content of that password is.
Full login check here: http://pastebin.com/WjVnQ4aF

Can someone please explain what I’m doing wrong?

  • 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-08T07:33:01+00:00Added an answer on June 8, 2026 at 7:33 am

    Well, SQL injection, using SHA for passwords instead of bcrypt are the first things I see, not using OpenId so you can get out of the business of storing passwords is another.

    As for the passwords being the same, I would check the database — see what you are storing, that will tell you where your problem lies.

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

Sidebar

Related Questions

I have a user login/reg system with a user management admin area. Just some
I need to implement for current project some secure login in php. I wrote
We need to secure a multi-langual web application with SSL (registration, login,..). However, this
We need to design a secure web application. I would like to propose a
I need to implement Gutmann 's algorithm for secure erasing some data in a
In my application i want to store some secure data by encrypting it. When
I need to create some simple form that will be use to registration a
Is there some sort of built-in authentication in WCF? I need to expose a
I have a website that requires some secure pages for logging in, user accounts,
I need to quickly wrap some security around an existing ASP.Net 2.0 web app.

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.