gnu pg

Dutta, Pradipta pradipta.dutta at
Wed May 2 17:05:41 CEST 2012

        I will appreciate your help in understanding the encryption and decryption of
GNUPG by using Java in Windows environment.

Please let me know if you have any jar files or sample java code to accomplish the same.

My requirement is as follows:
We get one encrypted file from the user and using java in Windows environment we need to encrypt the file and store it
In one directory.

The below code when I try to run in windows I got the Error.

import com.freiheit.gnupg.GnuPGContext;
import com.freiheit.gnupg.GnuPGData;
import com.freiheit.gnupg.GnuPGKey;

public class TestMain {

      * @param args
      public static void main(String[] args) {
            TestMain t = new TestMain();

      public void encryp()
            GnuPGContext ctx = new GnuPGContext();

        GnuPGKey[] recipient = new GnuPGKey[1];
        recipient[0] = ctx.getKeyByFingerprint("gpg-fingerprint of recipient (must be from your keyring)");
        GnuPGData plain = ctx.createDataObject("I am a secret message.");
        GnuPGData cipher = ctx.createDataObject();//this will contain the cipher after encryption

        ctx.encrypt(recipient, plain, cipher);
        System.out.println("Plain text: " + plain);
        System.out.println("Cipher text: " + cipher);



Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\pd68403\AppData\Local\Temp\ Can't load this .dll (machine code=0x101) on a IA 32-bit platform
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(
      at java.lang.ClassLoader.loadLibrary(
      at java.lang.Runtime.load0(
      at java.lang.System.load(
      at com.freiheit.gnupg.GnuPGContext.<clinit>(

Thanks and Regards
Pradipta Dutta
Desk no: 908 563 0274
mail id:  pradipta.dutta at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20120502/41833c5b/attachment-0001.htm>

More information about the Gnupg-users mailing list