w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to convert java (Android) crypto params to iOS crypto?

Ensure the keys and iv are exactly the correct length.

"DESede" means:
DES (Data Encryption Standard) which should not be used for new work.
ede means encrypt, decrypt, encrypt 3DES (Triple DES - 168 bit, 24 bytes) with key usage that is backward comparable with DES (Single DES - 56 bit, 8 bytes), The the key is broken into three keys where the first is used to encrypt, the second to decrypt, the third to encrypt (ede). It is also possible, but non-standard, to use a different sequence of encrypt and decrypt so check that.

Note, the high bit in each byte is parity and generally ignored.

The iv can be problematic because unless static must be transmitted along with the encrypted data, one common method is to pre-pend the iv to the encrypted data.

Padding can also vary, PKCS#7 is the general standard but some implementations such as PHP use a non standard padding. With PKCS#7 the encrypted length will always be at least one byte longer than the plain data. PKCS#5 is essentially the same for this type of encryption.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.