Search Postgresql Archives

Re: Problem with encode () and hmac() in pgcrypto

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 1, 2011 at 5:36 PM, hlcborg <h.luis.cardoso@xxxxxxxxx> 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:38;100036;684.40; " | openssl dgst
> -sha1 -sign abc.pem | openssl enc -base64 -A

Plain SHA1, which is signed with RSA signature.

> The Result is:
>
> nKfxnt31+kk/RnKihJ0jKufq+nZvmPjVauGo8+tqJ1Y/ah/mAu4jSS1wnzU+wRygZ4CLIV9DGSs9bxBc4r9e71C8s9B5ms6Kpggmc12kdmqVHBRO28bPWb/YLCej59gZFFkvcCudweNAT4qHvVqWsOtFCf9kE4q92UIv1JcwSDU=
>
> This hash has 172 chars
>
> Does someone know where is my problem? Is there other way to implement?  or
> is it simply impossible??

These two operations are not equivalent.

-- 
marko

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux