3

I'm using iOS Security framework for encryption. Specifically I'm using the ECIES encryption which seems to be very specific in the selection of key exchange, derivation, hashing and authenticated encryption. Is the output cross-platform compatible in any way? i.e. suppose I'm encrypting plaintext directed to Bob with the following in iOS:

let algorithm: SecKeyAlgorithm = .eciesEncryptionStandardX963SHA1AESGCM
guard let cipherText = SecKeyCreateEncryptedData(publicKeyBob!,
                                                 algorithm,
                                                 plainText as! CFData,
                                                 &error) as Data? else {
                                                    throw error!.takeRetainedValue() as Error
}

Is it possible to take this cipher (along with Bob's private key) and decrypt it?

If the answer is no, is there anything in the security framework that is cross platform compatible in that sense?

Thanks, Z

Zohar Etzioni
  • 611
  • 5
  • 13
  • The implementation should conform to the ANSI X9.63 standard. So in theory, it should be cross platform. In practice, it is likely to involve a lot of research and headaches to actually make it work. – TheGreatContini Sep 21 '17 at 22:39
  • @TheGreatContini it would be quite ludicrous if it's not interoperable. I can't imagine no one has ever tried. I'll keep digging and post my findings. – Zohar Etzioni Sep 23 '17 at 10:45
  • @ZoharEtzioni any luck with this question? I have similar case, need to implement asymmetric encryption and signing within EC key pair to pass the data to Java backend. – semenchikus Feb 05 '18 at 23:59

0 Answers0