PGP (Or GnuGP) under Java

L

Luc The Perverse

If the only needed functionalities were message encryption and decryption -
how difficult would it be to write a PGP client under Java?

It seems like most (all?) of the algorithms used are available in Java.
Yet I see no mention anywhere of a PGP client made in Java, and I don't know
why.
 
P

Paul Rubin

Luc The Perverse said:
If the only needed functionalities were message encryption and
decryption - how difficult would it be to write a PGP client under Java?

Just what we call a "simple matter of programming". The message formats
are documented in RFC 2440.
It seems like most (all?) of the algorithms used are available in
Java. Yet I see no mention anywhere of a PGP client made in Java,
and I don't know why.

Nobody has wanted one enough to bother writing one. Maybe you will be
the first.

Actually, I think hushmail.com uses PGP message formats in their web
applet, but that's maybe short of a complete implementation.
 
S

Sebastian Gottschalk

Paul said:
Just what we call a "simple matter of programming". The message formats
are documented in RFC 2440.

J2SE already includes all necessary crypto algorithms and a powerful key
management system. Through Xerxes, you also got a Base64 coder. HTTP
support is already there, so it's just upon gluing all the components
together and interface with a usable GUI. However, as shown below, it's not
such a good idea.
Nobody has wanted one enough to bother writing one. Maybe you will be
the first.

Actually, there is no need for such a thing. We already got a JNI interface
for GnuPG's library GPGme, whereas GnuPG is an multiplatform, stable and
long-term proven software. Which is also way faster than Java when
incoporating cryoptographic operations, and supports OS specific protection
mechanisms like page locking, memory protection, random number generation,
....
Actually, I think hushmail.com uses PGP message formats in their web
applet, but that's maybe short of a complete implementation.

Guess what they use...
 
Joined
Sep 26, 2009
Messages
1
Reaction score
0
Example

Here is an example code that encrypts PGP,
Just four lines of code. I always thought it shouldn't be so hard to do such a simple thing:)

import com.didisoft.pgp.PGPLib;

public class EncryptWithoutKeystore {
public static void main(String[] args) throws Exception{
PGPLib pgp = new PGPLib();
boolean asciiArmor = false;
boolean withIntegrityCheck = false;
pgp.encryptFile("INPUT.txt", "public_key.pkr", "OUTPUT.pgp", asciiArmor, withIntegrityCheck);
}
}
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top