GithubHelp home page GithubHelp logo

svareille / onlykey-backup-reader Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 295 KB

Read and use an OnlyKey backup from the terminal.

License: GNU General Public License v3.0

Rust 100.00%
rust tui onlykey

onlykey-backup-reader's Introduction

OnlyKey backup reader TUI

Tests GitHub release (latest by date)

Read and use an OnlyKey backup from the terminal.

main screen

Summary

OnlyKey backup reader is a terminal user interface (TUI) application written in Rust that enables you to view and use an OnlyKey's backup as if it was loaded on an actual OnlyKey.

In case you lost access to your OnlyKey and don't have a spare one available, you can use this application as a temporary replacement.

You can also use this app to obtain a raw unencrypted backup. Use the -r option to save this raw backup to a file. The best way to read this file afterward is to open it with an hexadecimal editor. The format of the backup is described in backup-format.md.

This app won't modify the backup.

Backups for the OnlyKey Duo should work too, but not tested.

Features

OnlyKey backup reader currently supports the following features.

Backup decoding

  • Read passphrase-protected backup
  • Read ECC-protected backup
    • With X25519 key
    • With NIST256P1 key
    • With SECP256K1 key
  • Read RSA-protected backup

Data displayed

For both profiles:

  • Label
  • URL
  • Username
  • Password
  • OTP
    • OATH-TOTP (Google Authenticator)
    • OATH-TOTP Seed
    • Yubico OTP
    • Yubico OTP Seed

For other data:

  • ECC private keys (currently only the first 16 keys (101-116))
    • X25519
    • NIST256P1
    • SECP256K1
  • HMACSHA1 secret
  • RSA private keys

Notes

Yubico OTP

Yubico OTP is a counter-based OTP. Therefore, any backup made before using a Yubico OTP would be desynchronized (the counter of the backup would be lower than the counter of the key). To overcome this OnlyKey backup reader enables you to increment the counter (by pressing +).

Given that I don't use this feature, the testing process has been quite light. This should work, but I can't guaranty it.

Feel free to create an Issue if you find a bug.

Uncovered data

FIDO and FIDO2

Displaying FIDO and FIDO2 keys without actually using them would be of little to no use. I don't plan to support them for the moment.

Usage

$ okbr.exe --help
okbr 1.1.0
svareille
A cross-platform OnlyKey backup reader

USAGE:
    okbr.exe [OPTIONS] <BACKUP>

ARGS:
    <BACKUP>    Path to the OnlyKey backup to load

OPTIONS:
    -h, --help                 Print help information
    -q, --quiet                Less output per occurrence
    -r, --raw-output <FILE>    If present, store the decrypted raw backup in the specified file
    -v, --verbose              More output per occurrence
    -V, --version              Print version information

Inside the TUI:

  • Navigate between panels with Tab and Shift+Tab.
  • Use the keyboard's arrows to move inside a panel, and Enter to select selectable things.

Anywhere:

  • Press q to immediately quit the app.
  • Press h to display an help popup.
  • Press s to toggle the visibility of secrets.
  • Press Escape to quit current popup.

When a profile panel is on screen:

  • Press l to copy the label into the clipboard.
  • Press U to copy the URL into the clipboard.
  • Press u to copy the username into the clipboard.
  • Press p to copy the password into the clipboard.
  • Press o to copy the OTP into the clipboard.
  • Press O to copy the OTP seed into the clipboard.
  • Press r to reload (recompute) the OTP.
  • Press + to increment the OTP counter (for Yubico OTP).

When an ECC key is selected on the general panel:

  • Press k to copy the private key into the clipboard.

When an RSA key is selected on the general panel:

  • Press k to copy the private key into the clipboard as the concatenation of hexadecimal p and q parameters.
  • Press K to copy the private key into the clipboard as a PKCS#8 PEM.

Security considerations

Using this app exposes both the backup and it's decryption key to the computer running it. Therefore only use it as a last resort, and exclusively on a computer you fully trust.

However, this is as safe as loading both the backup key and the backup on an OnlyKey from the same computer. For more security, load the backup key and the backup from two different computers. That way, no device would knows both the backup and the key at the same time.

onlykey-backup-reader's People

Contributors

svareille avatar

Stargazers

Wof3YldPjOvDh9xe avatar  avatar Alex avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.