Results 1 to 2 of 2

Thread: AES (Rijndael) Java class

  1. #1
    Senior Member
    Join Date
    Sep 2001

    Post AES (Rijndael) Java class

    I am working on a chat client that using AES (Rijndael) in Java, I am needing to verify my "assumptions" for the specs on Rijndael. I have attached some source if anyone wants to take a look, it is not optimized (to any extent) and only gets about 1.7k throughput. I have only posted the class that is used to encrypt/decrypt data, no classes that actually use it.

    In order to use it you will need to have a program create a new RijnCrypto object, then invoke the encrypt(String, String) method, to decrypt data you will need to call the decrypt(String, String) method. I have included a simple example main method.
    	static int charsread;
    	static char data[];		
    	public static void main(String args[]) {
    		RijnCrypto rijn = new RijnCrypto(128, 128);
    		String filename = "test.txt";
    		try {
    			FileReader filereader = new FileReader(filename);
    			data = new char[400000];
    			charsread = filereader.read(data);
    		} catch (Exception e) {
    		String d = new String(data, 0, charsread);
    		double i;
    		double j;
    		System.out.println("Start crypt: ");
    		i = System.currentTimeMillis();
    		rijn.encrypt(d, "aaaaaaaaaaaaaaaa");
    		j = System.currentTimeMillis();
    		double x = j - i;
    		System.out.println("Stop crypt, took: " + x + "ms");
    I am looking for flaws with the code itself, and it also makes a good reference piece for people who want to know how rijndael works.



    -- Do not dwell in the past, do not dream of the future, concentrate the mind on the present moment--

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Looks good! I'm no Rijndael expert, but on the NIST homepage I found two links, one with a C++ implementation, http://fp.gladman.plus.com/cryptogra...logy/rijndael/
    and a cgi-app for testing Rijndael on the web. http://aes.crockatt.com/

    I bet you have seen these before, but in case you haven't, you could compare your code to the C++ code and test your output in the cgi-app.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts