Any ideas why my statement like SELECT SHA1('abc') AS my_sha is being returned as binary value, I thought it should be returning HEX in anycase ? I'm using MySQL community server 5.1.43, with Innodb tables.
Cheers Neil On Sat, Sep 18, 2010 at 10:43 AM, Johan De Meersman <vegiv...@tuxera.be>wrote: > hex() and unhex() should do the trick in mysql (not base64, but same idea). > Those will transform every byte into a pair of hexadecimal digits - thus > limited to 0-9 and A-F - and reverse the process. > > > On Fri, Sep 17, 2010 at 2:13 PM, Tompkins Neil < > neil.tompk...@googlemail.com> wrote: > >> Sorry Johan, how exactly do you do this ? >> >> >> On Fri, Sep 17, 2010 at 1:11 PM, Johan De Meersman <vegiv...@tuxera.be>wrote: >> >>> Simply base64-encode the returned binary string before offering it to >>> your client. >>> >>> On Fri, Sep 17, 2010 at 1:22 PM, Tompkins Neil < >>> neil.tompk...@googlemail.com> wrote: >>> >>>> Hi, >>>> >>>> I need to encrypt a string like 'hello world', using a passkey. But I >>>> also >>>> need to be able to decrypt the encrypted phrase using the same passkey. >>>> I >>>> noticed in MySQL there are functions like >>>> AES_ENCRYPT()< >>>> http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_aes-encrypt >>>> > >>>> >>>> >>>> However, I need the encrypted phrase to be returned as a string, since >>>> it >>>> will be passed to a URL as a parameter. Does anyone have any >>>> suggestions on >>>> how to overcome this issue, using MySQL. >>>> >>>> I know that there are many components available out there, but I can't >>>> install any third party components on the hosting server. >>>> >>>> Cheers >>>> Neil >>>> >>> >>> >>> >>> -- >>> Bier met grenadyn >>> Is als mosterd by den wyn >>> Sy die't drinkt, is eene kwezel >>> Hy die't drinkt, is ras een ezel >>> >> >> > > > -- > Bier met grenadyn > Is als mosterd by den wyn > Sy die't drinkt, is eene kwezel > Hy die't drinkt, is ras een ezel >