You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OK, i now have some working code that correctly reads the base64 blobs from a new OPENSSH type key.
Unfortunately, OpenSSH have chosen a rather exotic key derivation function to derive the key from the passphrase: bcrypt_pbkdf
The only Python implementation of that that I could find is in py_bcrypt (https://github.com/grnet/python-bcrypt). I'll use that for now to see if I can actually do the decryption.
Wondering what's paramiko's stance on introducing new module dependencies? I'm thinking maybe do the import in a try..except and then throwing an exception only if someone tries to load an encrypted new format key?
@mchlt We do the "try/except/complain" for other optional deps right now, such as python-gssapi for GSSAPI support (docs). So we don't want to do it willy-nilly, but there's precedent.
That said, "a new privkey format used by OpenSSH" feels more mainstream a feature (at least going forwards) than Kerberos/GSSAPI support, so I lean towards "if we can get this implemented before I finish the other work for 2.0, let's put python-bcrypt in that release as a hard dependency".
Continuing discussion in here since not 100% sure what'll happen to #618 (it might want closing & replacing with another PR):
Support for new OpenSSH 6.5+ private key format #618 notes that Cryptography doesn't support bcrypt (specifically bcrypt_pbkdf). I'm curious whether @alex / @reaperhulk think it's worth adding to Cryptography at any point? Don't see anything over there implying such, but always nice to ask.
Assuming that's not in the works, I'm still reasonably okay with adding the python-bcrypt dependency instead. (TBH, even if Cryptography added it I wouldn't be surprised if they wrapped python-bcrypt itself, so...)
If @mchlt has time in the very near future to address that (ideally a few days; yes, asking another to get back to me in days when I tend to get back in months, is horrid 😖 ), I can squeeze this into 2.0 as originally planned, and add python-bcrypt as another new install-time dependency.
If he doesn't (which would be fine!) I'll put it into the 3.0 bucket, which is basically what 2.0 used to be.
We'd like to support bcrypt directly, but right now cryptography is (mostly) tied to OpenSSL which doesn't support eksblowfish. We do have pyca/bcrypt, which will shortly be getting wheels for OS X and even linux (via manylinux1, see PEP 513).
@reaperhulk Huh, neat - I'd still feel better about depending on a PyCA-blessed/implemented bycrypt module vs one that seems to largely be a one-off (not to diss python-bcrypt / py-bcrypt of course, but.) Thanks!
/cc @mchlt - if pyca/bcrypt serves your needs as well as the other one, maybe switching to it would be something to do while updating.
If anyone else has the spare cycles to check up on the years-old assertions I made early in this ticket, re: whether Cryptography has what we need now, that'd be awesome. I'm optimistic that this is possible to do now, if it hasn't already been done in a fork somewhere (looking at @ploxiln whose fork I do not have time to go over in detail yet).
Also VERY briefly skimming my old comments here, I'd put this in 3.0's milestone on assumption that this requires a new dependency (python-bcrypt). In the intervening years I've both relaxed my stance on that topic, and again, Cryptography has gone through a lot of development.
I'm going to move this into the p1 milestone with those things in mind - I expect we could do this in Paramiko 2.6 or whatever without making anybody too unhappy, even if it does mean a new dependency is added. Folks grabbing new Paramiko minor releases and not doing it for the new key type and being really mad about some new-to-them dependency, seems like it'd be a very small demographic.
Activity
mchlt commentedon Nov 5, 2015
Looking into this issue.
Some additional info about the key format here:
http://www.tedunangst.com/flak/post/new-openssh-key-format-and-bcrypt-pbkdf
mchlt commentedon Nov 7, 2015
OK, i now have some working code that correctly reads the base64 blobs from a new OPENSSH type key.
Unfortunately, OpenSSH have chosen a rather exotic key derivation function to derive the key from the passphrase: bcrypt_pbkdf
The only Python implementation of that that I could find is in
py_bcrypt(https://github.com/grnet/python-bcrypt). I'll use that for now to see if I can actually do the decryption.Wondering what's paramiko's stance on introducing new module dependencies? I'm thinking maybe do the import in a
try..exceptand then throwing an exception only if someone tries to load an encrypted new format key?bitprophet commentedon Nov 9, 2015
@mchlt We do the "try/except/complain" for other optional deps right now, such as
python-gssapifor GSSAPI support (docs). So we don't want to do it willy-nilly, but there's precedent.That said, "a new privkey format used by OpenSSH" feels more mainstream a feature (at least going forwards) than Kerberos/GSSAPI support, so I lean towards "if we can get this implemented before I finish the other work for 2.0, let's put
python-bcryptin that release as a hard dependency".If you haven't, you might also look to see if https://github.com/pyca/cryptography has it (this mentions pbkdf2 but I'm not crypto-fluent enough to tell if it's truly the same as
python-bcrypt's C-ext) or is willing to add it, since paramiko 2.0 will be relying oncryptographyanyways.bitprophet commentedon Nov 9, 2015
Also, thanks a lot for looking into this! ❤️
bitprophet commentedon Apr 25, 2016
Continuing discussion in here since not 100% sure what'll happen to #618 (it might want closing & replacing with another PR):
bcrypt(specificallybcrypt_pbkdf). I'm curious whether @alex / @reaperhulk think it's worth adding to Cryptography at any point? Don't see anything over there implying such, but always nice to ask.python-bcryptdependency instead. (TBH, even if Cryptography added it I wouldn't be surprised if they wrappedpython-bcryptitself, so...)python-bcryptas another new install-time dependency.reaperhulk commentedon Apr 25, 2016
We'd like to support bcrypt directly, but right now cryptography is (mostly) tied to OpenSSL which doesn't support eksblowfish. We do have pyca/bcrypt, which will shortly be getting wheels for OS X and even linux (via
manylinux1, see PEP 513).bitprophet commentedon Apr 25, 2016
@reaperhulk Huh, neat - I'd still feel better about depending on a PyCA-blessed/implemented bycrypt module vs one that seems to largely be a one-off (not to diss
python-bcrypt/py-bcryptof course, but.) Thanks!/cc @mchlt - if pyca/bcrypt serves your needs as well as the other one, maybe switching to it would be something to do while updating.
13 remaining items
Update git submodules
hunterirving commentedon May 30, 2019
I would also like to see support for this new format.
bitprophet commentedon May 31, 2019
If anyone else has the spare cycles to check up on the years-old assertions I made early in this ticket, re: whether Cryptography has what we need now, that'd be awesome. I'm optimistic that this is possible to do now, if it hasn't already been done in a fork somewhere (looking at @ploxiln whose fork I do not have time to go over in detail yet).
bitprophet commentedon May 31, 2019
Also cc @alex and @reaperhulk as usual on that front ❤️
bitprophet commentedon May 31, 2019
Also VERY briefly skimming my old comments here, I'd put this in 3.0's milestone on assumption that this requires a new dependency (python-bcrypt). In the intervening years I've both relaxed my stance on that topic, and again, Cryptography has gone through a lot of development.
I'm going to move this into the p1 milestone with those things in mind - I expect we could do this in Paramiko 2.6 or whatever without making anybody too unhappy, even if it does mean a new dependency is added. Folks grabbing new Paramiko minor releases and not doing it for the new key type and being really mad about some new-to-them dependency, seems like it'd be a very small demographic.
ploxiln commentedon Jun 1, 2019
the bcrypt dependency was already added in paramiko 2.2.0 for Ed25519 keys - #972
Force the format of ssh key to PEM, at least for now
Update git submodules
Changelog re #602