Techno
Jun 23rd, 2005, 06:37 PM
hi there.
What I am doing is a bit complicated, well really simple but some aspects of it are complicated.
I am trying to compare a password that is stored in bytes in SQL with a textual password suppled on the form, I can convert that to bytes no problem and gives me the same bytes as the bytes used to store it IN SQL.
the thing is, if the user wants to change the password, I Wanna make sure that the current password supplied meets the same password stored in SQL then i can allow them to change the password successfully.
Now...
since the binary length in SQL of the password field is 50 chars long, its all mainly 0's until the 50th char has been reached (when storing in SQL and when retrieving from SQL)
however, this will not be the case when getting the bytes from a text value/string value, even though the first 8 bytes/sections will be the same - so I cannot do a .equals or a == to compare the 2 values because they will be in different lengths.
how can I solve this problem? any tips/ideas?
Thanks!
What I am doing is a bit complicated, well really simple but some aspects of it are complicated.
I am trying to compare a password that is stored in bytes in SQL with a textual password suppled on the form, I can convert that to bytes no problem and gives me the same bytes as the bytes used to store it IN SQL.
the thing is, if the user wants to change the password, I Wanna make sure that the current password supplied meets the same password stored in SQL then i can allow them to change the password successfully.
Now...
since the binary length in SQL of the password field is 50 chars long, its all mainly 0's until the 50th char has been reached (when storing in SQL and when retrieving from SQL)
however, this will not be the case when getting the bytes from a text value/string value, even though the first 8 bytes/sections will be the same - so I cannot do a .equals or a == to compare the 2 values because they will be in different lengths.
how can I solve this problem? any tips/ideas?
Thanks!