List:General Discussion« Previous MessageNext Message »
From:Tompkins Neil Date:September 20 2010 8:59am
Subject:Re: Encryption with MYSQL
View as plain text  
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 <vegivamp@stripped>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.tompkins@stripped> wrote:
>
>> Sorry Johan, how exactly do you do this ?
>>
>>
>> On Fri, Sep 17, 2010 at 1:11 PM, Johan De Meersman
> <vegivamp@stripped>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.tompkins@stripped> 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
>

Thread
Encryption with MYSQLTompkins Neil17 Sep
  • Re: Encryption with MYSQLJohan De Meersman17 Sep
  • prime number tableElim PDT17 Sep
    • RE: prime number tableGavin Towey17 Sep
    • Re: prime number tableChris W18 Sep
  • Re: prime number tableElim PDT21 Sep
Re: Encryption with MYSQLTompkins Neil20 Sep
  • Re: Encryption with MYSQLBaron Schwartz20 Sep