Revisiting Password-Based Login

12/06/2024 09:38:49


Passwords have been a cornerstone of online security for decades, and they're not without their flaws. In this article we’ll explore how to make them as secure as possible.

Where Password Systems Often Fail

Traditional password systems often rely on methodologies that expose users to risks. Consider these common issues:

A Secure Login Architecture

At Homebase, we’ve engineered an approach to password-based login that integrates modern cryptographic practices while addressing common security pitfalls. Here’s a detailed technical walk-through of how it works:

The Homebase Password Login process is structured to prioritize security at every step. Here’s a high-level overview of how it works:

  • Request a Nonce: The client begins by requesting a Random Nonce Package from the host over HTTPS. Since the user-name is the domain we know for certain that we’re talking with the right host.
  • Calculate and Send Password Reply: Using the nonce from the host and user password entered in the browser, the browser calculates a secure password reply and sends it back to the host.
  • Validate and Authenticate: The host validates the reply, decrypts the reply, and securely establishes the session.
  • Step 1: The Random Nonce Package

    When the Homebase owner client requests a login, the host generates a Nonce Package. This data is used subsequently in step 2 and contains the following components:

    Field Type Description

    Nonce64 string A base64-encoded string of 16 random bytes for the client to use in calculations.

    SaltPassword64 string A base64-encoded salt for password hashing.

    SaltKek64 string A base64-encoded salt for deriving the Key Encryption Key (KEK).

    PublicJwk string The host’s ECC-384 public key in JWK (JSON Web Key) format.

    CRC uint32 A CRC32C checksum of the public JWK to ensure key integrity.

    This nonce package ensures every login attempt is unique, preventing replay attacks.

    Step 2: Calculating the Password Reply

    Using the password entered by the user and the nonce package, the client calculates a Password Reply. This reply includes the following:

    Field Type Description

    Nonce64 string The original nonce from the server.

    NonceHashedPassword64 string A nonce-hardened hash of the salted password.

    PublicKeyJwk string The client’s ECC-384 public key for secure communication.

    CRC uint32 The CRC32C checksum of the server’s public JWK.

    GcmEncrypted64 string A GCM-encrypted payload containing:

    - Hashed Password: Derived using PBKDF2 and SaltPassword64.

    - Key Encryption Key (KEK): Derived using PBKDF2 and SaltKek64.

    - Secret: A unique random value for secure session management.

    The reply is securely encrypted using the host’s (verified) ECC public key, ensuring confidentiality and integrity. Hereafter the reply is sent over HTTPS to the host.

    Step 3: Host Validation and Session Establishment

    When the host receives the password reply, it validates and processes the data:

  • Nonce Validation: The host computes the expected NonceHashedPassword64 and compares it with the received value. A mismatch means login failure.
  • Payload Decryption: Using ECC and AES-GCM, the host decrypts the GcmEncrypted64 payload and derives the KEK.
  • Session Establishment: If validation succeeds, the host issues:
  • This approach ensures robust session security, even if a single layer is compromised.

    Beyond Passwords: Tackling Common User Issues

    We’ve also addressed usability concerns that plague traditional systems:

    Tokens: A Versatile Mechanism

    Session tokens are at the heart of Homebase’s communication. These tokens encapsulate:

    This tokenized approach extends seamlessly to:

    The Future of Password-Based Login

    While passwords remain a necessity for now, the Homebase architecture paves the way for a password-less future via the YouAuth protocol. With advanced cryptographic techniques, thoughtful user experience design, and robust tokenization, we’re redefining what password-based login can achieve in the long run. This means that in Homebase you don’t need to enter your password when logging into chat, photos, etc. because all these logins happen via YouAuth. You only need to use your password when logging in to the owner-console.

    The next time you log in, know that your security is our top priority.


    See More (10 posts)