CBPP 3.0.0

dotnet add package CBPP --version 3.0.0
NuGet\Install-Package CBPP -Version 3.0.0
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="CBPP" Version="3.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CBPP --version 3.0.0
#r "nuget: CBPP, 3.0.0"
#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.
// Install CBPP as a Cake Addin
#addin nuget:?package=CBPP&version=3.0.0

// Install CBPP as a Cake Tool
#tool nuget:?package=CBPP&version=3.0.0

Communication Between Processes Protocol

Easily transfer data between applications using this simple library.

Construct a share
// Construct your share
Share MyShare = new Share(
    "UNIQUE-NAME", /* A unique identifier for this share */
    "PASSWORD", /* A shared secret used for validation */
    false /* You can lock your share to only the user your apps run on */
);
Creating a simple item
// Create an item
MyShare.CreateItem(
    "HelloWorldName", /* Name of this item */
    "Hello world!" /* Value of this item */
);
Reading a simple item
// Get an item from the share
byte[] item = MyShare.GetItem("HelloWorldName");
Deleting an item
// Delete an item from the share
MyShare.DeleteItem("HelloWorldName");
Large items

Some items can't be stored in the global atom table because they are larger than 255 characters (actually less as CBPP adds structure to each table entry). In these cases, you can use the "Large item" set of functions. Large items have no character limit and are segmented.

Creating a large item
// Create a large item
MyShare.CreateLargeItem(
    "HelloWorldName", /* Name of this item */
    "Hello world!" /* Value of this item */
    );
Reading a large item
// Get a large item from the share
byte[] item = MyShare.GetLargeItem("HelloWorldName");

Be sure to delete large items when no longer required as they are segmented and can fill up the Global Atom table, causing system instability.

Best practices

Please read the following before implementing CBPP.

  1. When you no longer need an item, make sure to delete it from the share. This is because the Global Atom Table has a finite number of entries available. Once these have been exhausted, a system reboot would be required.
  2. If you are going to be storing sensitive information on the share, make sure to implement encryption. CBPP can protect a share to a user, but this could still allow malicious applications running on the same user to read your share.
  3. Name your items clearly.
  4. Only use the LargeItem set if the item is larger than 100 characters, as this splits the item into many little items which could impact performance if done too often.



Behavioural oddities

Because CBPP is built on top of the Global Atom Table, it must conform to the rules of the Global Atom Table.

The global atom table is available to all applications within the same window station. This means that, say you have two processes each running on different users, as long as they both exist within the same window station they can communicate with each other (this means a system service can communicate with a regular user process as system services run on the same window station as a regular user). However, if you have multiple users logged in to a computer, a process running on user A cannot communicate with a process running on user B unless both processes are spawned in the same window station (IE: RunAs, Run as a different user)

Learn more about Window Station here Window Stations - Win32 apps | Microsoft Learn Learn more about Global Atom Table here About Atom Tables - Win32 apps | Microsoft Learn

*You*
Can processes created on different window stations communicate with the same
global atom table?

*Copilot*
Processes created in different window stations cannot directly communicate with the
same global atom table. Each window station has its own global atom table, and these
tables are isolated from each other. 

How does user-restricting work?

When you specify "true" for IsProtected, CBPP will use the Windows Data Protection API to encrypt item values to the current user. This means only processes running on the current user account can read the share.

Detailed explanation

CBPP adds items to the Global Atom Table by first structuring them. The structure is as follows: | ITEM | |-----------------| | Share UID | | Item Name | | Item Value | | Item Value Hash | When the share is user protected, the "Item Value" is encrypted. All other parts of the item are plain-text. This includes the name of the item.

Integrity

All items in a share include a hash of the item. The item's hash is computed by using a shared-secret (the shared-secret is appended to the item value before being sha-256 hashed and added to the item structure).

Once a client gets an item, they perform the same operation as the process that submitted the item did and cross-reference the hash to confirm it matches. If it doesn't, an error is thrown.

This is necessary as anyone can write to the global atom table and could therefore potentially modify an item within a share.

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. 
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
3.0.0 70 6/11/2024
2.0.1 67 6/9/2024
1.0.0 72 6/9/2024

Major overhaul of the project, including summary tags for every function