Faking a signed string for Google Android In-App purchase

I am verifying a signed string from Android inapp purchases, I know enough to have written a server based independent verification to check that the string is signed with my public key and the private key sent in the JSON response, thats fine. Where my knowledge is lacking, wouldn't it be possible for people, if they have access to my public key, to be able to sign a string with a private key and send a response to my external server, which would successfully validate?

I am probably missing something, but on my iPhone app I contact Apple, they contact the app back, I contact my server with apples response, it contacts apple and independantly verifies the response, I do the same for my WP7 app with PayPal, with Google, I am not connecting to Google to verify the string, I am just checking the string is signed with my Keys, is this truly enough?

Thanks

This question and answers originated from www.stackoverflow.com
Question by (8/8/2011 12:18:24 PM)

Answer

In short, no. You can read up on RSA if you have the time, but the whole point of asymmetric algorithms (where the key you encrypt/sign is different from the one you decrypt/verify with), is that is practically impossible to figure out the other half of the key if you only have one. Thus, if someone has your public key, you can be pretty sure they cannot produce the private one. Alternatively, if they just generate a new key, when you verify the signature, you will get a verification error.

If your nonces are truly random and really only used once, they cannot replay the same message either, so you should be reasonably safe. (assuming there are no implementation problems)

What you should be more worried about is people using bytecode patching tools to bypass the whole validation process and just return true from the isLicensed() method.

Answer by

Find More Answers
Related Topics  android  rsa  in-app-purchase  signing
Related Questions
  • Android In-App Purchase

    Presently I am developing one application in android.I want to implement in app purchase in my app when i click a button. Please help me with simple example to implementing in app puirchase for o…
  • Android In-App purchase Google checkout

    I am considering to do an in-app purchase model within a paid app that releases or adds video content if the user opts in via a google check out method. Does anyone know how to do this from a coding…
  • Android In App Purchase "Item that you have requested is not available for purchase" Error

    I am working on In App billing ans from last few days i have got stuck at this point. I have created Product list for my App which is Saved as Draft on Market. But when i run my Application on De…
  • In app Purchase issue in android

    I have successfully test product id (i.e android.test.purchased etc.) in my app but I am getting exception with real product id..any help will be appreciate. I have also published inappproduct list …
  • Is it OK to provide In App purchase in a free android app?

    Is it possible(or OK) to provide in-app purchase in a free android app? I want to create one app that will be free for a limited time. User will be prompted to pay for it after few months. My app ha…
  • set a time limit on feature then force in-app purchase android

    I would like to implement a feature in my application that allows the user to use the app for two weeks, then forces the user to do an in-app purchase, or the app no longer works. Is there a way to …
  • Purchase in app

    I am a new one for Android development. I am wondering about how to purchase in app. How to begin this feature ? Is there a documentation or API doc? Thanks in advance.
  • In-app-billing on android (purchase confirmation, json string)

    I'm having problems with coding payments. This is a web game and here's how I would like the payments to work. You got to a site and click a button(buy). You are redirected to a site that will…
  • PayPal In-App Purchase for Android OS - Server/Client Model

    We are writing an application for Android OS which communicates with a server to perform its operations. This application is subscription based and it's the responsibility of server to let the de…
  • In-app billing and in-app-purchase

    I have been looking into in-app billing on developer.android.com site but it is useless. I have also installed and looked into their sample app but I still don't understand what to do. because they …