darinkes / sshnet.keygen Goto Github PK
View Code? Open in Web Editor NEWSSH.NET Extension to generate and export Authentication Keys in OpenSSH and PuTTY Format. ๐
License: MIT License
SSH.NET Extension to generate and export Authentication Keys in OpenSSH and PuTTY Format. ๐
License: MIT License
When generating a key pair with the following code:
var keyInfo = new SshKeyGenerateInfo
{
KeyFormat = SshKeyFormat.PuTTY,
Encryption = new SshKeyEncryptionAes256("12345")
};
var key = SshKey.Generate("test.ppk", FileMode.Create, keyInfo);
var publicKey = key.ToPublic();
var fingerprint = key.Fingerprint();
var putty = key.ToPuttyFormat();
Console.WriteLine(putty);
The output of the putty key file says there is no encryption on the file, and I can even use no passphrase to connect to the server.
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: username@devicename
Public-Lines: 6
AAAAB3NzaC1yc2EAAAADAQABAAABAQCqndBjN3SLXONx/R4LzwTRTZPqJUghtq1L
YJLPZgUqftQQ8L18c//I8EwOoVF04Qc4zSBuOhwojPA0GOrrBzyEtqKkTxRJlAOu
2Kz5dAvEhDgCH3eN4J8RoGypCaB1gTz5jW+oLvGU0fcwhJc8ocP8KrT80J1rhKGD
La36gn3QYnf3OEzXVWaT3phuPM0cv3/JZUOiFkMpfobcJw/uOqevqgbnwO7Ni5+Z
uNMi9MbDJX+zWB920jN3lscX02yP9ETW8/mjPLRMO1N28LPkp5IVjkr3PctmtND/
wWIAq3XzfWcMsxkdem9SIFdDumWO8+FNY+EqmtnnlBLaW7TvT621
Private-Lines: 14
AAABAFy7UZvbdDiaz/QQgtggOJoZ9B77DG1mgGHLp3+aD4y9Sj262wJdedSY5n29
KCzCcc5pjwraApv3nkZylJwRXs8zBMsRQBGNpULO+ZTLgenZgyeEOtKeF1bZPrXR
SakUCTQJr3pVqXAdfqCcMCcANSlFfQE70ZOyjqZhmYHiksdDGoBdDcAEr9hK06QW
QsgCLXdcqOj/CYH+3bP2rRGhdOBQ4/7cE4cRyloK6vQPrklsI59BKFQZ+eBD7t1/
/Re+xoOg4QAECkMNAkE7BfzAg3yRPyHcM9oQnmxs6jWidbuUtSymxiZTsA8UmG9V
mF1GBiSx1gXyt/pY1yraF+7eBzEAAACBAM0oPMrnR0C1vlqbkzFpYyeZJZKjRy2d
p3elclRD7gRBO11cQeFbTOSxEwdzYtXgqaREpdxddNd0AqSrisShJbjJge1BplSm
HXNXUPhF3oP+ixFQAQR+aOnsMPEpZfv8FfT+/aO3+fg1ldKOqoMkTYzVNymUbTdA
yUZaRWnOFOnLAAAAgQDU5jbFQfDEwBCwejEMNB2bIZnQZ6cipdqvD3ZfGEVKKAtz
eM9FTz/XUBoo84o4OqLcTJiByghdzxnKKBofjgN8Bc2MY577S+k6jF442QK4usi5
s+uF674sCP1gWZwKd6jezAyLaNLIN9jNaUScOO1tfUNhM2UpliQqRzb1toDWfwAA
AIAIDvVgw9pIpCPcBUmWU1hVwr83jZZqazuk5XMLBxrtKVU9cYosF3kp5sb5C5WH
knw91x08H6eT7zlCNMgBMwq197fG62F4TjZRy2hVcR/+PSqFTdVSwUYi4J5+QI7I
qYDzLEl5tMangrd4DCo4lSuBO1o+RcXtRESkuakER3JfaAECAwQFBgcICQoLDA0O
Private-MAC: 679b164a38d55c8f8b0f89b2e7d1213449bb47cb
SshNet.Keygen/SshNet.Keygen/SshKey.cs
Line 63 in 65b7f1e
The ssh private key format is inconsistent with the PUTTYGEN client
It already contains export to PuttyKeyFileFormat v2, v3 should be implemented and become the new default.
See: https://tartarus.org/~simon/putty-snapshots/htmldoc/AppendixC.html
var keyInfo = new SshKeyGenerateInfo
{
KeyFormat = SshKeyFormat.PuTTY
};
var key = SshKey.Generate("test.ppk", FileMode.Create, keyInfo);
var publicKey = key.ToPublic();
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "Varorbc@DESKTOP-TRGK209"
AAAAB3NzaC1yc2EAAAADAQABAAABAQCvUe9d3TAZpiAn6teq9iXvXLBGsda8ARvA
Zzbp95L5GqKCib2vm0stMEh8VBk6SzZ0ZIohDqNQaGl4JSTSS6hjYMMNlgrs7Whs
6Ovsj4ciDqRmIqYHAJMJQS5S9m/hFFaoQ0CDtX4Mf29u3OnTILihRTnhnK8Rco4k
FHZS3wD8ldnFnAEBeHD0TTnnmSId0SaR4/CAdN6Foy3Sj+cBUM2oeYvGERB1lMSC
ZU2BVnu61Wh9hVHeoGP6xY+e9eKv7KuXdm2hs6sh0qCVp5O5SHEzSvBWlZdZdynD
dlJsA2HlofP0rEhIV5dZbOCkjbKzB64xCGerc12JQnY911/tRYRx
---- END SSH2 PUBLIC KEY ----
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvUe9d3TAZpiAn6teq9iXvXLBGsda8ARvAZzbp95L5GqKCib2vm0stMEh8VBk6SzZ0ZIohDqNQaGl4JSTSS6hjYMMNlgrs7Whs6Ovsj4ciDqRmIqYHAJMJQS5S9m/hFFaoQ0CDtX4Mf29u3OnTILihRTnhnK8Rco4kFHZS3wD8ldnFnAEBeHD0TTnnmSId0SaR4/CAdN6Foy3Sj+cBUM2oeYvGERB1lMSCZU2BVnu61Wh9hVHeoGP6xY+e9eKv7KuXdm2hs6sh0qCVp5O5SHEzSvBWlZdZdynDdlJsA2HlofP0rEhIV5dZbOCkjbKzB64xCGerc12JQnY911/tRYRx Varorbc@DESKTOP-TRGK209
Great Project! Any non synced updates to this?
I rolled some of your changes in to the current SSH.NET, but
the case:(s) for Key names are off (ie "Renci.SshNet.Security.RsaKey" vs "ssh-rsa")
Also Looking for RSA Key encryption?
Regards,
Mike
I also used puttyfile, but there were only two files in the project, and I found the same dependencies as the current project, Is it possible to incorporate them, even Agent, as an extension of SSH. NET.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.