JCrypt (Mon Aug 02 10:13:15 GMT+05:00 1999)
Copyright (C) 1999 Waqas Shafiq.
All Rights Reserved.


Installation
------------

    1. Unzip the contents of JCrypt.zip in JCRYPT_DIR

    2. Copy <JCRYPT_DIR>\jce.zip to JAVA_DIR\jre\1.2\lib\ext

    3. To make use of the ABA provider under JDK 1.2 insert an
       entry for the provider into the security properties file
       (JAVA_DIR\jre\1.2\lib\security\java.security) similar to:

       security.provider.2=au.net.aba.crypto.provider.ABAProvider

       next to the following entry

       security.provider.1=sun.security.provider.Sun

    Note:
    A. JCRYPT_DIR is the directory where you unzip the contents
       of JCrypt.zip

    B. JAVA_DIR is the directory where JRE is installed.


Testing
-------

    1. Generate your public/private key pair.

        Example:

        keytool -genkey -alias bob -keyalg RSA
                -sigalg MD5withRSA -validity 366 -keysize 2048
                -keystore C:\JCrypt\.keystore -storetype ABA
                -storepass my_password

        Replace bob, C:\JCrypt\.keystore and my_password with your
        alias, <JCRYPT_DIR>\.keystore and your password.

        Note: This might take few minutes


    2. Import my certificate as follows:

       Example:

       keytool -import -alias waqas -file waqas.cer
               -keystore <JCRYPT_DIR>\.keystore -storetype ABA
               -storepass <my_password>

    3. Type the following at the command prompt to run the program:
       
       java -cp C:\JCrypt;C:\JCrypt\JCrypt.jar JCrypt
       
       OR
 
       javaw -cp C:\JCrypt;C:\JCrypt\JCrypt.jar JCrypt   

    5. Verify the JCrypt.zip.signature file using:

       Algorithm: MD5withRSA
       Signature: JCrypt.zip.signature
       File: JCrypt.zip

       KeyStore Password: <my_password>
       Keystore: <JCRYPT_DIR>\.keystore
       Alias: waqas


keytool - Key and Certificate Management Tool
---------------------------------------------

    keytool is a key and certificate management utility provided
    by JRE. It enables users to administer their own public/private
    key pairs and associated certificates for use in
    self-authentication (where the user authenticates
    himself/herself to other users/services) or data integrity
    and authentication services, using digital signatures. It
    also allows users to cache the public keys (in the form
    of certificates) of their communicating peers.

    Complete keytool documentation can be found under "Tool Docs" at

    http://java.sun.com/products/jdk/1.2/docs/index.html


Usage
-----

    1. Use keytool to create your public/private key pair:
 
       Example: Type the following at the command prompt.

       keytool -genkey -alias <your_alias> -keyalg RSA
               -sigalg MD5withRSA -validity 366 -keysize 2048
               -keystore C:\JCrypt\.keystore -storetype ABA
               -storepass <store_password> 

       You can now sign files using your private key so that others
       can verify them.

    2. Export your certificate:
       
       Example:

       keytool -export -keystore C:\JCrypt\.keystore
               -storetype ABA -alias <your_alias>
               -file <your_alias>.cer -storepass <store_password>

       After exporting your certificate you can distribute it to
       your friends and other people so that they can verify
       files signed by you.

       Anyone who has your certificate will also be able to
       send encrypted files to you. You can decrypt these file using
       your private key. 


    3. Import certificates:

       Example:

       keytool -import -alias <an_alias> -file <an_alias>.cer
               -keystore C:\JCrypt\.keystore -storetype ABA
               -storepass <store_password>

       You can import certificates into your keystore using 
       the command given above. This will enable you to verify
       digital signatures and encrypt files.


Useful Tips
-----------

- Use keysize of 2048 bits with RSA algorithm to generate a key pair.
- Always supply storepass on the command line.
- Use ABA as the storetype.
- Only import certificates that you trust. You can view certificate
  fingerprint by using the following command

  keytool -printcert -file <cert_file>

  Example:  keytool -printcert -file mycert.cer

