Changeset 2412


Ignore:
Timestamp:
Jan 21, 2011, 7:26:20 PM (10 years ago)
Author:
Sven Rech
Message:

GetID depence now on cpuid and username

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPluginBase/Miscellaneous/UniqueIdentifier.cs

    r2235 r2412  
    1818        {
    1919            string username = WindowsIdentity.GetCurrent().Name;
    20             string mac = GetMacIdentifier();
     20            //string mac = GetMacIdentifier();
     21
     22            ManagementClass man = new ManagementClass("win32_processor");
     23            ManagementObjectCollection moc = man.GetInstances();
     24            string cpuids = "";
     25            foreach (ManagementObject mob in moc)
     26            {
     27                cpuids += mob.Properties["processorID"].Value.ToString();
     28            }
     29
    2130
    2231            MD5 md5 = new MD5CryptoServiceProvider();
    23             byte[] idBytes = md5.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(username + mac));
     32            byte[] idBytes = md5.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(username + cpuids));
    2433            long ID = BitConverter.ToInt64(idBytes, 0);
    2534            ID = Math.Abs(ID);
Note: See TracChangeset for help on using the changeset viewer.