ETAMP 1.0.0
See the version list below for details.
dotnet add package ETAMP --version 1.0.0
NuGet\Install-Package ETAMP -Version 1.0.0
<PackageReference Include="ETAMP" Version="1.0.0" />
paket add ETAMP --version 1.0.0
#r "nuget: ETAMP, 1.0.0"
// 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
- Instantiate the
Etamp
Class: Create anEtamp
object, optionally specifying the ECDSA, elliptic curve, security algorithm, and hash algorithm.var etamp = new Etamp();
- 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
- Instantiate the ValidateToken Class: Create a ValidateToken object with the ECDSA instance and hash algorithm.
var validator = new ValidateToken(ecdsa, HashAlgorithmName.SHA512);
- 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 | Versions 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. |
-
net8.0
- Microsoft.IdentityModel.Tokens (>= 7.0.3)
- Newtonsoft.Json (>= 13.0.3)
- System.IdentityModel.Tokens.Jwt (>= 7.0.3)
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 | 50 | 10/29/2024 |
3.0.2 | 101 | 5/31/2024 |
3.0.1 | 96 | 5/31/2024 |
3.0.0 | 99 | 5/31/2024 |
2.0.0 | 121 | 5/5/2024 |
1.4.0 | 132 | 3/23/2024 |
1.3.1 | 133 | 3/4/2024 |
1.3.0 | 116 | 3/2/2024 |
1.2.0 | 140 | 3/1/2024 |
1.1.5 | 138 | 2/8/2024 |
1.1.4 | 216 | 12/16/2023 |
1.1.3 | 166 | 12/6/2023 |
1.1.2 | 147 | 12/5/2023 |
1.1.1 | 145 | 12/3/2023 |
1.1.0 | 159 | 12/3/2023 |
1.0.2 | 161 | 11/28/2023 |
1.0.1 | 144 | 11/27/2023 |
1.0.0 | 127 | 11/26/2023 |