M9Studio.SecureStream 8.0.2.1

dotnet add package M9Studio.SecureStream --version 8.0.2.1
                    
NuGet\Install-Package M9Studio.SecureStream -Version 8.0.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="M9Studio.SecureStream" Version="8.0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="M9Studio.SecureStream" Version="8.0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="M9Studio.SecureStream" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add M9Studio.SecureStream --version 8.0.2.1
                    
#r "nuget: M9Studio.SecureStream, 8.0.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=M9Studio.SecureStream&version=8.0.2.1
                    
Install M9Studio.SecureStream as a Cake Addin
#tool nuget:?package=M9Studio.SecureStream&version=8.0.2.1
                    
Install M9Studio.SecureStream as a Cake Tool

M9Studio.SecureStream

Encrypted session abstraction with TLS 1.3-style handshake and AES-GCM transport encryption.

NuGet License: Apache-2.0

Features

  • Pluggable transport adapter (ISecureTransportAdapter<TAddress>) to abstract over sockets, in-memory channels, etc.
  • X25519-based handshake and key agreement
  • AES-GCM symmetric encryption with integrity and confidentiality
  • Agnostic to transport and address types (can use IPEndPoint, int, etc.)
  • Designed to resemble lightweight TLS tunnel

Installation

dotnet add package M9Studio.SecureStream

Usage

Setup and connection

var adapter = new MyTransportAdapter();
var manager = new SecureChannelManager<MyAddressType>(adapter);

manager.OnSecureSessionEstablished += session =>
{
    session.Send(Encoding.UTF8.GetBytes("Hello securely"));
    var response = session.Receive();
    Console.WriteLine("Decrypted: " + Encoding.UTF8.GetString(response));
};

var session2 = manager.Connect(remoteAddress);
session2.Send(Encoding.UTF8.GetBytes("Hello securely"));
var response2 = session2.Receive();
Console.WriteLine("Decrypted: " + Encoding.UTF8.GetString(response2));

Interface

ISecureTransportAdapter<TAddress>

This interface abstracts the transport layer for sending and receiving encrypted data. You can implement it over any transport: UDP, TCP, or even in-process queues.

public interface ISecureTransportAdapter<TAddress>
{
    event Action<TAddress> OnConnected;
    event Action<TAddress> OnDisconnected;

    bool SendTo(byte[] buffer, TAddress remote);
    byte[] ReceiveFrom(TAddress remote);
}
  • OnConnected: triggered when a remote peer becomes reachable (e.g., after initial handshake packet is received)
  • OnDisconnected: triggered when a remote peer is no longer available or manually closed
  • SendTo: sends a raw encrypted packet to the given address
  • ReceiveFrom: blocks until a packet is received from the specified address
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.2.1 137 5/25/2025
8.0.1.1 57 5/24/2025
8.0.0.1 139 5/4/2025
8.0.0 135 5/4/2025

Initial release: secure encrypted tunnel with X25519 + AES-GCM. Supports pluggable transport adapter.