I am using GnuPG software for assymetric encryption in PostgreSQL.
I have done encryption using
and got succeded
but when i am doing decryption with syntax:-
I am getting error as:-
->ERROR: Corrupt data
->********** Error **********
->ERROR: Corrupt data
->SQL state: 39000
Please guide me where i am going wrong..as i need this urgently
I have done encryption using
Code:
->INSERT INTO "test1"("test")
-> VALUES (pgp_pub_encrypt('testing', dearmor('------>BEGIN PGP PUBLIC KEY BLOCK-----
->Version: GnuPG v2.0.17 (MingW32)
->..............
->-----END PGP PUBLIC KEY BLOCK-----'
->)));
but when i am doing decryption with syntax:-
Code:
->SELECT pgp_pub_decrypt(bytea ("test"),
->dearmor('-----BEGIN PGP PRIVATE KEY BLOCK-----
->Version: GnuPG v2.0.17 (MingW32)
->.............................
->-----END PGP PRIVATE KEY BLOCK-----'),'decrypt123') --> ->this is the passphrase
-> FROM "test1";
I am getting error as:-
->ERROR: Corrupt data
->********** Error **********
->ERROR: Corrupt data
->SQL state: 39000
Please guide me where i am going wrong..as i need this urgently
Comment