gpg symmetric to Java JCA decryption

Juergen Weber weberjn at
Sun Mar 21 22:09:25 CET 2010

On Fri, Mar 19, 2010 at 11:23 PM, David Shaw <dshaw at> wrote:
> On Mar 19, 2010, at 4:51 PM, Juergen Weber wrote:
>> Hi,
>> has anybody tried to decrypt a symmetric gpg encryption with Java
>> using Java Cryptography Architecture included in the JDK?
>> echo hello |  gpg -c --cipher-algo 3DES -a --passphrase "my pass" |
>> java MyDeCrypt --cipher-algo 3DES --passphrase "my pass"
>> should result in hello
>> This should be possible, I googled for a sample, but there seems to be none.
> GnuPG encrypts using the OpenPGP standard.  The Java cryptography architecture doesn't follow that spec (that "file format" if you like). If you want to do OpenPGP in Java, I suggest which is a provider for the cryptography architecture.
> David

No, I don't need OpenPGP, just need symmetric encryption done by a
standard command line Unix tool and decryption by means of the Java
runtime library.
Guess I'll take openssl, looks like this works with Java:


More information about the Gnupg-users mailing list