Skip to content

Powershell module and library (C#, netstandard2.0) to convert Putty (PPK) keys into text (pem) format

License

Notifications You must be signed in to change notification settings

MVKozlov/GMPPKConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Powershell Module: Putty key parser/converter

Putty key converter as c# class can read putty v2/v3 keys and convert it to keys suitable to use with .NET SSH modules such as Renci.SshNet

Powershell module was written as companion to Posh-SSH module

As well as Posh-SSH this module is for Windows PowerShell 5.1 or PowerShell 7.x., On Windows Server, version 1709 or older .Net Framework 4.8 or above is required for the proper loading of the module.

Usage example

$cred = Get-Credential
$KeyString = Get-Content D:\Putty.ppk | ConvertFrom-PPK -AsPrivate -Password $cred.Password
New-SSHSession -ComputerName myserver -Credentials $cred -KeyString $KeyString

Breaking change in v1.1.0.0 (may be)

By default cmdlet now return passphrase protected key. It may be breaking change if the credentials used to convert the key do not match those used to connect.

Notes

  • Konscious.Security.Cryptography.Argon2 used for ppk v3 decryption used as source in library, it modified to disable hardware acceleration to work without System.Numerics.Vectors which not available to netstandard2.0
  • BCrypt.cs used in openssh key encryption, (c) 2006 Damien Miller [email protected], (c) 2010 Ryan D. Emerle

TODO

  • Back Conversion
  • Non-ASCII Passwords under linux

About

Powershell module and library (C#, netstandard2.0) to convert Putty (PPK) keys into text (pem) format

Resources

License

Stars

Watchers

Forks

Packages

No packages published