Diffie Hellman and AES on Android

Shardul picture Shardul · Aug 2, 2011 · Viewed 7.5k times · Source

I am trying to use Diffie Hellman for key exchange and AES to encrypt data with keys. Can anyone provide me a suitable work sample for android ?

Answer

Nathan Fig picture Nathan Fig · Aug 2, 2011

I've actually been working on a similar problem lately myself. I don't have a working sample, but here are some points you should be aware of:

  1. Android uses a partial Bouncy Castle package to handle most of its cryptography, but some people prefer to user their own cryptographic package (Spongy Castle is a commonly cited alternative) since Android's is incomplete. See the discussion in here.

  2. If you choose to use Android's existing tools, you can access them through Cipher. Here is a useful list of algorithms Android supports.

  3. Be aware that if you choose to use some non-Android Java crypto library, Android does not support all Java packages your library may need. See my (currently unanswered) question about how to deal with that in Spongy Castle.

Hope these help!