seiichiro0185 / sailotp

A Sailfish Google Authenticator Implementation
https://www.seiichiro0185.org/sailfish:apps:sailotp:start
Other
49 stars 25 forks source link

Import backup from SailOTP to FreeOTP+? #62

Closed jkonecny12 closed 2 years ago

jkonecny12 commented 2 years ago

Hello,

I would like to know if there is a way to transfer a SailOTP export format to FreeOTP+. Could you please help me with that?

Resolved If you want to use your export from SailOTP in the FreeOTP+ you could do it this way:

seiichiro0185 commented 2 years ago

I haven't used FreeOTP,+ and I don't know if and how an import would be possible. Since SailOTP uses its own Export format for the backup files, I doubt there is a way to directly import a SailOTP backup in FreeOTP+.

The SailOTP backup format is an encrypted JSON file. It can be decrypted outside of SailOTP using Openssl (see here: https://www.seiichiro0185.org/sailfish:apps:sailotp:manual#export_and_import). This will show the relevant data in plaintext, so you can manually add them in FreeOTP+

If you have access to an installed SailOTP, it is also possible to create a QR-Code for a token (long press on the token and choose the first option in the menu) in SailOTP that can be scanned by other OTP-Applications like FreeOTP+

jkonecny12 commented 2 years ago

Thanks for your help. I decrypted the backup and tried to write the secret as new token to FreeOTP but unfortunately it did not worked.

When I'm looking on that now, I see that the reason is probably because SailOTP uses Base64 but FreeOTP+ Base32 as you can see in screenshots here.

jkonecny12 commented 2 years ago

Unfortunately echo '<secret value from SailOTP backup>' | base64 -d | base32 doesn't work.

seiichiro0185 commented 2 years ago

The secrets itself are actually in Base32 in SailOTP as well (as this is the standard format for defined by the OTP RFCs). Only the backup file as a whole is Base64-encoded after the encryption by openssl (which is reversed by the -a flag of the openssl command from the manual).

I actually tried it just now by copying a Secret from a decrypted SailOTP backup file into FreeOTP+ via the "Add Token" menu option, with all defaults otherwise (type TOTP, 6 digits, SHA1 and 30s interval), and both SailOTP and FreeOTP+ generate the same Token.

jkonecny12 commented 2 years ago

Oh great, I tried that but I wasn't able to login to the site (don't have sailotp for confirmation available). In that case I probably made a typo.

jkonecny12 commented 2 years ago

Updated the description for others and closing this issue. Thanks for your help!