ETAMP 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ETAMP --version 1.0.0                
NuGet\Install-Package ETAMP -Version 1.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="ETAMP" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ETAMP --version 1.0.0                
#r "nuget: ETAMP, 1.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 ETAMP as a Cake Addin
#addin nuget:?package=ETAMP&version=1.0.0

// Install ETAMP as a Cake Tool
#tool nuget:?package=ETAMP&version=1.0.0                

ETAMP Protocol Documentation

Overview

ETAMP (Encrypted Token And Message Protocol) is a lightweight .NET library designed for enhancing message and transaction security within applications. It incorporates advanced cryptographic techniques, including JWT (JSON Web Tokens), ECDSA (Elliptic Curve Digital Signature Algorithm), and optional ECDH (Elliptic Curve Diffie-Hellman) encryption, to provide robust protection against unauthorized access and data tampering. Ideal for systems requiring secure data transmission, ETAMP is easy to integrate and ensures the highest levels of data integrity and confidentiality.


Key Components

Etamp Class

The Etamp class is the core of the ETAMP protocol, handling the creation and signing of secure tokens.

Properties
  • Curve: The elliptic curve used in cryptographic operations, defaulting to the NIST P-521 curve.
  • HashAlgorithm: The hash algorithm used for cryptographic signatures, defaulting to SHA-512.
  • SecurityAlgorithm: The JWT security algorithm, defaulting to EcdsaSha512Signature.
  • PrivateKey: The private key in PEM format, generated from the ECDSA object.
  • PublicKey: The public key in PEM format, extracted from the ECDSA object.
  • Ecdsa: The instance of the elliptic curve digital signature algorithm used for cryptographic operations.
Methods
  • CreateETAMP<T>: Creates an ETAMP token with a unique message ID, payload, and optional signature.

ValidateToken Class

The ValidateToken class is responsible for verifying the authenticity and integrity of ETAMP tokens.

Methods
  • VerifyData: Verifies the given data against a specified signature.
  • VerifyETAMP: Verifies the integrity and authenticity of an ETAMP token.

Usage Guidelines

Creating an ETAMP Token

  1. Instantiate the Etamp Class: Create an Etamp object, optionally specifying the ECDSA, elliptic curve, security algorithm, and hash algorithm.
    var etamp = new Etamp();
    
  2. Generate a Token: Call CreateETAMP method with the required payload and update type.
    var token = etamp.CreateETAMP("UpdateType", payload, true, 1.0);
    

Verifying an ETAMP Token

  1. Instantiate the ValidateToken Class: Create a ValidateToken object with the ECDSA instance and hash algorithm.
    var validator = new ValidateToken(ecdsa, HashAlgorithmName.SHA512);
    
  2. Verify the Token: Use VerifyETAMP to validate the integrity and authenticity of the token.
    bool isValid = validator.VerifyETAMP(token);
    

Best Practices

  • Secure Key Management: Ensure the secure storage and handling of private keys.
  • Regular Key Rotation: Periodically rotate keys to maintain security.
  • Validation: Always validate tokens before processing their content.
  • Error Handling: Implement robust error handling to manage potential cryptographic errors.

Advanced Features

  • Custom Curves: While NIST P-521 is the default, ETAMP supports custom curves for specific requirements.
  • Flexible Hashing: SHA-512 is the default hashing algorithm, but ETAMP can be configured to use other hash functions.
  • Extensibility: ETAMP is designed to be extendable and can be adapted to include additional cryptographic mechanisms as needed.
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.1.2 64 10/29/2024
3.0.2 108 5/31/2024
3.0.1 103 5/31/2024
3.0.0 106 5/31/2024
2.0.0 128 5/5/2024
1.4.0 137 3/23/2024
1.3.1 138 3/4/2024
1.3.0 121 3/2/2024
1.2.0 147 3/1/2024
1.1.5 147 2/8/2024
1.1.4 221 12/16/2023
1.1.3 171 12/6/2023
1.1.2 152 12/5/2023
1.1.1 150 12/3/2023
1.1.0 164 12/3/2023
1.0.2 166 11/28/2023
1.0.1 149 11/27/2023
1.0.0 132 11/26/2023