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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:41:10+00:00 2026-06-17T09:41:10+00:00

When using Laravel’s Hash::make() method (i.e. bcrypt): is there a maximum input length for

  • 0

When using Laravel’s Hash::make() method (i.e. bcrypt):

  • is there a maximum input length for the secret?
  • what happens if this length is exceeded?
  • does the returned value always have the same length?

I want to know if a password field in a user registration form should be validated against a maximum length or not. The form is handled like this:

public function action_register()
{
    $rules = array(
        'username' => 'required',
        'password' => 'required|min:10'
    );

    $validation = Validator::make(Input::all(), $rules);

    if($validation->passes())
    {
        $user = new User;
        $user->name = Input::get('name');
        $user->password = Input::get('password');
        $user->save();
        //todo - report success
    }
    else
    {
        //todo - report errors
    }
}
  • 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-17T09:41:11+00:00Added an answer on June 17, 2026 at 9:41 am

    A hash algorithm can take a variable of any length (or type — it doesn’t even have to be a string), and outputs a computed “hash” of that variable.

    Apart from passwords, another common use for hashes is to provide a verification key for a downloadable file — ie “here’s the download link, and here’s a hash value for the file so you can prove that the copy you receive hasn’t been tampered with”. This is often used for files as big as CD or DVD images, so there definitely isn’t any limit to the input length.

    So the short answer is no, there is no need for a maximum length for your password field.

    (in fact, hackers look for sites that specify a max length for passwords, on the assumption that this means they aren’t hashing their passwords and are vulnerable to attack)

    To answer the other part of your question: Yes, the computed hash value is always the same length, assuming you use the same hashing algorithm every time.

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

Sidebar

Related Questions

I've got this input form: (Using the blade template engine with Laravel, but the
I were using laravel this wonderful evening when I stumpled upon this strange error
I get this error when enabling sessions, using the filesystem, in Laravel PHP. Only
I'm using Laravel last version: 3.2.1. When I run this on terminal: php artisan
new to Laravel (coming from Java spring), while using Route::get('/', function() { return Hello
I am experiencing a fatal error while using artisan on the (fantastic) Laravel PHP
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
I started using Laravel (I added RoR as a tag since I know that
I've been using Laravel 4 for a few days now and I stumbled across

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.