Answer the question
In order to leave comments, you need to log in
Signing http requests
There is some kind of API for mobile applications that needs to be protected. I would like to sign requests in order to discard unsigned requests or requests from blocked clients when accessing the backend.
Are there ready-made practices, cases for such tasks?
Now the following scheme is emerging, but due to the peculiarities of thinking it is difficult for me to assess its sufficiency:
The application receives an api-key when it first accesses the backend. In addition, a secret string is hardwired into the application, which is known only to the client and the backend and which is not passed between them.
After receiving the api-key, the application signs each request with a string generated from the api-key + secret + something else.
sign = hmac-sha1( api-key + secret + md5(request data) )
Answer the question
In order to leave comments, you need to log in
I used a similar solution for myself, I just added the creation date:
ApiKey="iphone_key", Signature="a048d4fb029cc191874ebb787893e708", Created="2013-08-28T17:43:09+04:00"
By the creation date, you can cut out obsolete requests ( for example, which were created earlier than 5 minutes ago). Otherwise, by intercepting the request, it can be used at least a year later.
Well, all important operations (billing, passwords) are of course via https.
There is no protection. You can always hack apk or ipa and see what's what. We also made signing and https, but this is more likely from those who want to figure us out in five minutes. Who needs it - will open it. We are ready for this.
OAuth is not about anything at all.
The salt on the left is bad :)
I can sign any request without knowing the key using the length extension attack.
You can read the OAuth 2.0 RFC 6749 standard .
There, by the way, it is written that the secret cannot be stored on the client, it is used for northern interaction.
I had a similar solution - all AJAX requests were encrypted by blowfish using the user's password, which he specified during login
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question