Introduction
I needed a kryptographic algorithm for the address database project. This is
a class library that implements an RSA krypt algorithm, a key generator for
the necessary keys, a kryptation class for strings and a pair of FilterStreams.
RSA is an algorithm based on the function of the formulation of a mathematical
problem. The solution for this problem is attempet by generations of mathematicians,
but not jet finished. Generate two keys d and e and a number n on a special
way. Encrypt the information i with the formulae x = i ^ e % n (say: i over
e mod n). Decryption use the formulae i = x ^ d % n. The size of the keys is
different depends by the application and have up to 2048 Bits. The information
to encrypt is splitted in byte blocks with the length of the keys. Than the
blocks are encrypted or decrypted.
A god introduction in RSA is the article "Die
faszinierende Geschichte von Alice und Bob" from Mirko Matytschak (only
in german).
Functionality
The functionality is for both versions of the implementation the same:
- RSA krypt algorithm for BigInteger values and arrays,
- Key generator for the necessary keys,
- Kryptation class for Byte arrays,
- Kryptation class for strings,
- Pair of input and output FilterStreams.
Version 2 for Java version 5 and above
Version 2 uses the generics for classen like Vector, Iterator and other availible
since Java version 5. This eliminates the Warnings during the compilation and
the implementation are type save.
These are the source and binary files of the first version of the package:
| File |
Size |
Content |
| LongRSA_src_2_0_0.zip |
42.053 Byte |
- Source files of the package de.longsoft.RSA containing the RSA krypt
algorithms.
- Source files of the package de.longsoft.RSATest containing a test
application for key generation and string kryption. This application
has a swing user interface. Also a console test application for the
RSA FilterStreams is included.
- Source files of the package de.longsoft.Utilities containing some
helper classes for GUI.
|
| LongRSA_bin_2_0_0.zip |
49.741 Byte |
jar-files with the compiled classes. |
There are two possibilities to build packages:
- Using a IDE (e.g. Eclipse)
Create tree new projects in the workspace of the IDE, one for LongRSA_2_0,
one for LongRSATest_2_0 and one for Utilities_2_0. Copy all source files inclusive
directories in the src directories of the projects. Add the LongRSA and the
Utiliies project to the project properties of the LongRSATest_2_0 project.
In the Run dialog add the class de.longsoft.LongRSATest.RSATest as the main
class. Compile and start.
- Working with Ant
Create the following dirctory structure:
./--+ release
+ debug
+ LongRSA
+
src
+
bin
Unpack the archiv with the sources in the src directory inclusive of the pathes
of the zip file. Enter the three directorys with the source files and execute
'ant release'. In the bin directory will be stored the compiled classes and
in the release directory the jar files. Change to the release directory start
the test programm with
'java -jar LongRSATest_2_0.jar' .
You can see the following:

You can generate a documentation of the package using JavaDoc
(e.g. 'ant javadoc').
Version 1 for Java up to version 1.4.x
Version 1 uses the not type save version of classen like Vector, Iterator.
If you compile this version with Java version 5 or above some Warnings occurs.
These are the source and binary files of the first version of the package:
| File |
Size |
Content |
| LongRSA_src_1_0_2.zip |
21.287 Byte |
- Source files of the package de.longsoft.RSA containing the RSA krypt
algorithms.
- Source files of the package de.longsoft.RSATest containing a test
application for key generation and string kryption. This application
has a swing user interface. Also a console test application for the
RSA FilterStreams is included.
|
| LongRSA_bin_1_0_2.zip |
16.054 Byte |
jar-files with the compiled classes. |
There are two possibilities to build packages:
- Using a IDE (e.g. Eclipse)
Create tree new projects in the workspace of the IDE, one for LongRSA_1_0
and one for LongRSATest_1_0. Copy all source files inclusive directories in
the src directories of the projects. Add the LongRSA to the project properties
of the LongRSATest_1_0 project. In the Run dialog add the class de.longsoft.LongRSATest.RSATest
as the main class. Compile and start.
- Working with Ant
Create the following dirctory structure:
./--+ release
+ debug
+ LongRSA
+
src
+
bin
Unpack the archiv with the sources in the src directory inclusive of the pathes
of the zip file. Enter the two directorys with the source files and execute
'ant release'. In the bin directory will be stored the compiled classes and
in the release directory the jar files. Change to the release directory start
the test programm with
'java -jar LongRSATest_1_0.jar' .
You can see the following:

You can generate a documentation of the package using JavaDoc.
© Ralf Lange, longsoft Dresden
Comments & suggestions: webmaster
form - Last Modification: 2008-07-03
Java and all Java based trademarks and logos are trademarks or registered trademarks of Sun Microsystems,
Inc. in the USA and in other countries. All other mentioned companies and product names are trademarks
or registered trademarks of each manufacturer.