Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8444097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:19:02+00:00 2026-06-10T09:19:02+00:00

I wanted to generate a hardware hash that would be used to generate a

  • 0

I wanted to generate a hardware hash that would be used to generate a key to encrypt a file so it can’t be exchanged with a different computer. This isn’t a license issue, it’s to store a backup copy of some data from our online database so that the app can be used offline (but the data contained in it is reasonably secure from snooping). Previously, I grabbed MAC address of (real) network adapters like this:

ManagementClass mng = new ManagementClass("Win32_NetworkAdapter");
ManagementObjectCollection apts = mng.GetInstances();
IEnumerable<string> macs = from ManagementObject mo in apts
                           where mo["MacAddress"] != null && mo["NetConnectionStatus"] != null
                           select mo["MacAddress"].ToString();

This worked reasonably well, except now I find with a new computer I have that when the wireless is turned off, I get two MAC address (one for the wired network card and one for the wireless), when I turn wireless on, I get three (the previous two, plus a Bluetooth one!) and I don’t see any really obvious way to filter out the Bluetooth one (short of searching for “Bluetooth” in the NetConnectionID).

Now I don’t need a super stable hash here. If the hash doesn’t match, then the app can’t decode the encrypted data and will download a fresh copy if on the network, so it’s not that big of a deal (if you’re not on the network, it’ll just tell you it’s not available right now). But if turning the wireless on and off is enough to change my hash, then it’s clearly not stable enough!

So my questions:

1) Is there a better way to tell that one of the network adapters might disappear suddenly so I can exclude it from the original hash?

2) Is the order of adapter guaranteed to be the same? Is the first adapter listed always the wired network card? If that’s the case, maybe I’ll just restrict it to using only the first adapter.

3) Is there a better, more stable hash I could use? Or a combination that would be reasonably stable?

Note: I also throw in the machine name from Environment.MachineName to my hash already.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:19:04+00:00Added an answer on June 10, 2026 at 9:19 am

    I don’t know the answer to 1 or 2, but here’s a potential workaround:

    You can create a more stable hash by combining machine name, processorID, & motherboardID. If you’re just using this for local identification that should be strong enough. This CodePlex article has a good list of the supported hardware keys. Please let me know if you have any questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to generate a list view using below code. But after running this
If you wanted to generate a pseudorandom alphanumeric string using T-SQL, how would you
I just wanted to know how jQuery can generate a fade effect in IE
I wanted to know how I can generate pi to the nth digit. I
I wanted to generate a load on my web application to measure/test that how
I wanted to generate interactive charts on my website inside google earth. Can somebody
I wanted to know if it's possible to derive a method to generate a
I am trying to generate some code using CodeDom. I wanted to know if
Guys, I wanted generate the pmd report while building the project so I have
I wanted to generate a random number 32 characters in length from a specified

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.