robert w dumond napsal(a):

>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);
>       }
>}
>
>
>  
>
I am not totally sure, but it looks, that your Java implementation uses 
padding with spaces? If that is the case, you have to use the same 
padding for Rebol to obtain the same result.
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to