OSK.Security.Cryptography
2.1.0
dotnet add package OSK.Security.Cryptography --version 2.1.0
NuGet\Install-Package OSK.Security.Cryptography -Version 2.1.0
<PackageReference Include="OSK.Security.Cryptography" Version="2.1.0" />
paket add OSK.Security.Cryptography --version 2.1.0
#r "nuget: OSK.Security.Cryptography, 2.1.0"
// Install OSK.Security.Cryptography as a Cake Addin #addin nuget:?package=OSK.Security.Cryptography&version=2.1.0 // Install OSK.Security.Cryptography as a Cake Tool #tool nuget:?package=OSK.Security.Cryptography&version=2.1.0
OSK.Security.Cryptography
This library is meant to help with making cryptography more accessible, usable, and, hopefully, easier to use and extend. By utilizing a set of generic interfaces that defines common cryptographic security functions (encryption, decryption, signing, etc.), a user only needs to know the key information they want to use (Aes, Rsa, etc.) and can rely on the internal mechanisms to provide the necessary cryptographic key services that will handle the security for the key.
Abstractions
The abstraction layer is meant to help provide a way to create different libraries that can handle and execute the core mechanisms for creating and handling
key services integrated with the library. An implementation for the abstractions is provided for this process, which should hopefully fulfill most needs.
For any other libraries, ICryptographicKeyServiceProvider
is meant to be the primary access point to the key services and should be implemented. Additionally,
the CryptographicKeyDescriptor
is meant to describe key services and should also be implemented. ICryptographicKeyService
and ICryptographicKeyInformation
implement the IDisposable
interface and are meant to destroy any key and other sensitive data when destroyed.
Usage: Adding Cryptographic Algorithm integrations
Core to the internal logic is the CryptographicKeyServiceProvider
, CryptographicKeyService
, SymmetricKeyService
, and AsymmetricKeyService
objects. When implementing new algorithms and using the standard logic, one of these three key service types must be used since the base CryptographicKeyService
exposes an internal method meant to help with initializing key information for a service. Additionally, the library utilizes dependency injection and it
is expected that integrations will use this approach with the library and will call one of the dependency injection extension methods (see the ServiceCollectionExtensions at the root of the logic library)
to add the necessary CryptographicKeyDescriptor
used with the cryptographic key service provider. ICryptographicKeyInformation
and ICryptographicKeyService
should be considered sensitive and should be
setup to destroy the sensitive cryptographic data when disposed. Only IPublicKeyInformation
data should be considered safe for public exposure.
Note: Individual implementations of the library can be standalone and may not require any of the above setup to be usable, however when being added to dependency injection flows with this library as an integration, it is expected that the above mentioned conventions are followed.
Usage: Consumers
Consumers should inject the core logic using the AddCryptography
extension to ensure the necessary services for operation are added to the dependency contianer.
When wanting to utilize a cryptographic key service, users can call any of the methods on the ICryptographicKeyServiceProvider
to get a key service that will handle encryption,
and other cryptographic functions. After using these functions, users should dispose of the key service and key information as soon as they are able for security risk management.
Only the IPublicKeyInformation
should be considered safe for public exposure. Users can then pick and choose the cryptographic services they need for their application by using
an implementation that follows the stated conventions in the above integration subheading and adding it to the dependency container.
Contributions and Issues
Any and all contributions are appreciated! Please be sure to follow the branch naming convention OSK-{issue number}-{deliminated}-{branch}-{name}
as current workflows rely on it for automatic issue closure.
Please submit issues for discussion and tracking using the github issue tracker.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.0)
- OSK.Security.Cryptography.Abstractions (>= 2.1.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on OSK.Security.Cryptography:
Package | Downloads |
---|---|
OSK.Security.Cryptography.Rsa
Rsa implementation for the OSK Cryptography library with DI support in .NET, which utilizes bouncy castle for cross platform support. |
|
OSK.Security.Cryptography.Aes
Aes implementation for the OSK Cryptography library with DI support in .NET. |
|
OSK.Storage.Local.Cryptography
An extension for OSK.Storage.Local service that adds an integration for cryptography |
GitHub repositories
This package is not used by any popular GitHub repositories.