Anybody have any idea why ProtectedData.Protect from System.Security.Cryptography isn’t working, thought it supported in mono.
here is the code i am trying to use.
public static byte [] Protect( byte [] data )
{
try
{
// Encrypt the data using DataProtectionScope.CurrentUser. The result can be decr
ypted
// only by the same current user.
return ProtectedData.Protect( data, s_aditionalEntropy, DataProtectionScope.Curre
ntUser );
}
catch (CryptographicException e)
{
Console.WriteLine("Data was not encrypted. An error occurred.");
Console.WriteLine(e.ToString());
return null;
}
}
public static byte [] Unprotect( byte [] data )
{
try
{
//Decrypt the data using DataProtectionScope.CurrentUser.
return ProtectedData.Unprotect( data, s_aditionalEntropy, DataProtectionScope.Cur
rentUser );
}
catch (CryptographicException e)
{
Console.WriteLine("Data was not decrypted. An error occurred.");
Console.WriteLine(e.ToString());
return null;
}
}
I am trying to store an UNIQUE data or reads UNIQUE data from Computer(each computer has to be different)
Current All I can see is doing Protected Data, Mac address, Hardware Serial number, I think .net lib for mac address doesn’t work as far as no plugin goes, I always get 0 nics, and Hardware serial number I need to use system.management which mono doesn’t have.
Any ideas?