General

What is the Antimatter Java library?

The Antimatter Java library is a (hopefully) useful collection of classes that our core contributors have created over the years for a variety of projects. There just seem to be some typical features that have been needed across different projects over the years.

Antimatter represents our attempt to 1) collect these classes in a useful and reusable context, 2) bullet-proof them a little more than we perhaps had time for in the crush of normal project work, and 3) make them available for the use of the open source community.

There are also other tools that we would like to release to the open source community. Collecting these utility classes in a generic and easily shareable jar file also makes it easier for us to use the various Antimatter classes as building blocks for our other tools.

[top]

Encryption

What purpose was the Encrypter class created for?

The Encrypter class was created to resolve a recurring problem for Java projects. Namely, the necessity for storing critical settings, typically passwords, in clear text within properties files or within columns in a database table. The Encrypter class permits critical information such as passwords, credit cards numbers and other data to be stored more safely than in plain text.

[top]

Can the Encrypter class be used on files or objects?

The Encrypter class can be used to encrypt any reasonable set of bytes, including entire files or objects. In practice, however, there are probably some underlying and possibly system-specific limits on the size of the string that can be encrypted, i.e. - your typical properties file can probably be safely encrypted, but maybe not your multi-gigabyte bootleg copy of "The Bourne Ultimatum."

[top]

How can I encrypt a string?

The Encrypter class can be used to encrypt a string as shown below:

           String strContent = "clarke";

           // Encrypt the string with a string key and a key type ("DES")
           Encrypter objEncrypter = new Encrypter("A345B2Nu", "DES");
           String strEncrypted = objEncrypter.encrypt(strContent);
       
[top]

How can I decrypt a string?

The Encrypter class can be used to decrypt a string as shown below:

           StringEncrypted = "Vn++PcODJsQ="

           Encrypter objEncrypter = new Encrypter("A345B2Nu", "DES");
           String strDecrypted = objEncrypter.decrypt(strEncrypted);
       
[top]