Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RSA Encrypt and Decrypt Strings on Android

I'm reading pages and pages since weeks but I cannot find a solution. I want "only" to:

  1. Make my own public and private keys to encrypt and decrypt strings between my PHP website and Android application (like on http://www.example-code.com/android/rsa_generateKey.asp but how can I store and use the generated keys?)
  2. Encrypt a string on my application
  3. Decrypt the string from my website
  4. Encrypt a string on my website
  5. Decrypt the string from my application

I've just found a class that does simply this job ( http://www.example-code.com/android/rsa_encryptStrings.asp ) but it is not free, and to make it work on PHP I should install a PHP extension but I can't on my web hosting.

Is there something similar? I'm studying a lot but I don't know why I don't understand how to do it in different ways.

Probably something similar to

RSA Android Encrypt / RSA PHP Decrypt

could help but it is not the complete source code.

Please give me some real working examples.

like image 278
Vale Avatar asked Oct 16 '11 21:10

Vale


1 Answers

this should do it.

http://www.javamex.com/tutorials/cryptography/rsa_encryption.shtml
http://www.javamex.com/tutorials/cryptography/rsa_encryption_2.shtml

It's not an android question, much more Java.

like image 137
jarCrack Avatar answered Sep 20 '22 17:09

jarCrack