twofactor icon indicating copy to clipboard operation
twofactor copied to clipboard

After some time twofactor.TOTPFromBytes is not working

Open khawerrind opened this issue 7 years ago • 7 comments

I am using your library. Everything works fine but all of sudden after few days. I am getting this error,

Could not verify the message. Message has been tempered with!

It does work fine for few days but don't know what happens and after few days twofactor.TOTPFromBytes is giving me the error. Can you please help me in identify the issue or how to resolve it?

Thank You!

khawerrind avatar Oct 09 '17 13:10 khawerrind

@khawerrind Sorry for the delay, but I completely missed this issue. I suspect the problem is related to the keys needed to decrypt the serialised TOTP structure. Is it possible that the keys are deleted ? You could check the creation and modification time of the files created inside the keys folder and see if they differ when the problem appears.

silenteh avatar Jan 04 '18 18:01 silenteh

I'm seeing the same behavior. @khawerrind Did you fix it on your end?

impronunciable avatar May 03 '18 13:05 impronunciable

An update about this. I have found the issue and it's present in the library. I am working on a fix.

silenteh avatar May 03 '18 14:05 silenteh

@silenteh that's great. Let me know if I can help you. Do you know when you'll be able to work on this?

thanks so much for the quick reply!

impronunciable avatar May 03 '18 17:05 impronunciable

For me the keys were the issue. Since i was using docker container, i was not adding keys to the docker container. And whenever i restarted docker container new keys were being generated because of the missing old keys. So i just added keys to the docker image and everything works perfectly and never had that issue again.

khawerrind avatar May 08 '18 20:05 khawerrind

Thanks @khawerrind I noticed I'm starting the build from different paths and the lib is looking for a path relative to the cwd

impronunciable avatar May 14 '18 20:05 impronunciable

@khawerrind, could you please share your code. actually i have a same kind of project so any help regarding to that would be really nice and time saving for me. Thanks

KashifJunaido2soft avatar Oct 19 '18 07:10 KashifJunaido2soft