6

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.

1

1 Answer 1

4

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.

2
  • Thanks! I'll try asap... but how can i 3. decrypt the string from my website (based on PHP)? Do you think that stackoverflow.com/questions/770830/… could be what i need? Thanks again! ;)
    – Vale
    Commented Oct 17, 2011 at 15:53
  • Thanks, it works but i was looking for something like "license3j" because it has all expiration date/release/etc. management tool and it could be really what i need. Unfortunately it is not compatible with Android. Do you know any "Licence Management" tool compatible with Android? I don't want to publish the application on Android Market. Thanks ;)
    – Vale
    Commented Oct 19, 2011 at 10:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.