Skip to content

blued-gear/FidoKeyGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FidoKeyGenerator

With this small application it is possible to use any FIDO2 authenticator, which supports the HMAC-Secret extension, to generate as many symmetric cryptographic keys as you want.

The output depends on the used credential (created once) and an input string.
The secret will be derived from the input by the authenticator (so the same input + credential will always result in the same key).

Usage

Installation

# clone and ce into the repo
python -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Use it

Preparation to use the script from any location:

KEYGEN_DIR="<path to repo>"
source $KEYGEN_DIR/venv/bin/activate

Firstly, a credential has to be created:

CREDENTIAL=$(python "$KEYGEN_DIR/fidokeygenerator.py" --init "[email protected]")
echo $CREDENTIAL

Now you can derive keys from any input:

echo 'some input to digest' | python3 "$KEYGEN_DIR/fidokeygenerator.py" "$CREDENTIAL"


To see all options run python3 fidokeygenerator.py --help

Server Mode

In this mode the application will create a Unix-socket and listens for connections, which provide the input to digest.
By using --cache the generated secrets will be cached so you don't have to interact with your authenticator after the initial request (except when a unencountered input is sent).

python3 "$KEYGEN_DIR/fidokeygenerator.py"  --server "<path for the .sock file>" --cache "$CREDENTIAL"

Examples

Some examples are shown in my Blog: Extra factor for Monero Wallet, Key for Bormatic.

Acknowledgements

Most of the code was taken from python-fido2 hmac_secret example.

License

MIT

About

Generate symmetric keys with your FIDO2 Token

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages