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 have a separate CPU or encryption chip, which can execute rather complex encryption algorithms.
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 cannot run normally. Similar to the hardware fingerprint bound, the software is encrypted using the USB flash drive.
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. First, you can use the program to read the ID of the USB flash disk, then generate a License file based on this ID. When the decrypted copies the files in the USB flash drive to another computer, the system fails to read the USB flash drive ID During the software execution, so 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 source code of the function for reading the USB flash drive ID is 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