Enigma.Cryptography.DataEncryption
1.0.0
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.7.2
This package targets .NET Framework 4.7.2. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Enigma.Cryptography.DataEncryption --version 1.0.0
NuGet\Install-Package Enigma.Cryptography.DataEncryption -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="Enigma.Cryptography.DataEncryption" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Enigma.Cryptography.DataEncryption" Version="1.0.0" />
<PackageReference Include="Enigma.Cryptography.DataEncryption" />
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 Enigma.Cryptography.DataEncryption --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Enigma.Cryptography.DataEncryption, 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.
#addin nuget:?package=Enigma.Cryptography.DataEncryption&version=1.0.0
#tool nuget:?package=Enigma.Cryptography.DataEncryption&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Enigma.Cryptography.DataEncryption
Enigma.Cryptography.DataEncryption is a .NET library based on Enigma.Cryptography
.
It provides services for data encryption and decryption.
Pbkdf2DataEncryptionService
Encryption/decryption service with PBKDF2 algorithm.
Encryption process
- A block cipher service is initialized with the specified cipher in GCM mode.
- A random 16-bytes salt and a random 12-bytes nonce are generated.
- A 32-bytes key is generated with PBKDF2 algorithm.
- The header is written to the output stream.
- The input stream is encrypted into the output stream with the key and nonce.
- The key is cleared from memory.
Decryption process
- The header is read from the input stream.
- A 32-bytes key is generated with PBKDF2 algorithm.
- A block cipher service is initialized with the cipher in GCM mode.
- The input stream is decrypted into the output stream with the key and nonce.
Data structure
Name | Length (bytes) | Description |
---|---|---|
Identifier | 2 | Fixed value [0xec, 0xde] that identifies encryption with this library |
Encryption type | 1 | Fixed value 0x01 that identifies encryption with PBKDF2 |
Version | 1 | Current version: 0x01 |
Cipher | 1 | Cipher identifier (see table below) |
Nonce | 12 | Random nonce for encryption with GCM mode |
Salt | 16 | Random salt for PBKDF2 |
Iterations | 4 (Int32) | Number of iterations for PBKDF2 |
Encrypted data | (dynamic) | Encrypted data with cipher in GCM mode |
Argon2DataEncryptionService
Data encryption service with Argon2id algorithm.
Encryption process
- A block cipher service is initialized with the specified cipher in GCM mode.
- A random 16-bytes salt and a random 12-bytes nonce are generated.
- A 32-bytes key is generated with Argon2id algorithm.
- The header is written to the output stream.
- The input stream is encrypted into the output stream with the key and nonce.
- The key is cleared from memory.
Decryption process
- The header is read from the input stream.
- A 32-bytes key is generated with Argon2 algorithm.
- A block cipher service is initialized with the cipher in GCM mode.
- The input stream is decrypted into the output stream with the key and nonce.
Data structure
Name | Length (bytes) | Description |
---|---|---|
Identifier | 2 | Fixed value [0xec, 0xde] that identifies encryption with this library |
Encryption type | 1 | Fixed value 0x02 that identifies encryption with Argon2 |
Version | 1 | Current version: 0x01 |
Cipher | 1 | Cipher identifier (see table below) |
Nonce | 12 | Random nonce for encryption with GCM mode |
Salt | 16 | Random salt for Argon2 |
Iterations | 4 (Int32) | Number of iterations for Argon2 |
Parallelism | 4 (Int32) | Parallelism factor for Argon2 |
Memory pow2 | 4 (Int32) | Memory cost factor (power of two) for Argon2 |
Encrypted data | (dynamic) | Encrypted data with cipher in GCM mode |
RsaDataEncryptionService
Data encryption service with RSA.
Encryption process
- A block cipher service is initialized with the specified cipher in GCM mode.
- A random 32-bytes key and a random 12-bytes nonce are generated.
- The random key is encrypted with the public RSA key.
- The header is written to the output stream.
- The input stream is encrypted into the output stream with the key and nonce.
- The key is cleared from memory.
Decryption process
- The header is read from the input stream.
- The encrypted key read from header is decrypted with the private RSA key.
- A block cipher service is initialized with the cipher in GCM mode.
- The input stream is decrypted into the output stream with the key and nonce.
- The decrypted key is cleared from memory.
Data structure
Name | Length (bytes) | Description |
---|---|---|
Identifier | 2 | Fixed value [0xec, 0xde] that identifies encryption with this library |
Encryption type | 1 | Fixed value 0x03 that identifies encryption with RSA |
Version | 1 | Current version: 0x01 |
Cipher | 1 | Cipher identifier (see table below) |
Nonce | 12 | Random nonce for encryption with GCM mode |
Encrypted key length | 4 (Int32) | RSA-encrypted random key length |
Encrypted key | (dynamic) | RSA-encrypted random key |
Encrypted data | (dynamic) | Encrypted data with cipher in GCM mode |
MLKemDataEncryptionService
Data encryption service with ML-KEM.
Encryption process
- A block cipher service is initialized with the specified cipher in GCM mode.
- A random 12-bytes nonce is generated.
- A 32-bytes key is generated from the ML-KEM public key.
- The header is written to the output stream.
- The input stream is encrypted into the output stream with the key and nonce.
- The key is cleared from memory.
Decryption process
- The header is read from the input stream.
- The key is decapsulated with the ML-KEM private key.
- A block cipher service is initialized with the cipher in GCM mode.
- The input stream is decrypted into the output stream with the key and nonce.
- The decrypted key is cleared from memory.
Data structure
Name | Length (bytes) | Description |
---|---|---|
Identifier | 2 | Fixed value [0xec, 0xde] that identifies encryption with this library |
Encryption type | 1 | Fixed value 0x04 that identifies encryption with ML-KEM |
Version | 1 | Current version: 0x01 |
Cipher | 1 | Cipher identifier (see table below) |
Nonce | 12 | Random nonce for encryption with GCM mode |
Encapsulation length | 4 (Int32) | Encapsulation length |
Encapsulation | (dynamic) | Encapsulation |
Encrypted data | (dynamic) | Encrypted data with cipher in GCM mode |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 is compatible. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- Enigma.Cryptography (>= 3.5.1)
-
.NETStandard 2.0
- Enigma.Cryptography (>= 3.5.1)
-
.NETStandard 2.1
- Enigma.Cryptography (>= 3.5.1)
-
net6.0
- Enigma.Cryptography (>= 3.5.1)
-
net7.0
- Enigma.Cryptography (>= 3.5.1)
-
net8.0
- Enigma.Cryptography (>= 3.5.1)
-
net9.0
- Enigma.Cryptography (>= 3.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.