0

I need encryption in my app and thought about using javax.crypto.Cipher for that. I wonder if I can use it for desktop, android and iOS and if RoboVM supports it.

I want to use the following algorithm:

Cipher.getInstance("AES/CBC/PKCS5Padding");

President James K. Polk
  • 40,516
  • 21
  • 95
  • 125
Luca Hofmann
  • 1,442
  • 2
  • 14
  • 26

1 Answers1

0

iOS does not support Java. Instead use CommonCrypto, part of Apple's Security framework.

Common Crypto does support AES (128 & 256 bit keys), CBC mode and PCKS7Padding.

Note: in the context of AES PKCS5Padding and PKCS7Padding are the same. See: crypto stackexchange

Community
  • 1
  • 1
zaph
  • 111,848
  • 21
  • 189
  • 228
  • Thank you for the answer but I wanted to know If I can use Cipher using RoboVM. It is a JavaVM that runs on iOS. Because crypto is a special topic I wonder if this is also supported. – Luca Hofmann Nov 03 '14 at 14:26
  • One potential issue is the special ARM crypto instructions. My guess is that the conversion from Java bytecodes would not utilize them. But the performance might not be an issue. – zaph Nov 03 '14 at 14:32