Re: [GENERAL] Problem with encode () and hmac() in pgcrypto

2011-02-03 Thread Marko Kreen
On Thu, Feb 3, 2011 at 2:38 PM, hlcborg wrote: > For now, I already can use in my PG database the PL/Python to create > functions. > But I need a library that  can do the: >> Plain SHA1, which is signed with RSA signature. > > Do you known any PL/Python wrapper libraries > around OpenSSL (or any o

Re: [GENERAL] Problem with encode () and hmac() in pgcrypto

2011-02-03 Thread hlcborg
Hi For now, I already can use in my PG database the PL/Python to create functions. But I need a library that can do the: > Plain SHA1, which is signed with RSA signature. Do you known any PL/Python wrapper libraries around OpenSSL (or any other crypto library) that I could use. I have found s

Re: [GENERAL] Problem with encode () and hmac() in pgcrypto

2011-02-02 Thread Marko Kreen
On Wed, Feb 2, 2011 at 1:19 AM, hlcborg wrote: >> These two operations are not equivalent. > > But... > Can I have this operation done in the Stored Procedure inside the Database? > Plain SHA1, which is signed with RSA signature. and in the end encoded to > base64? > > I was looking in the pgcrypt

Re: [GENERAL] Problem with encode () and hmac() in pgcrypto

2011-02-01 Thread hlcborg
Hi Marko, OK, > These two operations are not equivalent. But... Can I have this operation done in the Stored Procedure inside the Database? Plain SHA1, which is signed with RSA signature. and in the end encoded to base64? I was looking in the pgcrypto functions, and I haven´t found any that

Re: [GENERAL] Problem with encode () and hmac() in pgcrypto

2011-02-01 Thread Marko Kreen
On Tue, Feb 1, 2011 at 5:36 PM, hlcborg wrote: > encode(hmac(v_em_crt_conc, v_Private,'sha1'),'base64'); HMAC - key-dependant SHA1 > The Result: > > h6CpmrP1QCE/Mp3xn3utUEPtftg=      This hash has 28 chars > > When I use OpenSSL in command line like this: > > ~$ echo "2011-01-31;2011-02-01T13:33

[GENERAL] Problem with encode () and hmac() in pgcrypto

2011-02-01 Thread hlcborg
Hi, I am trying to compute a hash string with 172 bytes. I have a openssl RSA private key stored in the postgresql db and a string with some text. I want to sign that string with the private key and the SHA1 algorithm and encode the result in the base64 format. I am writing it inside the pg da