Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[andOTP] cannot import, file corrupted or password wrong #162

Closed
SuperSandro2000 opened this issue Dec 24, 2019 · 20 comments
Closed

[andOTP] cannot import, file corrupted or password wrong #162

SuperSandro2000 opened this issue Dec 24, 2019 · 20 comments
Assignees

Comments

@SuperSandro2000
Copy link
Contributor

I wanted to import an encrypted andOTP backup and I get this error:
image

I copied the file from one of my backups and from my phone directly and the password from my password manager. I get no other error in the console. It could be that the password it the long as I have a 100+ char one.

Importing plain text works like a charm.

@calisro
Copy link

calisro commented Dec 25, 2019

Doesn't work for me plain or encrypted. I think the new andotp for android uses RSA?

@paolostivanin
Copy link
Owner

@SuperSandro2000 are u using the latest version? (should be 0.6.3)
I'm asking because andOTP changed the encryption algo some time ago, so now OTPClient only supports the latest version.

@calisro what error are u getting? It's weird that both plain and encrypted do not work

@SuperSandro2000
Copy link
Contributor Author

@SuperSandro2000 are u using the latest version? (should be 0.6.3)

Yes, 0.6.3.1.

@paolostivanin
Copy link
Owner

For me it works. I can import both encrypted and plain backup 🤔
I'd need you to provide me with a sample backup file that triggers the issue, because I can't reproduce it :(

@SuperSandro2000
Copy link
Contributor Author

SuperSandro2000 commented Jan 15, 2020

Did you try it with BattelNet Authenticator and Twitch included in the backup?

@paolostivanin
Copy link
Owner

paolostivanin commented Jan 16, 2020

Nope because I don't have either of them. What's so particular about them? 🤔

@SuperSandro2000
Copy link
Contributor Author

They have a different length. Battle.net is 8 numbers and twitch 7. Also the timeouts vary. See https://github.com/andOTP/andOTP/wiki/Shared-secrets

@paolostivanin
Copy link
Owner

I was actually able to import andOTP data with a battle net account in it 🤔 will try with twitch, but it would be faster if you could send me a reproducer 👍

@hwoarang
Copy link

hwoarang commented Mar 8, 2020

I do have the same problem using 0.6.3.1 and otpclient 2.1.0. The strange thing is that the application is asking for 'decryption password' even when I try to import a plain json file.

Edit: OK my problem was basically 'wrong usage'. When I opened the app for the first time I was asked to create or import a DB. So I naturally assumed that I could just import the andOTP json file. What I needed to do was to create a brand new DB and then import the andOTP file :)

@paolostivanin
Copy link
Owner

@hwoarang glad you solved :) but good point, that's currently not very clear. I'll fix it with the next release 👍

paolostivanin added a commit that referenced this issue Mar 9, 2020
fix an issue encountered by a user and reported in #162
@paolostivanin paolostivanin added this to the 2.2.0 milestone Mar 23, 2020
@paolostivanin paolostivanin removed this from the 2.2.0 milestone Apr 9, 2020
@paolostivanin
Copy link
Owner

paolostivanin commented Apr 9, 2020

I'm closing this until someone is able to provide me a reproducer!

@SuperSandro2000
Copy link
Contributor Author

When I import the backup in plain text nothing crashes but when I import the encrypted one it has an error. I am not sure how to strip private information or edit the encrypted backup so I sadly can't provide you with a working example.

@paolostivanin
Copy link
Owner

paolostivanin commented Apr 11, 2020

@SuperSandro2000 if you're willing to help me debug this issue, I can work on it, no problem :) I really would like to find and fix this bug.
What about we do the following:

  1. I will develop a cli that will export your data in the andotp encrypted format
  2. the export operation will replace only the secret with some random chars
  3. all the other fields will remain the same
  4. you send me via email the exported backup

If you agree with that, I'll proceed with developing a simple CLI for that. What do you think?

@SuperSandro2000
Copy link
Contributor Author

I did some further testing and it has nothing todo with the content of the backup. My password is just to long and somewhere it is overflowing I guess.

Here is a dummy backup with the password 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
otp_accounts.json.aes.zip

@paolostivanin
Copy link
Owner

nice, thanks! Imma look into it asap :)

@paolostivanin
Copy link
Owner

paolostivanin commented Apr 13, 2020

Using a python script:

Iterations: 3210
Salt: (12) 0xff6e45cdd4e25fbbdbb0f19d
Pbkdf2 key: (32) 0x31836a3c670ddda59c65e43e34a67bc2ee314bb21d2c159bf8ca9168489ddc67
IV: (12) 0x1c220cf9a608217ecb82ab30
Auth tag: (16) 0x747087753ee3b8b7cfb979b695335771

with otpclient:

Iterations: 3210
SALT: ff6e45cdd4e25fbbdbb0f19d
PBKDF2 Key: 20d5368b3af99bb2f3eb40a3d35d3a94e9ea0c74d74636457a0f8b3c967
IV: 1c22cf9a68217ecb82ab30
Auth tag: 747087753ee3b8b7cfb979b695335771

Some weird thing is happening when otpclient derives a long password...

@paolostivanin
Copy link
Owner

Found the error and fixed it :) thanks a lot @SuperSandro2000 for your help!
It was weird because, for some reasons, this bug was happening only with very long backup password.
But now it's gone. Forever (hopefully). 🥳

@paolostivanin
Copy link
Owner

If you confirm me it's fixed, I'll publish a new release :)

@SuperSandro2000
Copy link
Contributor Author

Worked with the example and my real backup! Thank you very much!

@paolostivanin
Copy link
Owner

Niceeeee :D
I'll prepare a release later today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants