Michel
Michel

Reputation: 619

Encrypt data between C#, ANDROID and IPHONE

I'm developing a application to Windows(C#), Iphone, Android and Iphone which will connect to a SOAP WebService, that store information on a Database.

I'm looking for a way to encrypt/decrypt the information between those platforms. Is there any cross platforms library?

Upvotes: 6

Views: 4332

Answers (4)

sicKo
sicKo

Reputation: 1256

The last time I develop an iPhone and Android app I, need to get and post data to a .NET Soap WebService. I use AES to encrypt/decrypt the data

You can download the zip file sample project that I've followed to do encryption/decryption in objective-c and .NET from this link.

http://dotmac.rationalmind.net/2009/02/aes-interoperability-between-net-and-iphone/

Upvotes: 2

rossum
rossum

Reputation: 15685

As @Sascha says, AES is available on pretty much every platform. What you have to do is to make sure that everything else is the same on both platforms:

  1. The same mode; use either CBC or CTR mode.
  2. The same IV; set it explicitly, don't use the default because it will often be different on different systems.
  3. The same key; obvious, but they need to be the same at the byte level because text can be encoded differently on different systems. Explicitly state the encoding you are using.
  4. The same padding; for AES use PKCS7, again don't rely on the default which may be different on different systems.

Whatever you chose do set things explicitly and don't rely on defaults. Defaults can differ between systems and any difference will cause decryption to fail.

Upvotes: 3

Sascha
Sascha

Reputation: 947

I would like to recommend the Advanced Encryption Standard (AES). It's very secure and i'm sure every platform has a good default implementation of this algorithm.

Have a look at the detailes: AES on wikipedia

Upvotes: 2

AnthonyLambert
AnthonyLambert

Reputation: 8830

Have you looked at MonoTouch and MonoDroid by Xamarin?

Using these libraries you could probably just use native .Net XML Services between all three and share all your backend code.

Upvotes: 2

Related Questions