Question: Is this API authentication technique easily hackable?
apiKey = "123456789" apiCallId = "1256341451" apiSecret = "67d48e91ab2b7471d4be2a8c2e007d13" sig = md5(apiKey + apiCallId + apiSecret) = 09c297a354219f173bfc49c2e203ce03
where
apiKey
: some unique identifier for the userapiCallId
: a unique integer that must be increasing in value (e.g. UNIX time stamp)apiSecret
: string known only to the user, and us - not passed in URLsig
: "unhackable" signature of this API call - MD5 hash
Example API call:
This API does not require a session, and is not designed for a 3rd party to use on behalf of a user. Instead, it is to be used by the user themselves.
I really like the simplicity of this. The requirement of apiCallId
being unique, and always increasing means reusing a sig
is not possible, so I feel like it is secure (protected against replay attacks), but I am not an expert.
Other APIs use all of the GET parameters sorted alphabetically when calculating the sig
, but I do not see why this is necessary when including apiCallId
.
Please try and hack this now before it is implemented and released :-)
I welcome any feedback, suggestions and security education.