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
https://forums.phpfreaks.com/topic/29778-simple-question-on-password-function/
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
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.