Identity.NET
6.0.0.7
dotnet add package Identity.NET --version 6.0.0.7
NuGet\Install-Package Identity.NET -Version 6.0.0.7
<PackageReference Include="Identity.NET" Version="6.0.0.7" />
paket add Identity.NET --version 6.0.0.7
#r "nuget: Identity.NET, 6.0.0.7"
// Install Identity.NET as a Cake Addin
#addin nuget:?package=Identity.NET&version=6.0.0.7
// Install Identity.NET as a Cake Tool
#tool nuget:?package=Identity.NET&version=6.0.0.7
Provides a Persistent Unique Identifier for the current PC and facility to Encrypt and Decrypt strings using that Identity
Default Usage
Initialize an Identity
based on the UUID
of the Local PC
UniqueIdentity.Initialize("PasswordBasedIdentifierSecureString");
Use that Identity
to Encrypt
a SecureString
UniqueIdentity.Encrypt(SecureString, "AdditionalPassword");
Use that Identity
to Decrypt
a SecureString
UniqueIdentity.Decrypt(SecureString, "AdditionalPassword");
Get the global UUID
for the Local PC
as a string
string identity = UniqueIdentity.UUID;
Encrypt/Decrypt SecureString
You can use an Identity
based on the UUID
of the Local PC
to Encrypt/Decrypt SecureStrings
If you provide a SecureString PlainText
with a SecureString Password
a SecureString CipherText
will be returned
SecureString CipherText = UniqueIdentity.Encrypt(SecureStringPlainText, SecureStringPassword);
SecureString PlainText = UniqueIdentity.Decrypt(CipherText, SecureStringPassword);
It is safe to use the Default Identity
to Encrypt/Decrypt
because of the additional password.
Checking ID
When you Initialize()
the Identity
it will return a Status Messsage
that indicates if the Identity
was created/loaded correctly or an Error Message
if it wasn't.
You can use this information in your application to decide what to do next.
Validation String
Successfully initializing an Identity
will also produce a Validation String
you can save and use during subsequent initializations to check if your keys are still valid to decrypt data you have previously encrypted.
You can use UniqueIdentity.CheckSample()
to check the Validation String
If everything is still working, CheckSample()
will return true
Salt
You can change the salt with SetSaltBytes
but a stronger password would be better
You should do this before you call Initialize
Password / Hardware Changes
If you lose your password your data will be lost.
If you change the salt and you lose it, your data will be lost.
If you replace/damage your CPU your data will be lost.
If you replace/damage your Motherboard your data will be lost.
If you update/damage your TPM your data may be lost, "it depends".
Persistence
The Identity
will persist even after OS Reinstall
on any computer that meets the requirements to run Windows 11
and most computers running Windows 10
Will also work if you go from Windows 10
to Windows 11
or back again.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Microsoft.Win32.Registry (>= 5.0.0)
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 |
---|---|---|
6.0.0.7 | 89 | 4/11/2024 |