Type speed set to 10 causes backup file issue (SOLVED)

I created the backup on one OnlyKey, now I want to restore it to a second OnlyKey to create a backup of my first key.

However, when I restore the backup to the second OnlyKey, I’m getting the following error:

Could not parse backup file.

InvalidCharacterError: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

I opened the backup file in a text editor, and it looks ok (no strange characters).

I am also unable to restore this backup to the very same key that I created the backup from.

I am on Windows 10 with the latest version of the OnlyKey App (v5.3.0) and the OnlyKey firmware (v2.1.0-prodc).

What am I doing wrong here?

What keyboard profile do you use?

Can you try again to see if it was just a one time issue like clicking outside of the backup window while backup was typing?

Try to open the backup file in a monospace text editor (code editor, IDE or terminal text editor like vim and nano). A correct backup should:

  • Begin with -----BEGIN ONLYKEY BACKUP-----
  • End with -----END ONLYKEY BACKUP-----
  • All the lines in the middle, except the last line (which is the second last line of the backup file), have the same length 76

If it does not match, then your backup file is likely to be corrupted.

I’m using US keyboard layout. I have typing speed set to 10 (maximum).

The OnlyKey is connected to the computer via an Anker USB hub. I didn’t have any issues with it so far.

I am positive that I didn’t click anywhere else, and I have tried several backups, with the same result each time.

My file has a varying number of characters between the BEGIN and END blocks. I found out that this is due to the keyboard type speed I set (10, the fastest). When I change it back to the default of 4, I am getting a well-formatted file.

This actually seems to be an issue of the software. With typing speed 10, I get a well-formatted file as well in Windows Notepad, but not in the OnlyKey software.

Do you know why this happens?

This is very likely a corrupted backup since all the backups I created are exactly 76 characters per line except for the last line. It may be caused by too fast typing. Since it works normally in notepad.exe, I guess it may be a performance problem with the graphics framework of OnlyKey App.

Indeed, see my above reply, and thanks for your help / suggestion. The curious thing is that I don’t get an issue in Windows Notepad or Vim at speed 10, but only in the OnlyKey app. Seems like there is an issue with the text widget that garbles the input at high speed. Should I file a bug report on Github?

I believe so. In fact, on my Windows machine, if I set the typing speed to 10, the OnlyKey App will just stop responding after the backup starts…

On to the next problem:

Now I want to restore my backup to a second OnlyKey to create an identical backup key.

I put the key in config mode by pressing “6” for more than 5 seconds. The LED turns off. I enter my primary PIN, and the LED flashes red. I select my well-formatted backup file and click on “Restore to OnlyKey”.

The instructions say that the LED should be yellow while restoring. However, it stays red, and after 1-2 seconds, it flashes red three times, then it reboots.

If I enter my primary key again, I don’t see that any slots have been restored. It looks like nothing happened.

Why did the restore fail?

Is there a log that I could inspect to get more details?

What is meant by “backup key” vs. “backup passphrase” (also see my other topic)?

I again set the “backup passphrase” of my original OnlyKey to the same that I did before and created the backup. Now the restore worked ok on the second key.

The only rational (IMO somewhat unlikely) explanation would be that I did the same typo twice when I set the “backup passphrase” on the original OnlyKey. The fact that the GUI does not show the passphrase when entering it doesn’t help here.

What would be be good if the app would show more diagnostics if something goes wrong during the restore. For instance, it would say “Backup passphrase mismatch”, then diagnosis would be a lot easier for the user.

The app just has a text box where your OnlyKey types into, I would expect that with type speed set to 10 the issue was that the OS was unable to keep up with such fast typing.

As I said, I tested it several times in:

  • Windows Notepad – no issues
  • Vim – no issues
  • OnlyKey UI – garbled output file

So I believe the issue is specific to the text input widget used by OnlyKey UI.

As a “workaround”, I have decided to leave typing speed at 10 and use Notepad or Vim to generate the backup file.