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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:40:30+00:00 2026-05-26T17:40:30+00:00

It seems that for a while , the login utility on Unix systems only

  • 0

It seems that for a while, the login utility on Unix systems only calculated a hash when a valid username existed; this opened a security flaw which allowed for a timing attack, as the user could tell when a username was found by the amount of time it required to generate hashed key for comparison.

This makes sense for desktop applications, but would it make sense for web applications too? I’d lean toward doing it, but is this kind of fix necessary?

For example, in a Django auth module:

class MyBackend(ModelBackend):

    def authenticate(self, email=None, password=None):
        try:
            user = User.objects.get(email=email)
            return user if user.check_password(password) else None
        except User.DoesNotExist:
            User().check_password(password) # is this line necessary?
            return None

Would the additional hash computation make sense for this scenario? If I employ rate-limiting on auth calls, does this decrease the possibility of a timing attack like this?

  • 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-26T17:40:31+00:00Added an answer on May 26, 2026 at 5:40 pm

    The original timing attack, the Tenex attack, had nothing to do with hashing — it worked by positioning the password so that it crossed page boundaries leading to a virtual memory cache miss. The attacker could try a series passwords positioned so that only the first character was in the first page, and it would know that the first character matched when verification took long enough for a cache miss to have happened. The attacker could repeat that for each character in the password.

    Unless the attacker has control over fine-grained positioning of inputs in memory, no, timing attacks on passwords are not an issue, but any secret checking algo that is super-linear w.r.t. the length of the secret (>= O(length of secret)) might leak information about the password length.

    If you are careful to compare all characters in the password regardless of success, then you also defeat the attack:

    boolean match = true;
    for (int i = 0; i < min(salted_from_db_length, salted_from_user_length); ++i) {
      if (salted_from_db[i] != salted_from_user[i]) {
        match = false;
        //break;  // Stopping early leaks info.
      }
    }
    match = salted_from_db_length == salted_from_user_length && match;
    

    You should have tests that make sure that compiler optimizations don’t put timing vulnerabilities back into your code.

    Note, the term “timing attack” is also used in other contexts, and those can affect web applications. For example when a system clock is used to construct a covert channel between two processes that should not be able to conspire — javascript loaded in two different origins could establish a low bandwidth channel by using an interval to check the time and looping to consume processor or not to communicate a bit.

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

Sidebar

Related Questions

It seems that while I strive to maintain OO principles, it all seems so
It seems that calling a P-Invoke while the App is not completed loaded make
Seems that requirements on safety do not seem to like systems that use AI
Seems that even after unchecking the option in the PyDev/Debug preferenecs pane to launch
It seems that a List object cannot be stored in a List variable in
It seems that it is impossible to capture the keyboard event normally used for
It seems that Silverlight/WPF are the long term future for user interface development with
It seems that most of the installers for Perl are centered around installing Perl
It seems that anyone can snoop on incoming/outgoing .NET web service SOAP messages just
It seems that C# 3 hit me without me even noticing, could you guys

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.