Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: regedit SshHostKeys

@Kal84: As I wrote above: "What WinSCP stores into the registry is a full host key." So no, it does not come from the fingerprint. Quite on the contrary. The fingerprint comes from the full key. But as I also wrote, "you can store the fingerprint into the registry too".

regedit SshHostKeys

I am also looking at the \Software\Martin Prikryl\WinSCP 2\SshHostKeys key and seeing the hostkeys data in a format like below:


I would like to know how I can generate these values; I am assuming they come from the fingerprint, e.g. 12:34:56:78:90:12:34:56:78:90:12:34:56:78:90:12.

Re: In what format are SSH host keys stored?

The first format in your post is just a SHA-256 fingerprint of the host key.
What WinSCP stores into the registry is a full host key.
Why do you want to store the key into the registry manually?
Note that you can store the fingerprint into the registry too.

WinSCP .NET assembly does not use the registry nor the INI file. In the assembly, you are supposed to set the SessionOptions.SshHostKeyFingerprint:

Though the latest beta can actually use the registry cache with its new SshHostKeyPolicy.AcceptNew mode:

In what format are SSH host keys stored?

If I access an SFTP server that returns the following public key:

...and then I access the following Registry location:

...the public key has been stored like this:

What format is that?

The reason I ask is that I have a use case where I need to manually add a public key to the registry, but that would require reproducing that format.

As a follow-up question, if it would be better to use the winscp.ini file instead, how do I configure the .NET WinSCP assembly to use this file, rather than the registry?