Re: does encrypt function support higher than basic ascii?

From: "Naoko Reeves" <naoko(at)lawlogix(dot)com>
To: "Naoko Reeves" <naoko(at)lawlogix(dot)com>, "Richard Huxton" <dev(at)archonet(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: does encrypt function support higher than basic ascii?
Date: 2009-11-17 20:55:53
Message-ID: 076DC33A3D38CE4BBC64D35DDD9DE70C098DA58E@mse4be2.mse4.exchange.ms
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry, as Richard said the issue was me not converting bytea to text. The blow did it . thank you!

SELECT convert_from((select decrypt(encrypt((select convert('aéiou','LATIN1', 'LATIN1')),'foo','aes'),'foo','aes')),'UNICODE')

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Naoko Reeves
Sent: Tuesday, November 17, 2009 1:38 PM
To: Richard Huxton
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] does encrypt function support higher than basic ascii?

I have tried:
select decrypt(encrypt((select convert('aéiou','UTF8', 'LATIN1')),'foo','aes'),'foo','aes')
select decrypt(encrypt((select convert('aéiou','UNICODE', 'LATIN1')),'foo','aes'),'foo','aes')
select decrypt(encrypt((select convert('aéiou','LATIN1', 'LATIN1')),'foo','aes'),'foo','aes')

but none of above seems to be resolving the issue...

-----Original Message-----
From: Richard Huxton [mailto:dev(at)archonet(dot)com]
Sent: Tuesday, November 17, 2009 1:14 PM
To: Naoko Reeves
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] does encrypt function support higher than basic ascii?

Naoko Reeves wrote:
> Hello,
>
> I have the following statement and accent e doesn't seems to be
> decrypted correctly.
>
> select decrypt(encrypt('aéiou','foo','aes'),'foo','aes')
>
> Could you tell me if there is an option for encoding or this function
> only encrypt basic ascii?

They take bytea rather than text and return bytea too.

Does casting the result give you valid text?

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2009-11-17 21:07:25 Re: does encrypt function support higher than basic ascii?
Previous Message Scott Marlowe 2009-11-17 20:55:25 Re: [GENERAL] Postgresql Database Lock Problem