1. Technical Field
Embodiments of the present disclosure relates to information security technology, and particularly to an electronic device and method for protecting electronic keys using the electronic device.
2. Description of Related Art
Electronic keys, such as license keys, are used to protect digital data stored in digital disks (e.g, HD DVD). A software player needs to obtain a license key from a third-party authentication center to decode the digital data stored in the digital disks. However, the license key may be obtained illegally using a debug method of the software player. Therefore, a more effective method for protecting electronic keys is desired.
All of the processes described below may be embodied in, and fully automated via, functional code modules executed by one or more general purpose electronic devices or processors. The code modules may be stored in any type of non-transitory readable medium or other storage device. Some or all of the methods may alternatively be embodied in specialized hardware. Depending on the embodiment, the non-transitory readable medium may be a hard disk drive, a compact disc, a digital video disc, a tape drive or other suitable storage medium.
In block S301, the setting module 200 sets a plurality of hash functions. In one embodiment, the plurality of hash functions may include a first hash function, a second hash function, and a third hash function.
In block S302, the creating module 210 divides an electronic key into a plurality of key segments. As shown in
In block S303, the creating module 210 creates a data storage structure for each of the key segments stored in the storage device 12. In one embodiment, the data storage structure is an array or a queue. For example, as shown in
In block S304, the calculating module 220 calculates a hash address for each of the key segments using each of the hash functions, and obtains a plurality of hash addresses of the key segments corresponding to the hash functions. For example, a hash address of the first key segment is “7” calculated by the first hash function, a hash address of the second key segment is “3” calculated by the first hash function, a hash address of the third key segment is “5” calculated by the first hash function, and a hash address of the fourth key segment is “11” calculated by the first hash function. If a collision (i.e., hash collision) of the hash addresses occurs, the calculating module 220 resolves the collision of the hash addresses using an open addressing method.
In block S305, the storing module 230 stores information of the data storage structure of each of the key segments in a hash table according to the hash address of the key segment corresponding to one of the hash functions. For example, the storing module 230 stores the information of the data storage structure of the first key segment in the hash address “7” of the hash table corresponding to the first hash function, stores the information of the data storage structure of the second key segment in the hash address “3” of the hash table corresponding to the first hash function, and stores the information of the data storage structure of the third key segment in the hash address “5” of the hash table corresponding to the first hash function.
In block S306, if the electronic key is needed by a software player, the extracting module 240 selects a hash function randomly from the plurality of hash functions, and calculates a hash address of each of the plurality of key segments of the electronic key using the selected hash function. For example, the extracting module 240 selects the first hash function to obtain the hash address of the first key segment “7”, the hash address of the second key segment “3”, the hash address of the third key segment “5”, the hash address of the fourth key segment “11”.
In block S307, the extracting module 240 obtains the information of the data storage structure of each of the key segments from the hash table according to the calculated hash address of each of the key segments, extracts the corresponding key segments from the information of the data storage structure, and assembles the extracted key segments to form the key. For example, the extracting module 240 extracts the first key segment from the data storage structure according to the hash address “7”, extracts the second key segment from the data storage structure according to the hash address “3”, extracts the third key segment from the data storage structure according to the hash address “5”, and extracts the fourth key segment from the data storage structure according to the hash address “11”.
Because the key is divided into a plurality of key segments, and each of the key segments is stored in a hash address of a hash table randomly. If the key in needed by a software player, the key protection system 10 extracts each of the key segments from the hash table according to the corresponding hash address, and assembles the extracted key segments to reform the electronic key. Thus, it is difficult to obtain the key illegally using a debug method of the software player.
It should be emphasized that the above-described embodiments of the present disclosure, particularly, any embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
99130250 | Sep 2010 | TW | national |