Cyphre -
    I am using both REBOL/Pro 2.5.6.3.1 and 2.5.125.3.1.

    I am attaching the test java code.

    I also tried Anton's suggestion, but I am getting the same result 
from Rebol.

Mucho gracias,
rwd

Cyphre wrote:

>Hi Robert,
>
>Can ou write what version of Rebol (and SDK) are you using?
>
>I'm getting this result in console
>
>  
>
>>>my-port: make port! [
>>>      
>>>
>[        scheme: 'crypt
>[        direction: 'encrypt
>[        key: to-binary
>[    "qachafU&[EMAIL PROTECTED]"
>[        init-vector: to-binary "11111111"
>[        padding: false
>[    ]
>  
>
>>>open my-port
>>>insert my-port "test test test"
>>>update my-port
>>>value: copy my-port
>>>      
>>>
>== #{5B57A12B58F75F6B37F5FEB649BA8914}
>
>The result is very 'simmilar' to your Java result so maybe the encryption
>port setup needs some 'tuning'? Would be good If you could post also the
>Java code part which is creating your Java result so we can see the details.
>
>regards,
>
>Cyphre
>
>----- Original Message -----
>From: "robert w dumond" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Thursday, September 08, 2005 5:58 PM
>Subject: [REBOL] Rebol/SDK, Java and Blowfish
>
>
>  
>
>>Hallo, alls -
>>    I am testing the interoperability of Blowfish between Rebol/SDK and
>>BlowfishJ for Java.  So far, I am not having much luck.  Has anybody
>>here had any experience getting these two to work together?
>>
>>Here's what I have so far:
>>
>>My Rebol code:
>>
>>my-port: make port! [
>>    scheme: 'crypt
>>    direction: 'encrypt
>>    key: to-binary
>>"qachafU&[EMAIL PROTECTED]"
>>    init-vector: to-binary "11111111"
>>    padding: false
>>]
>>open my-port
>>insert my-port "test test test"
>>update my-port
>>value: copy my-port
>>==
>>#{7B36C60D60C146E9C1019B1FEA825743}
>>
>>My Java result using the same key and init-vector:
>>5b57a12b58f75f6baad115497ac6a028
>>
>>I am using CBC block chaining in both Rebol and Java.
>>
>>Thanks,
>>robert w. dumond
>>--
>>To unsubscribe from the list, just send an email to
>>lists at rebol.com with unsubscribe as the subject.
>>
>>    
>>
>
>  
>


-- Attached file included as plaintext by Ecartis --
-- File: Test.java

import BlowfishJ.*;

public class Test {
        public void main(String[] args) {       
                byte[] key = "qachafU&[EMAIL PROTECTED]".getBytes();   
                byte[] messbuf;  
                int nMessSize = key.length;

                int nRest = nMessSize & 7;

                if(nRest != 0) {
                        messbuf = new byte[(nMessSize & (~7)) + 8];
                        System.arraycopy(lh, 0, messbuf, 0, nMessSize);
                        for(int nI = nMessSize; nI < messbuf.length; nI++) {
                                messbuf[nI] = 0x20;
                        }
                } else {
                        messbuf = new byte[nMessSize];
                        System.arraycopy(lh, 0, messbuf, 0, nMessSize);
                }
       
                BlowfishCBC blah = new BlowfishCBC(key.getBytes(), 
"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.

Reply via email to