HomePage RecentChanges

Java PC1 encryption

In 2000 I was looking for some code to do encryption in Java. I found some free C code at http://www.freecode.com and ported it to Java. The results are downloadable below.

I did the implimentation using two Java classes that act as input/output streams which encrypt/decrypt binary data using PC1 with a 128 bit key. PC1 is a stream cipher with a retroaction function.

The original C code was written by Alexander Pukall in 1991.

Hasn't been extensively tested, but the few tests I have done seem to show it is compatible with the original C output. You may want to improve the way it handles the key. If it is too large or small, it just pads it out, or trims it down.


pc1_128.zip - Zip package. Contains all files below and some test classes.

PC1_InputStream.java (view in HTML)

PC1_OutputStream.java (view in HTML)

External links