Jump to content

Simple question on PASSWORD() function.


Emir

Recommended Posts

Hello,

This may be a stupid question, but I was wondering whether the PASSWORD() function stores the data as a larger or smaller size in the destination table field:

Say I have a PHP/HTML form that has a password input. I have the maxlength property of 30 for this field. I happen to enter a password that is 30 characters in length. When this field is sent to the database and encrypted with the PASSWORD() function, does it make it larger, smaller, or the same size.

I am just wondering this because I am not sure whether I should keep the same size for my Form and for my Table's Field.

Any help would be greatly appreciated,

Thank you,
Emir
Link to comment
Share on other sites

The length of the password before isn't related to its length after encryption
SELECT PASSWORD('f')
//*241E241B694B4F0B740CF5B9775AFD9A511E1CEC

SELECT PASSWORD('This is my really really long password')
//*23218AC3A2F0CA3DF720A86F399AF85C36CFDEDE
Link to comment
Share on other sites

So if that is the case, would I set the length of my table field to 40 in order to be able to contain all of the encrypted characters?

So, in the end I would have a PHP/HTML form with a maxlength of 30 (or something), while I would set the length of the database table field to 40.

That is where I am getting confused.

Thanks again for the help.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.