SQL question

Matt Graham mhgraham at crow202.org
Mon Mar 6 17:27:31 MST 2017


> On Mon, Mar 6, 2017 at 9:20 AM, Matt Graham <mhgraham at crow202.org> 
> wrote:
>> I think this isn't quite right, because the salt has to end
>> with a $ according to the man page for crypt.  I think you
>> want CONCAT('$6$', SUBSTRING(SHA(RAND()), -16),'$')) but
On 2017-03-06 10:07, Herminio Hernandez, Jr. wrote:
> I was following the tutorial the digital had. I am not a mysql expert
> so you could be right.

Actually trying this with a recent mysql shows that "select 
encrypt('string','$6$d6066e43fb301519$');" and "select 
encrypt('string','$6$d6066e43fb301519');" return the same results.  So 
unlike the man page for crypt(), mysql adds the missing final $ for you. 
Or the crypt() function doesn't actually care.  So you're probably fine 
and it'll all work.

-- 
Crow202 Blog: http://crow202.org/wordpress
There is no Darkness in Eternity
But only Light too dim for us to see.


More information about the PLUG-discuss mailing list