Software encryption using USB flash drives

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.