twofas / 2fas-ios

Source code for 2FAS iOS app
GNU General Public License v3.0
505 stars 38 forks source link

Export function #28

Open ghost opened 1 year ago

ghost commented 1 year ago

Lacks a proper export function for importing into other apps. Suppose 2FAS stops working in the future, how do you get 2FA codes in the next app? Ravio OTP can create a QR code for each item you can scan.

2fas-com commented 1 year ago

Thank you for pointing that out, however, the 2FAS codes can be exported into a JSON file, which is supported by other applications.

ghost commented 1 year ago

How do I export them to JSON? I can export them are in .2fas

2fas-com commented 1 year ago

The exported file is a JSON file. It's just named .2fas so that it's recognisable, and you know it's from our app.

ghost commented 1 year ago

It would be more convenient if you follow the example of Ravio OTP, which can create a QR code for each item, in case a future app does not allow the amount from a json file.

pzbitskiy commented 1 year ago

You can use some bash to get QR codes from the non-encrypted backup:

jq -r '.services[] | .name + "," + .secret + "," +  .otp.link' backup.2fas |
while read -r line; do
IFS=',' read -r name secret uri <<< $line;
echo $uri | sed "s/\[hidden\]/$secret/" | qrencode -o "$name".png
done

Not ideal but works.

2fas-com commented 6 months ago

We will be working on this feature, but it currently has a very low priority. In the meantime, you can explore some 3rd party tools. There are free, open-source converters on GitHub for offline use that can convert 2FAS files into QR Codes.

Example: https://github.com/S1m0nk4c/2fas-backup-to-QR

Please be aware that this is a 3rd party solution and it is not supported by us. Additionally, remember that keeping unencrypted file with secret keys or QR codes on your computer carries a security risk.

bhall7 commented 3 months ago

This is a feature that I really miss from Raivo, the ability to print out a nicely formatted list of all my seeds with QR codes is something that would be amazing to have in 2FAS. 🤞