Getting Java-ready
You need a Java 1.1 runtime that supports the JNI to use CTCJava 1.x; you might very well already have such a thing. For version 2.0 Java 5 is required. These can be freely downloaded from Sun's Java site.
Rolling your own
If you want to build your own version, you need
- CTClib source: The general purpose crypto library.
- CTCjlib: JNI layer, bundled with the CTClib code starting with version 2.3, including documentation and Makefiles.
- CTCjava v1.2 source: The GUI code, written in Java.
- A C++ compiler that supports templates and the STL (there is a workround for a mis-implementation of basic_string<> in some gcc version). For Windows, the VC++ Express compiler can be used.
- A JDK 1.1 or later Java compiler (though the Makefile assumes a Java2 version of javac)
- Later CTClib/CTCjava patches as desired (see the main CTClib page)
The first two make up your shared library; with the crypto and key management engine; the next two ise the presentation layer. The documentation in the CTClib source elaborates upon this.
Starting up (Win32)
It may be possible to run the installer file, cj_setup.exe, and then do the set-up as noted in the read-me file- To set up a configuration file, edit the ctcjava.lax file replace the
line
lax.command.line.args=$CMD_LINE_ARGUMENTS$
with one indicating the configuration file e.g.
lax.command.line.args=F:\\ctc\\ctcjava.ini
note - the '\' character must be doubled. - To attach the icon to the CTCjava.exe file on the desktop
- Create a shortcut to the executable on the desktop
- Right click to edit properties
- Select the Shortcut tab, and press the Change Icon button
- Select the CTCjava.ico file from the installation directory
- OK or Apply that.
- Update the ctcjlib.dll from a later download archive (just copy the newer file over the old)
If you have installer problems
If the installer fails to run (I've had this happen under WinXP Home,
where even a copy of the installed system executable will not run, but not
WinXP Pro), then you have to fall back to a variant of the Linux strategy
below. Download the Linux cj_setup.zip archive
and the CTClib 2.3.1 patch dll archive. Extract the .jar file from the
former, and the dll from the latter, and put them in the same folder. Now
create a ctcjava.bat file that has commands to change to the partition and
then cd to the folder where you have placed these files, and then executes
wjview /cp:p ctcjava.jar com.ravnaandtines.ctcjava.CTC
ctcjava.ini
to use the Microsoft VM, which is what I needed to use to get it working at
all, or
javaw -cp ctcjava.jar com.ravnaandtines.ctcjava.CTC
ctcjava.ini
(with the javaw for the JDK or equivalent jrew command for the JRE preceeded
by the path to the Java installation's \bin folder if it's not on the path)
to use a Sun JRE if that works for you.
Put a shortcut to this on your desktop with an icon as in step 2 above.
Starting up (Linux)
The .xpm files are provided allow you to attach these as icons to the executable for display on the desktop
- You must already have Java 1.1 or later installed (I use Sun's JDK for
Linux).
You can download v1.1 or later from www.blackdown.org or its mirrors; and current (Java2) versions from www.javasoft.com.
Note that some versions of the Kaffe VMs (I tried v1.0.5) can't handle the images I use in the GUI for buttons and such, so I don't recommend it. You'll know simply by looking if there are only scrambled images. - Extract all the files out of the
cj_setup.ziparchive (if you haven't already). I assemble all the release together on NT, so make no apologies for the archive type. - start the main class of the application
named
com.ravnaandtines.ctcjava.CTC, specifying a file into which you will store configuration, e.g.~/.ctcjava.- try
jre -nojit -cp ctcjava.jar com.ravnaandtines.ctcjava.CTC ~/.ctcjava - If that doesn't work, try
jre -nojit -classpath [path to]classes.zip:ctcjava.jar com.ravnaandtines.ctcjava.CTC ~/.ctcjava - If that doesn't work either, on sh-like shells, try
cd [to directory where install.zip is located]
CLASSPATH=[path to]classes.zip:ctcjava.jar
export CLASSPATH
java -nojit com.ravnaandtines.ctcjava.CTC ~/.ctcjava - Or for csh-like shells, try
cd [to directory where install.zip is located]
setenv CLASSPATH [path to]classes.zip:ctcjava.jar
java -nojit com.ravnaandtines.ctcjava.CTC ~/.ctcjava
- try
- Depending on your set-up, you may use
javarather thanjre, or vice versa; and if you get an UnsatisfiedLinkError like
you'll need to setjava/lang/UnsatisfiedLinkError: ctcjlib: file not found at java.lang.Throwable.(Throwable.java:38) at java.lang.Error.(Error.java:21) at java.lang.LinkageError.(LinkageError.java:21) at java.lang.UnsatisfiedLinkError.(UnsatisfiedLinkError.java:21) at java.lang.Runtime.loadLibrary(Runtime.java:156) at java.lang.System.loadLibrary(System.java:146) at com.ravnaandtines.ctcjava.CTC.(CTC.java:50)LD_LIBRARY_PATHexplicitly as in the appropriate one of the latter two cases whereCLASSPATHwas being specified explicitly.
A quick tour of the controls
To start off on the first session, go to the "Keyrings" tab, and use the "Browse..." buttons to select your key-ring files (these may be pre-existing PGP keyrings, or files that do not yet exist - just go to your selected directory, type the file name e.g. pubring.pgp, and OK). Then save these settings, and the key-rings will automatically be found next time you start up CTCjava.
Key generation is handled from the main menu-bar (see here for a discussion of RSA key generation); keyring management from the appropriate tabs (via a menu bar within the public-keys tab, and by buttons for the secret keys). The "Lock" operation for secret keys re-encrypts any secret key that has been made available for use by giving its passphrase in this session. The settings tab controls various ancillary features, and the algorithms tab the default algorithms to use (annotated by the PGP releases that support them).
The File New and Open operations create new editor windows (active for text files, as placeholders for binary), from which the various encryption and text edit operations can be performed. The decrypt/verify operation will handle message decryption and verification, insertion of new keys into the keyrings, split signatures (the signed document will be requested) or session keys (the encrypted document will be requested). The "Reveal session key" operation is designed with court orders to decrypt in mind.