Xceed .NET Libraries Documentation
Xceed.SSH.Protocols Assembly / Xceed.SSH.Protocols Namespace / SSHTransportLayerProtocol Class / DeriveKeys Method


In This Topic
    DeriveKeys Method
    In This Topic
    RFC 4253: 7.2. Output from Key Exchange The key exchange produces two values: a shared secret K, and an exchange hash H. Encryption and authentication keys are derived from these. Each key exchange method specifies a hash function that is used in the key exchange. The same hash algorithm MUST be used in key derivation. Here, we'll call it HASH.
    Syntax
    'Declaration
     
    
    Public Sub DeriveKeys( _
       ByVal sharedSecret() As Byte, _
       ByVal exchangeHash() As Byte, _
       ByVal sessionID() As Byte, _
       ByVal keyExchangeAlgorithm As ISSHKeyExchangeAlgorithm, _
       ByRef IVClientToServer() As Byte, _
       ByRef IVServerToClient() As Byte, _
       ByRef EncryptionKeyClientToServer() As Byte, _
       ByRef EncryptionKeyServerToClient() As Byte, _
       ByRef IntegrityKeyClientToServer() As Byte, _
       ByRef IntegrityKeyServerToClient() As Byte _
    ) 
    'Usage
     
    
    Dim instance As SSHTransportLayerProtocol
    Dim sharedSecret() As Byte
    Dim exchangeHash() As Byte
    Dim sessionID() As Byte
    Dim keyExchangeAlgorithm As ISSHKeyExchangeAlgorithm
    Dim IVClientToServer() As Byte
    Dim IVServerToClient() As Byte
    Dim EncryptionKeyClientToServer() As Byte
    Dim EncryptionKeyServerToClient() As Byte
    Dim IntegrityKeyClientToServer() As Byte
    Dim IntegrityKeyServerToClient() As Byte
     
    instance.DeriveKeys(sharedSecret, exchangeHash, sessionID, keyExchangeAlgorithm, IVClientToServer, IVServerToClient, EncryptionKeyClientToServer, EncryptionKeyServerToClient, IntegrityKeyClientToServer, IntegrityKeyServerToClient)

    Parameters

    sharedSecret
    exchangeHash
    sessionID
    keyExchangeAlgorithm
    IVClientToServer
    IVServerToClient
    EncryptionKeyClientToServer
    EncryptionKeyServerToClient
    IntegrityKeyClientToServer
    IntegrityKeyServerToClient
    Supported Frameworks

    .NET: net5.0, net5.0-windows, net6.0, net6.0-macos, net6.0-windows, net7.0, net7.0-macos, net7.0-windows, net8.0, net8.0-browser, net8.0-macos, net8.0-windows, net9.0, net9.0-browser, net9.0-macos, net9.0-windows, net10.0, net10.0-browser, net10.0-macos, net10.0-windows.

    .NET Standard: netstandard2.0, netstandard2.1

    .NET Framework: net20, net35, net40, net403, net45, net451, net452, net46, net461, net462, net463, net47, net471, net472, net48, net481.

    See Also