Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please expain how to make compatible keys: #417

Closed
AndKe opened this issue Oct 31, 2021 · 3 comments
Closed

Please expain how to make compatible keys: #417

AndKe opened this issue Oct 31, 2021 · 3 comments

Comments

@AndKe
Copy link

AndKe commented Oct 31, 2021

I tried to use this example:
https://asyncssh.readthedocs.io/en/latest/#id14

Generated keys with password, using ssh-keygen, but than I get:

asyncssh.pbe.KeyEncryptionError: OpenSSH private key encryption requires bcrypt with KDF support

How can I satisfy that error? :)

@ronf
Copy link
Owner

ronf commented Nov 1, 2021

You should be able to use “pip install bcrypt" to install the “bcrypt” package (version 3.1.3 or later) to get what you need here. See https://asyncssh.readthedocs.io/en/latest/#optional-extras for more information on optional packages you can install.

You'll then need to provide the passphrase you used to create those keys in any calls you make to AsyncSSH which refers to them, at least in cases where you need access to a private key.

@AndKe
Copy link
Author

AndKe commented Nov 1, 2021

thank you, please consider makeing the error message contain this information. "pip install bcrypt" would be a nice clue :)

@AndKe AndKe closed this as completed Nov 1, 2021
@ronf
Copy link
Owner

ronf commented Nov 2, 2021

I'm hesitant to be that specific, as not everyone uses "pip" as their installation method. Some folks use packages from their Linux distribution, and others might use something like easy_install or even install packages manually using something like the setup.py script.

The error's mention of "KDF support" was because there were actually two different "bcrypt" packages on PyPI. Back then, "bcrypt" was the main package but it didn't support the KDF functionality needed by AsyncSSH, and so you had to install "py-bcrypt" instead for AsyncSSH to work. However, this was fixed in the bcrypt 3.0.0 release, eliminating the need to use the other version. As of 3.x, the main bcrypt package now works fine for AsyncSSH's needs, and AsyncSSH's optional dependencies were updated to reflect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants