Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
paramiko.ed25519key
#2
As a preface, let me just say that I'm not sure what's going on, how it's supposed to work, or why it's acting the way that it is. What follows is just a few things that stand out to me, to hopefully help you track down what else you can try.

But first, when sharing error messages, please include the entire traceback. Which files are throwing the errors, for example, is very useful info.

Your comment says this: SHA256: RLh...kP+Ido=. SHA256 is a one-way hash, and CANNOT be decoded/reversed/etc. But a sha has doesn't have "+" or "=" in them (it'd be all alphanumeric), but those things ARE in a base64 encoded string. So that might be what decodebytes is doing, to try to get the sha hash maybe?

But paramiko is open source, so we don't have to guess: https://github.com/paramiko/paramiko/blo...at.py#L118
Quote:
decodebytes = base64.decodebytes
encodebytes = base64.encodebytes
So decodebytes is literally just base64 decoding, with nothing else happening.

Which means to me that your key isn't valid base64, for whatever reason. Here's an example of valid base64 encoded text:
>>> import base64
>>> x=base64.encodebytes(b"foo bar")
>>> x
b'Zm9vIGJhcg==\n'
>>> y = x.strip()
>>> y
b'Zm9vIGJhcg=='
>>> base64.decodebytes(y)
b'foo bar'
>>> base64.decodebytes(x)
b'foo bar'
You can see that I tried stripping off the trailing whitespace, to see if that would matter (it did not). The = is absolutely necessary, though, as it pads the string to a multiple of 4 characters.
Reply


Messages In This Thread
paramiko.ed25519key - by cverm - Nov-30-2018, 08:31 PM
RE: paramiko.ed25519key - by nilamo - Nov-30-2018, 09:25 PM
RE: paramiko.ed25519key - by cverm - Dec-03-2018, 01:18 PM
RE: paramiko.ed25519key - by nilamo - Dec-03-2018, 05:11 PM
RE: paramiko.ed25519key - by cverm - Dec-06-2018, 01:04 PM
RE: paramiko.ed25519key - by nilamo - Dec-06-2018, 03:45 PM
RE: paramiko.ed25519key - by cverm - Dec-06-2018, 08:26 PM
RE: paramiko.ed25519key - by nilamo - Dec-06-2018, 08:39 PM
RE: paramiko.ed25519key - by cverm - Dec-07-2018, 11:47 AM
RE: paramiko.ed25519key - by nilamo - Dec-07-2018, 03:59 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020