Um... not sure what happened to my Java code, but here is the correct
and working version. Sorry about that.
Thanks,
rwd
-- Attached file included as plaintext by Ecartis --
-- File: Test.java
import BlowfishJ.*;
public class Test {
public static void main(String[] args) {
byte[] key = "qachafU&[EMAIL PROTECTED]".getBytes();
byte[] value = "test test test".getBytes();
byte[] messbuf;
int nMessSize = value.length;
int nRest = nMessSize & 7;
if(nRest != 0) {
messbuf = new byte[(nMessSize & (~7)) + 8];
System.arraycopy(value, 0, messbuf, 0, nMessSize);
for(int nI = nMessSize; nI < messbuf.length; nI++) {
messbuf[nI] = 0x20;
}
} else {
messbuf = new byte[nMessSize];
System.arraycopy(value, 0, messbuf, 0, nMessSize);
}
BlowfishCBC blah = new BlowfishCBC(key, "11111111".getBytes());
blah.encrypt(messbuf);
String stuff = BinConverter.bytesToBinHex(messbuf);
System.out.println(stuff);
}
}
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.