I have an old project in VB which created an unique pc code from MAC address and disc id. This was used to identify a pc so credentials cannot be used between pcs.
This project migrated to C#, and I encapsulated this logic in a DLL which simply calls a method that returns the pc_id.
The issue I have now is that it's damn easy to just create a new DLL which has the same class name and method signature and return whatever pc_id they wish.
How can I ensure the DLL my program is referencing is actually mine?
I thought of comparing the hash of my DLL with a hardcoded one, but is this safe between different OS? Will the hash of the file change between file systems?
Or which method is preferred when ensuring files integrity/origin?