I have a requirement of OTP applications on mobile devices not sharing the same secret (even if the mobile devices are owned by the same user). A single secret must be present in a single device.
Open source applications that implement OTP (like Google Authenticator and FreeOTP) do not satisfies my requirement: the secret is not device unique, due the fact that I can scan the QR-Code with more than one device and backend never will know about that. I think it is not something related with the application itself, but with the RFC 4226 that not specifies this requirement.
So I thought about a process to mitigate the risk of users using OTP secret in more than one device (need internet connection - not a requirement be offline). The steps:
- App generate unique secret protection key on first execution
- App send the secret protection key to the server
- Server generate a unique secret for app
- Server encrypt the secret using the secret protection key from the app and return the blob to the app
- App decrypt the info using the generated key and starts to generate OTPs
- Both encrypted secret and secret protection key would be storaged on app
I know that this approach is not tamper-proof and the secret could be restored from storage but would be more difficult.
About all explained here, my questions are:
- Would be a good approach exchange OTP's secret through web, even if it is protect by TLS?
- Is the unique secret protection adding security or a flaw to the process?
- Would be possible to achieve a similar result in a offline sync?
- Is there open source frameworks to achieve a better protection of the secret key (i.e. not exposing directly to user, like QR-Code does)?