I have long wanted to write an article about using a USB flash drive instead of a dedicated dongle to encrypt software that does not require high encryption. Article When I visited the Internet today, I accidentally saw this blog post, which was exactly what I wanted to write. So I reprinted it here:
General USB flash drives do not provide encryption functions. Although the shape of USB flash drives is similar to that of dongles, they are completely different internally. USB flash drives are just a memory chip and a simple ancillary circuit, currently, smart card dongles all have a separate CPU or encryption chip, which can perform rather complex encryption. Algorithm .
Some software developers have the need to use a USB flash drive to release software while saving costs and preventing the software in the USB flash drive from being copied, but they do not want to buy expensive dongle any more, therefore, if you want to bind the software to a USB flash drive for execution, when the USB flash drive is pulled out, the software will not run normally, similar to the hardware fingerprint I introduced earlier, use a USB flash drive to encrypt the software.
If you are not particularly concerned about software security, you can bind the internal ID of the USB flash disk in the software to implement this encryption. Program Read the USB flash drive ID and generate a license file based on the ID. When the decrypted copies the file in the USB flash drive to another computer, the system fails to read the USB flash drive ID during execution, therefore, the license cannot be verified.
Generally, the IDs of Two USB flash drives are different. Therefore, even if the software is copied to another USB flash drive, the license is verified based on the USB flash drive ID during software execution, in this way, the software is bound to a USB flash drive for encryption.
It should be noted that such USB flash drive encryption is not secure. Most USB flash drive manufacturers have internal production tools to modify the internal ID number of the USB flash drive. This poses the possibility of copying the USB flash drive, however, general users do not have the ability to modify the internal ID of the USB flash drive, so it also has a certain degree of encryption.
In this encryption method, the VB of the function that reads the ID number of the U Disk Source code As follows:
Set ob1_miservice = GetObject ("winmgmts: \. \ Root \ cimv2 ")
Set colitems = obw.miservice. execquery ("select * From win32_usbhub ")
For each objitem in colitems
A = objitem. DeviceID
If instr (a, "vid") then B = Split (,"\")
Usb_id = B (ubound (B ))
Next
Post from moonlight blog [http://www.williamlong.info/]