r/ComputerSecurity • • Oct 10 '19

Is it possible to reverse engineer shared secret key from 2FA app if I have access to it?

I would like to extract shared secret key from my 2FA banking app so I can uninstall it from my phone.

0 Upvotes

13 comments sorted by

3

u/[deleted] Oct 11 '19

What do you mean, ‘reverse engineer’ a key?

1

u/Emergency_Chipmunk Oct 11 '19

I'm new to the subject so I don't know much and I wanted to keep it short and didn't want to complicate.

I guess I worded it incorrectly. I'll stop using "reverse engineer" term to avoid further confusion and explain in other way instead.

I thought if I have access to one-time passwords I could use that information to get to the shared secret key (or how else it's called) and import that to my 2FA android app that I usually use.

In my 2FA app when I press enter details (as opposed to just scanning qr code) it presents me with a couple of fields: Type (TOTP / HOTP), Secret, Period, Digits and Algorithm (SHA1 / SHA256 / SHA512). I figured if I know otps because I have access to my banking app that generates them, I would know everything except for the Secret. I can tell it's TOTP, I can measure period with stopwatch, i can see how many digits are there from otps generated and I have 3 tries to guess algorithm.

Maybe that's not feasible but I hope it's explained better.

1

u/[deleted] Oct 12 '19

I get it now. The short answer is no. There should be no way for you to derive a key from anything if the system has been designed correctly. The point of these kinds of things is that they're unique per instance/device if you could somehow copy it somewhere else that would compromise the whole system.

OTPs or SMS codes or whatever systems use for MFA are random. They can't be generated in a predictable way associated with the key because that would lead to vulnerabilities.

Check out the book Practical Cryptography - you might find it interesting.

1

u/Emergency_Chipmunk Oct 13 '19

In the meantime I learned that OTPs are product of a hash function, so yes, there is no way to get to the Secret. Solution to this problem became more complicated than I care to handle at this time so I'll lay it off for now. I looked up the book and saved it for future reference. Thanks for the reply.

3

u/takatori Oct 11 '19

And then do what with it?

0

u/Emergency_Chipmunk Oct 11 '19

Import it into 2FA android app that I use for all other 2FAs. I don't need the whole 100MB banking app, I just need the part that generates one time passwords that are used to log into online banking or verify a purchase

1

u/chopsui101 Jan 15 '20

just go to each program and disconnect google auth and up a different on on it.

1

u/[deleted] Oct 11 '19

Nah dude, that's the whole point. Unless there is a flaw in the app, no. Even then what're you gonna do, write your own app?

1

u/Emergency_Chipmunk Oct 11 '19

I should've created a longer post, because it seems I created a lot of confusion. The banking app takes 100MB of space on my phone and I absolutely don't need it, except for the part that generates otps that are necessary to log in online banking and verifying online purchases.

If I could extract that part I could import it in 2FA android app that I use for all other 2FA logins.

1

u/Spncrgmn Oct 11 '19

How would getting a key let you uninstall an application that is on your own personal phone? You should be able to uninstall it on your own.

1

u/Emergency_Chipmunk Oct 11 '19

I can uninstall banking app, but it's also used for generating otps that I need to log in online banking and verify online purchases. I just need the part that generates otps and it would be useful if I could somehow "extract" it and import it to my usual 2FA app so I can uninstall 100MB banking app.

1

u/rokejulianlockhart Sep 26 '24

You'll want to see https://security.stackexchange.com/q/11133/217497. Unfortunately, it should be infeasible. I'd love to accomplish the same.

0

u/CHatton0219 Oct 11 '19

2-fluoro-amphetamine? I wouldnt be doing keys of that man. I think its cardio-toxic. Lol