Hi,
        I found a problem as follows

        Key toBeWrappedKey = Generator("DESede", 168);       
        Key wrapKey = Generator("DESede", 112);   


        Cipher cipher = Cipher.getInstance("DESede/CBC/ISO10126Padding");
        cipher.init(Cipher.WRAP_MODE, wrapKey);
        byte[] wrappedKey = cipher.wrap(toBeWrappedKey);
        System.out.println(new String(wrappedKey));  // result 1
     
        
        XMLCipher xcipher = XMLCipher.getInstance(XMLCipher.TRIPLEDES);
        xcipher.init(XMLCipher.WRAP_MODE, wrapKey);
        EncryptedKey ek = xcipher.encryptKey(getEncryptedData(), 
toBeWrappedKey);
        byte[] wrappedKey2 = 
Base64.decode(ek.getCipherData().getCipherValue().getValue().getBytes());
        System.out.println(new String(wrappedKey2));   // result 2



        Why the 2 results are different ?


Thanks

Reply via email to