in Education by
If I offload verification to a remote server, I think the process will be something like: Android Market Application Remote Server |--------IN_APP_NOTIFY------->| | | |-----nonce----->| | |<----nonce------| |<-GET_PURCHASE_STATE_CHANGED-| | |---PURCHASE_STATE_CHANGED--->| | | |--verification->| | |<-verification--| If I understand correctly, the nonce is to reduce replay attack vulnerability and the verification is to reduce spoofing vulnerability. Also, the reason the docs recommend offloading security processing is that the verification step requires access to my public Android Market publisher's key and the goal of the remote server is to keep said key from needing to be included/computed in my code. First question, is there a security reason for the remote server to do the nonce generation/check? Pressuming the verification step is done correctly, we'd find out from the remote server if the message was spoofed. So it seems to me that the nonce is just there to detect someone rebroadcasting the IN_APP_NOTIFY. Second question, why does it matter if our public key is a literal string? The docs say, "you do not want to make it easy for a hacker or malicious user to replace the public key with another key." I'm not clear how someone could exploit my app even if they could edit the binary to include a malicious public key without having to resign the app. Third question, won't I have all these same problems trying to verify the verification from my remote server (e.g. storing public key to my remote server in the application)? Fourth question, is all of this extra security for naught if I want to store the results of this purchase verification on the phone (i.e. I don't want to have to verify the purchase state of the unlocked content whenever a user accesses the content)? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
First question, is there a security reason for the remote server to do the nonce generation/check? Yes, the server should generate the nonce, and do the check. As a general rule, everything security-related should almost allways be done in the server. A nonce is a "number only used once". So, the correct thing for the server is to: generate and save a nonce. receive an answer. if the answer contains a saved nonce, check the signature and process it. ERASE THE NONCE. if the answer contains an unsaved nonce, it is most probably a fabricated/replicated one, so discard. Second question, why does it matter if our public key is a literal string? A little if you perform security checks on the aplication, completly irrelevant if you do your work on a server (as you should). If you perform security in the aplication, then the aplication can be hacked to bypass the security. One technique is to change the public key, wich is easier if it is saved as a single string. Third question, won't I have all these same problems trying to verify the verification from my remote server (e.g. storing public key to my remote server in the application)? No you won't. No one can access/change the code of the server. At least as "easy" as the can in the aplication. Fourth question, is all of this extra security for naught if I want to store the results of this purchase verification on the phone (i.e. I don't want to have to verify the purchase state of the unlocked content whenever a user accesses the content)? Well, it depends. The "securest" way to implement in-app purchases having a server implies: you save your "purchasable" content in the server. If a user buys it, you download it to the aplication, and you save it in some way hard to "copy" to another phone. from the server, only send content if the verification process is done correctly IN THE SERVER. from the aplication, if you detect no "saved" content, perform a "restore transactions" operation, and then download everything you need from the server. google play's in-app purchases are not designed to provide content easily, it is designed to perform purchases from a centralised site and so, easyer for the user. We developers end up with a LOT of work to use it.

Related questions

0 votes
    If I offload verification to a remote server, I think the process will be something like: Android Market Application Remote Server |-------- ... | | |-----nonce----->| | || | |...
asked Feb 9, 2022 in Education by JackTerrance
0 votes
    I trying use Dungeons example in my app. In Android development guide it's written that I should confirm ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 20, 2022 in Education by JackTerrance
0 votes
    I trying use Dungeons example in my app. In Android development guide it's written that I should confirm ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Aug 1, 2022 in Education by JackTerrance
0 votes
    Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle. ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I made a website and turned it into Android app, using Phonegap website. I have files stored on a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
0 votes
    I'm using SafetyNet API for checking if device is rooted or not and using the below helpful code but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 19, 2022 in Education by JackTerrance
0 votes
    I want to know whether the user allows autostart permissions of the app. I have already tried this: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 10, 2022 in Education by JackTerrance
0 votes
    My application crashes whenever my location is changed. Application structure is simple: there is one Activity and ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I'm having a problem with my logcat since update 1.2 Beta for Android Studio. When I run my app ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I am creating an Android app that will download and cache PDF files (the files are for issues of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I have an app that was designed for the Google 2.2 api (it includes maps) and I want to make it ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I'm designing a service that will comprise a cloud-based database (with a UI for us to manage the data), ... sit behind mobile apps. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Is there a way to know who is the application caller? These are several use cases cases: I have ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 16, 2022 in Education by JackTerrance
0 votes
    I found the following piece of code from the adw launcher: Object service = launcher.getSystemService("statusbar ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 13, 2022 in Education by JackTerrance
...