@Test public void testSimple() throws UnsupportedEncodingException { String message = "Threefish!"; byte[] encrypted = threefish.encryptString(message); String message2 = threefish.decryptString(encrypted); assertEquals(message, message2); message = "Jodd was here!Jodd was here!Jodd was here!Jodd was here!Jodd was here!Jodd was here!Jodd was here!Jodd was here!Jodd was here!Jodd was here!Jodd was here!"; encrypted = threefish.encryptString(message); message2 = threefish.decryptString(encrypted); assertEquals(message, message2); }
@Test public void testLoop() throws UnsupportedEncodingException { long reps = 10000; while (reps-- > 0) { String s = RandomStringUtil.randomAscii(MathUtil.randomInt(1, 1024)); byte[] encrypted = threefish.encryptString(s); String s2 = threefish.decryptString(encrypted); assertEquals(s, s2); } }