Abstract:
A method and a device for identifying pirated dongle are provided. The method includes: determining by an identification device whether any dongle is connected to host; obtaining preset data from a detection list having data volume larger than storage capacity of the dongle; obtaining first input data and first output data; sending the first input data to the dongle; receiving fifth output data; judging whether the fifth output data is identical to the first output data; determining the dongle as legitimate if judgment result is positive; determining the dongle as pirated if judgment result is negative. The detection list has data volume larger than storage capacity of the dongle; during identification, the legitimate dongle returns correct output data based on a cryptographic algorithm, while the pirated dongle without the correct cryptographic algorithm returns wrong data; therefore, the identification device may identify pirated dongle, and protection for dongle is improved.

Description:
TECHNICAL FIELD 
       [0001]    The invention relates to the field of dongle, more particularly to a method and a device for identifying a pirated dongle. 
       BACKGROUND 
       [0002]    A dongle is an encryption product of combination of hardware and software, which is inserted on a computer. As a tool with function of protecting software, the dongle may prevent, by protecting the software and data, the software from being illegitimately used. A software developer may perform data exchange through an interface function and the dongle, i.e., may perform writing or reading on the dongle. With an inbuilt single chip microprocessor circuit, the dongle has determination and analytical ability, and active anti-decryption ability of the dongle is accordingly enhanced. However, due to incorrect use of the dongle by a developer, a cracker may simulate the dongle with a pirated dongle by means of tracking and modulating. The cracker may run encrypted software by using the pirated dongle, which brings security vulnerability to user data. 
       SUMMARY 
       [0003]    To improve the protection for a dongle, a method and a device for identifying a pirated dongle are provided in the invention. 
         [0004]    A method for identifying a pirated dongle is provided in the invention. The method includes steps S 1 -S 6 . 
         [0005]    In the step S 1 , an identification device determines whether there is any dongle connected to a host; if there is a dongle connected to the host, the procedure proceeds to step S 2 ; if no dongle is connected to the host, information that no dongle is connected to the host is outputted. 
         [0006]    In the step S 2 , the identification device obtains preset data from a detection list based on a preset rule; the preset rule is generated by an encryption device and the preset rule is prestored in the identification device; data volume of the detection list is larger than a storage capacity of the dongle. 
         [0007]    In the step S 3 , the identification device obtains first input data and first output data based on the preset data. 
         [0008]    In the step S 4 , the identification device sends the first input data to the dongle. 
         [0009]    In the step S 5 , the identification device receives fifth output data sent by the dongle. 
         [0010]    In the step S 6 , the identification device determines whether the fifth output data is identical to the first output data; if the fifth output data is identical to the first output data, information that the dongle is legitimate is outputted; if the fifth output data is not identical to the first output data, information that the dongle is pirated is outputted. 
         [0011]    The step S 6  includes steps S 6 - 1  to S 6 - 4 . 
         [0012]    In the step S 6 - 1 , the identification device determines whether the fifth output data is identical to the first output data; if the fifth output data is identical to the first output data, the procedures proceeds to the step S 6 - 2 ; if the fifth output data is not identical to the first output data otherwise, the procedures proceeds to the step S 6 - 3 . 
         [0013]    In the step S 6 - 2 , the identification device computes a current count of detection and determines whether the current count of detection reaches a preset count; if the current count of detection reaches the preset count, the procedures proceeds to the step S 6 - 4 ; if the current count of detection does not reach the preset count, the procedures proceeds to the step S 2 . 
         [0014]    In the step S 6 - 3 , the identification device returns information that the identification device is pirated and the procedure is ended. 
         [0015]    In the step S 6 - 4 , the identification device restores the current count of detection to an initial value and the identification device returns information that the dongle is legitimate. 
         [0016]    In the case that the identification device receives a plurality of pieces of fifth output data in the step S 5 , the step S 6  may include steps S 6 - 1 ′ to S 6 - 2 ′. 
         [0017]    In the step S 6 - 1 ′, the identification device computes a current count of detection and determines whether the current count of detection reaches a preset count; if the current count of detection reaches the preset count, the procedure proceeds to the go step S 6 - 2 ′; if the current count of detection does not reach the preset count, the procedures proceeds to the step S 2 . 
         [0018]    In the step S 6 - 2 ′, the identification device determines whether all pieces of received fifth output data are respectively identical to corresponding pieces of first output data; if all the pieces of received fifth output data are respectively identical to the corresponding pieces of first output data, the procedure proceeds to the step S 6 - 4 ; if at least one piece of fifth output data is not identical to the corresponding piece of first output data, the procedure proceeds to the step S 6 - 3 . 
         [0019]    The step S 3  may include step S 3 ′. 
         [0020]    In the step S 3 ′, the identification device decrypts the preset data to obtain the first input data and the first output data. 
         [0021]    The step S 3  and the step S 6  are replaced by step S 3 ″ and step S 6 ″. 
         [0022]    In the step S 3 ″, the identification device obtains the first input data and the second output data based on the preset data. 
         [0023]    In the step S 6 ″, the identification device performs computation on the fifth output data based on a preset conversion algorithm to obtain sixth output data, and the identification device determines whether the sixth output data is identical to the second output data; if the sixth output data is identical to the second output data, information that the dongle is legitimate is outputted; if the sixth output data is not identical to the second output data, information that the dongle is pirated is outputted. 
         [0024]    The step S 6 ″ includes steps S 6 ″- 1  to S 6 ″- 4 . 
         [0025]    In the step S 6 ″- 1 , the identification device performs computation on the fifth output data based on the preset conversion algorithm to obtain the sixth output data; the identification device determines whether the sixth output data is identical to the second output data; if the sixth output data is identical to the second output data, the procedure proceeds to the step S 6 ″- 2 ; if the sixth output data is not identical to the second output data, the procedure proceeds to the step S 6 ″- 3 . 
         [0026]    In the step S 6 ″- 2 , the identification device computes a current count of detection and determines whether the current count of detection reaches a preset count; if the current count of detection reaches the preset count, the procedure proceeds to the step S 6 ″- 4 ; if the current count of detection does not reach the preset count, the procedure proceeds to the step S 2 . 
         [0027]    In the step S 6 ″- 3 , the identification device returns information that the dongle is pirated. 
         [0028]    In the step S 6 ″- 4 , the identification device restores the current count of detection to an initial value and the identification device returns information that the dongle is legitimate. 
         [0029]    In the case that the identification device receives a plurality of pieces of fifth output data in the step S 5 , the Step S 6 ″ may include steps S 6 ″- 1 ′ to S 6 ″- 2 ′. 
         [0030]    In the step S 6 ″- 1 ′, the identification device computes the current count of detection and the identification device determines whether the current count of detection reaches the preset count; if the current count of detection reaches the preset count, the procedure proceeds to the step S 6 ″- 2 ′; if the current count of detection does not reach the preset count, the procedure proceeds to the step S 2 . 
         [0031]    In the step S 6 ″- 2 ′, the identification device determines whether all pieces of received sixth output data are respectively identical to corresponding pieces of second output data; if all the pieces of received sixth output data are respectively identical to the corresponding pieces of second output data, the procedure proceeds to the step S 6 ″- 4 ; if at least one piece of sixth output data is not identical to the corresponding piece of second output data, the procedure proceeds to the step S 6 ″- 3 . 
         [0032]    The step S 3 ″ may include step S 3 ′″. 
         [0033]    In the step S 3 ′″, the identification device decrypts the preset data to obtain the first input data and the second output data. 
         [0034]    The step S 1  includes steps S 11 -S 15 . 
         [0035]    In the step S 11 , after the identification device receives a command of dongle invoking, the identification device determines whether there is any dongle connected to the host; if there is a dongle connected to the host, the procedure proceeds to the step S 12 ; if no dongle is connected to the host, the identification device outputs information that no dongle is connected to the host. 
         [0036]    In the step S 12 , the identification device obtains a first identifier and a second identifier from the dongle. 
         [0037]    In the step S 13 , the identification device determines whether the first identifier and the second identifier are respectively identical to a first identifier prestored in the identification device and a second identifier prestored in the identification device; if the first identifier and the second identifier are respectively identical to the first identifier prestored in the identification device and the second identifier prestored in the identification device, the procedure proceeds to the step S 14 ; if the first identifier and the second identifier are not respectively identical to the first identifier prestored in the identification device and the second identifier prestored in the identification device, the identification device outputs information that the dongle is wrong. 
         [0038]    In the step S 14 , the identification device reading the user identity from the dongle; 
         [0039]    In the step S 15 , the identification device determines whether the user identity is identical to a user identity prestored in the identification device; if the user identity is identical to the user identity prestored in the identification device, the procedure proceeds to the step S 2 ; if the user identity is not identical to the user identity prestored in the identification device, the identification device outputs the information that the dongle is wrong. 
         [0040]    Data in the detection list is generated by: performing computation on the first input data by the encryption device based on an algorithm corresponding to the legitimate dongle to obtain the first output data, and performing computation on the first output data based on a preset conversion algorithm to obtain the second output data. 
         [0041]    The preset rule in the step S 2  includes randomly obtaining the preset data or orderly obtaining the preset data. 
         [0042]    After the step S 1  and before the step S 4 , the method further includes: determining, by the identification device, whether the dongle is legitimate; if the dongle is legitimate, the procedure is continued; if the dongle is not legitimate, an error is reported. 
         [0043]    Determining whether the dongle is legitimate by the identification device includes: obtaining, by the identification device, a user password from the dongle and determining, by the identification device, whether the user password is identical to a user password stored in the identification device, if the user password is identical to the user password stored in the identification device, the dongle is legitimate; if the user password is not identical to a user password stored in the identification device, the dongle is not legitimate. 
         [0044]    The algorithm corresponding to the legitimate dongle includes a cryptographic algorithm and an algorithm with which unique output data may be obtained. 
         [0045]    A device for identifying a pirated dongle is provided in the invention. The device includes a first determination module, a storage module, an obtaining module, a sending module, a receiving module, a second determination module and an output module. 
         [0046]    The first determination module configured to determine whether there is any qualified dongle connected to a host. 
         [0047]    The storage module configured to store a detection list generated by an encryption device; where data volume of the detection list is larger than a storage capacity of the dongle. 
         [0048]    The obtaining module is configured to obtain preset data from the detection list and obtain first input data and first output data based on the preset data. 
         [0049]    The sending module is configured to send the first input data to the dongle. 
         [0050]    The receiving module is configured to receive fifth output data sent by the dongle; where the dongle performs computation on the first input data to obtain the fifth output data. 
         [0051]    The second determination module is configured to determine whether the fifth output data is identical to the first output data. 
         [0052]    The output module is configured to output information that the dongle is wrong, information that no dongle is connected to the host, information that the dongle is legitimate and information that the dongle is pirated. 
         [0053]    The first determination module includes a first determination unit, a first obtaining unit, a second determination unit, a second obtaining unit and a third determination unit. 
         [0054]    The first determination unit is configured to determine whether there is any dongle connected to the host. 
         [0055]    The first obtaining unit is configured to obtain a first identifier and a second identifier from the dongle. 
         [0056]    The second determination unit is configured to determine whether the first identifier and the second identifier are respectively identical to a first identifier prestored in the identification device and a second identifier prestored in the identification device. 
         [0057]    The second obtaining unit is configured to obtain a user identity from the dongle. 
         [0058]    The third determining unit configured to determine whether the user identity is identical to a user identity prestored in the identification device. 
         [0059]    The identification device further includes a verification module, a decryption module and a computation module. 
         [0060]    The verification module is configured to verify whether the dongle is legitimate. 
         [0061]    The decryption module is configured to decrypt the preset data to obtain the first input data and the first output data, or to decrypt the preset data to obtain the first input data and the second output data. 
         [0062]    The computation module is configured to compute the fifth output data based on a preset algorithm to obtain sixth output data. 
         [0063]    The second determination module is further configured to determine whether the sixth output data is identical to the second output data. 
         [0064]    The verification module includes a third obtaining unit and a fourth determination unit. 
         [0065]    The third obtaining unit is configured to obtain a user password from the dongle. 
         [0066]    The fourth determining unit is configured to determine whether the user password is identical to a user password stored in the identification device. 
         [0067]    The second determination module includes a first comparison unit, a first computation unit and a second comparison unit. 
         [0068]    The first comparison unit is configured to determine whether the fifth output data is identical to the first output data, or to determine whether the sixth output data is identical to the second output data. 
         [0069]    The first computation unit is configured to compute a current count of detection. 
         [0070]    The second comparison unit is configured to determine whether the current count of detection reaches a preset count. 
         [0071]    The output module includes a second computation unit and a first output unit. 
         [0072]    The second computation unit is configured to restore the current count of detection to an initial value. 
         [0073]    The first output unit is configured to output information that the dongle is wrong, information that no dongle is connected to the host, information that the dongle is legitimate or information that the dongle is pirated. 
         [0074]    The first comparison unit is further configured to determine whether all pieces of received fifth output data are respectively identical to corresponding pieces of first output data, or determine whether all pieces of received sixth output data are respectively identical to corresponding pieces of second output data. 
         [0075]    Compared with the prior art, the present invention has the following advantages. 
         [0076]    The identification device is prestored with the detection list and the data volume of the detection list is larger than the volume of the storage of the dongle; in an identification process, the legitimate dongle may return correct output data to the identification device based on the cryptographic algorithm of the legitimate dongle, while the pirated dongle without the correct cryptographic algorithm may return wrong data to the identification device; therefore, the identification device may identify the pirated dongle, and the protection for the dongle is improved. 
     
    
     
       BRIEF DESCRIPTION OF THE ACCOMPANYING DRAWINGS 
         [0077]      FIG. 1  is a flow chart of a method for identifying a pirated dongle according to a first embodiment of the present invention; 
           [0078]      FIG. 2  is a flow chart of a method for identifying a pirated dongle according to a second embodiment of the present invention; 
           [0079]      FIG. 3  is a flow chart of a method for identifying a pirated dongle according to a third embodiment of the present invention; and 
           [0080]      FIG. 4  is a schematic block diagram of a device for identifying a pirated dongle according to a fourth embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
       [0081]    In order to further describe technical means and effects of the present invention, a method and a device for identifying a pirated dongle in the invention are described in conjunction with drawings and preferred embodiments. The detailed embodiments are described as follows. 
       A First Embodiment 
       [0082]    A method for identifying a pirated dongle is provided according to the first embodiment of the present invention. An identification device according to the first embodiment is set in a host, the identification device communicates with a dongle via the host. As shown in  FIG. 1 , the method includes steps  101 - 114 . 
         [0083]    In the step  101 , when the identification device receives a command of dongle invoking, the identification device determines whether there is any dongle connected to the host; if there is a dongle connected to the host, the procedure proceeds to the step  103 ; if no dongle is connected to the host, the procedure proceeds to the step  102 . 
         [0084]    In the step  102 , the identification device outputs information that no dongle is connected to the host and the procedure is ended. 
         [0085]    In the step  103 , the identification device orderly obtains, from the dongle, a VID (vendor identity) and a PID (product identity) of the dongle. 
         [0086]    In the step  104 , the identification device determines whether the obtained VID and the obtained PID are respectively identical to prestored VID and prestored PID; if the obtained VID and the obtained PID are respectively identical to the prestored VID and the prestored PID, the procedure proceeds to the step  105 ; if the obtained VID and the obtained PID are not respectively identical to the prestored VID and the prestored PID, the procedure proceeds to the step  107 . 
         [0087]    In the step  105 , the identification device reads dongle identifier information from the dongle corresponding to the prestored VID and prestored PID. 
         [0088]    According to the embodiment, the dongle identifier information includes a UID (user identity) or a user identifier. 
         [0089]    In the step  106 , the identification device determines whether the read dongle identifier information is identical to prestored dongle identifier information; if the read dongle identifier information is identical to the prestored identifier information, the procedure proceeds to the step  108 ; if the read dongle identifier information is not identical to the prestored identifier information, the procedure proceeds to the step  107 . 
         [0090]    In the step  107 , the identification device outputs information that the dongle is wrong and the procedure is ended. 
         [0091]    In the step  108 , the identification device obtains preset data from a detection list. 
         [0092]    Preferably, according to the embodiment, the identification device randomly obtains the preset data from the detection list. 
         [0093]    According to the embodiment, the detection list is generated by an encryption device in advance and the detection list is stored in the identification device. Data volume of the detection list is larger than a storage capacity of the dongle; preferably, according to the embodiment, the data volume of the detection list is 100 times of the volume of the storage of the dongle. The detection list is stored with encrypted data including second input data and second output data. A method for generating the second input data and the second output data includes: performing computation on first input data by the encryption device based on a first algorithm to obtain first output data, and encrypting the first input data and the first output data by the encryption device based on a second algorithm to obtain the second input data and the second output data; then, the second input data and the second output data are correspondingly stored in the detection list. 
         [0094]    According to the embodiment, the first algorithm is an algorithm of a legitimate dongle. 
         [0095]    Preferably, according to the embodiment, the first algorithm is the algorithm of the legitimate dongle corresponding to user identifier information. 
         [0096]    According to the embodiment, the second algorithm includes a symmetric key cryptographic algorithm and an asymmetric key cryptographic algorithm; the second algorithm includes DES, 3DES, AES, RSA and ECC, etc.; preferably, according to the embodiment, 3DES algorithm is used to encrypt the data in the detection list. 
         [0097]    According to the embodiment, the first input data includes: 
         [0098]    1234567890ABCDEF1234567890ABCDEF, 
         [0099]    12345678123456781234567812345678, 
         [0100]    11223344556677889900AABBCCDDEEFF, and 
         [0101]    FEDCBA0987654321FEDCBA0987654321; 
         [0102]    the algorithm of the legitimate dongle is DES, i.e., DES algorithm is used to perform computation on the first input data with a key of 1122334455667788 so as to obtain the first output data; the first input data and the first output data are shown in the following table: 
         [0000]    
       
         
               
               
             
           
               
                   
               
               
                 First input data 
                 First output data 
               
               
                   
               
             
             
               
                 1234567890ABCDEF1234567890A 
                 80B152BBAB64EAFF80B152BBAB64EAFF 
               
               
                 BCDEF 
               
               
                 123456781234567812345678123456 
                 DD1681F0D761A242DD1681F0D761A242 
               
               
                 78 
               
               
                 11223344556677889900AABBCCD 
                 CD09BC4876AC0F2BB7163C1897EF4700 
               
               
                 DEEFF 
               
               
                 FEDCBA0987654321FEDCBA0987 
                 6DB4D45451E4FFD16DB4D45451E4FFD1 
               
               
                 654321 
               
               
                   
               
             
          
         
       
     
         [0103]    3DES algorithm is used to encrypt the first input data and the first output data with a key of 11223344556677889900AABBCCDDEEFF so as to obtain the second input data and the second output data; then the second input data and the second output data are correspondingly stored in the detection list. The second input data and the second output data are as shown in the following table: 
         [0000]    
       
         
               
               
             
           
               
                   
               
               
                 Second input data 
                 Second output data 
               
               
                   
               
             
             
               
                 1B3606F30B1015071B3606F30B1015 
                 974622F00725BCC3974622F00725BCC3 
               
               
                 07 
               
               
                 1C04C8D866790D061C04C8D866790 
                 7540BFAC29E207CE7540BFAC29E207CE 
               
               
                 D06 
               
               
                 ED0AC87C52A8A551C7C29D70B371 
                 3DA0E025243DA3F5F99FD4126437CA4E 
               
               
                 6684 
               
               
                 4462E4C96A4FF4C54462E4C96A4FF 
                 E2E72852C025A3BFE2E72852C025A3BF 
               
               
                 4C5 
               
               
                   
               
             
          
         
       
     
         [0104]    In the step  109 , the identification device decrypts the obtained preset data to obtain the first input data and the first output data. 
         [0105]    According to the embodiment, the preset data obtained by the identification device includes the second input data 1B3606F30B1015071B3606F30B101507 and the second output data 974622F00725BCC3974622F00725BCC3; the identification device decrypts the above group of data, and the first input data 1234567890ABCDEF1234567890ABCDEF and the first output data 80B152BBAB64EAFF80B152BBAB64EAFF are accordingly obtained. 
         [0106]    In the step  110 , the identification device sends the first input data to the dongle. 
         [0107]    According to the embodiment, the identification device sends the first input data 1234567890ABCDEF1234567890ABCDEF to the dongle. 
         [0108]    According to the embodiment, when the dongle receives the first input data sent by the identification device, the dongle performs computation on the first input data based on an inbuilt algorithm, third output data is accordingly generated; and the dongle returns the third output data to the identification device. 
         [0109]    According to the embodiment, the dongle performs computation on the first input data 1234567890ABCDEF1234567890ABCDEF by using DES algorithm with the key of 112233445566778, the third output data 80B152BBAB64EAFF80B152BBAB64EAFF is accordingly generated; and the dongle returns the third output data to the identification device. 
         [0110]    According to the embodiment, before the step  110 , the method further includes: verifying, by the identification device, whether the dongle is legitimate; if the dongle is legitimate, the procedure is continued; if the dongle is not legitimate, an error is reported and the procedure is ended. The process of verifying whether the dongle is legitimate includes: obtaining, the identification device, a PIN from the dongle by and determining whether the obtained PIN is identical to a PIN in the identification device; if the obtained PIN is identical to a PIN in the identification device, the dongle is legitimate; if the obtained PIN is not identical to a PIN in the identification device, the dongle is not legitimate. According to the embodiment, the PIN in the identification device is input by a user or prestored. 
         [0111]    In the step  111 , the identification device receives the third output data sent from the dongle. 
         [0112]    The step  111  further includes: proceeding to the step  113  in the case that the dongle does not receive the third output data sent by the dongle in a preset detection time; according to the embodiment, the preset detection time lasts 10 seconds. 
         [0113]    According to the embodiment, the third output data received by the identification device in the preset detection time is 80B152BBAB64EAFF80B152BBAB64EAFF. 
         [0114]    In the step  112 , the identification device determines whether the third output data is identical to the first output data; if the third output data is identical to the first output data, the procedure proceeds to the step  114 ; if the third output data is not identical to the first output data, the procedure proceeds to the step  113 . 
         [0115]    According to the embodiment, the third output data is 80B152BBAB64EAFF80B152BBAB64EAFF; the first output data is 80B152BBAB64EAFF80B152BBAB64EAFF. 
         [0116]    In the step  113 , the identification device returns information that the dongle is pirated and stops providing service. 
         [0117]    In the step  114 , the identification device returns information that the dongle is legitimate. 
         [0118]    Alternatively, according to the embodiment, computation may be performed on the first output data based on the second algorithm to obtain the second output data; therefore, after the identification device receives the third output data in the step  111 , computation is performed on the third output data and fourth output data is accordingly obtained; in the step  112 , it is determined whether the fourth output data is identical to the second output data, and corresponding information is returned based on the result of determination. Alternatively, according to the embodiment, the detection list may not be encrypted; consequently in the step  108 , the identification device obtains the first input data and the first output data from the detection list or the identification device obtains the first input data and the second output data from the detection list, and then the procedure proceeds to the step  110  of sending the first input data to the dongle by the identification device. 
       A Second Embodiment 
       [0119]    A method for identifying a pirated dongle is provided according to the second embodiment of the invention. An identification device is set in a host and the identification device communicates with a dongle via the host. As shown in  FIG. 2 , the method includes steps  201 - 216 . 
         [0120]    In the step  201 , when the identification device receives a command of dongle invoking, the identification device determines whether there is any dongle connected to the host; if there is a dongle connected to the host, the procedure proceeds to the step  203 ; if no dongle is connected to the host, the procedure proceeds to the step  202 . 
         [0121]    In the step  202 , the identification device outputs information that no dongle is connected to the host and the procedure is ended. 
         [0122]    In the step  203 , the identification device orderly obtains, from the dongle, a VID (vendor identity) and a PID (product identity) of the dongle. 
         [0123]    In the step  204 , the identification device determines whether the obtained VID and the obtained PID are respectively identical to a prestored VID and a prestored PID; if the obtained VID and the obtained PID are respectively identical to the prestored VID and the prestored PID, the procedure proceeds to the step  205 ; if the obtained VID and the obtained PID are not respectively identical to the prestored VID and the prestored PID, the procedure proceeds to the step  207 . 
         [0124]    In the step  205 , the identification device reads dongle identifier information from the dongle corresponding to the stored VID and PID. 
         [0125]    According to the embodiment, the dongle identifier information includes a UID (user identity) or a user identifier. 
         [0126]    In the step  206 , the identification device determines whether the read dongle identifier information is identical to prestored dongle identifier information; if the read dongle identifier information is identical to the prestored identifier information, the procedure proceeds to the step  208 ; if the read dongle identifier information is not identical to the prestored identifier information, the procedure proceeds to the step  207 . 
         [0127]    In the step  207 , the identification device outputs information that the dongle is wrong and the procedure is ended. 
         [0128]    In the step  208 , the identification device obtains preset data from a detection list. 
         [0129]    Preferably, according to the embodiment, the identification device randomly obtains the preset data from the detection list; alternatively, the identification device may orderly obtain the preset data from the detection list; in a circular detection process, the identification device obtains the data after the preset data obtained in a previous detection. 
         [0130]    According to the embodiment, the detection list is generated by an encryption device in advance and the detection list is stored in the identification device. Data volume of the detection list is larger than a storage capacity of the dongle; preferably, according to the embodiment, the data volume of the detection list is 100 times of the volume of the storage of the dongle. The detection list is stored with encrypted data including second input data and third output data. A method for generating the second input data and the third output data includes: performing computation on first input data by the encryption device based on a first algorithm to obtain first output data, performing a one-way conversion on the first output data based on a second algorithm to obtain second output data, and encrypting the first input data and the second output data by the encryption device based on a third algorithm to obtain the second input data and the third output data; then, the second input data and the third output data are correspondingly stored in the detection list. 
         [0131]    According to the embodiment, the first algorithm is an algorithm of a legitimate dongle. 
         [0132]    Preferably, according to the embodiment, the first algorithm is the algorithm of the legitimate dongle corresponding to user identifier information. 
         [0133]    According to the embodiment, the second algorithm is the one-way conversion such as a digest algorithm; preferably, according to the embodiment, the second algorithm is MD5 algorithm. 
         [0134]    According to the embodiment, the third algorithm includes a symmetrical key cryptographic algorithm and an asymmetrical key cryptographic algorithm; the third algorithm includes DES, 3DES, AES, RSA and ECC, etc.; preferably, 3DES algorithm is used for encrypting the data in the detection list. 
         [0135]    According to the embodiment, the first input data includes: 
         [0136]    1234567890ABCDEF1234567890ABCDEF, 
         [0137]    12345678123456781234567812345678, 
         [0138]    11223344556677889900AABBCCDDEEFF, and 
         [0139]    FEDCBA0987654321FEDCBA0987654321; 
         [0140]    the algorithm of the legitimate dongle is DES, i.e. DES algorithm is used for performing computation on the first input data with a key of 1122334455667788 so as to obtain the first output data; then MD5 algorithm is used for performing the one-way conversion on the first output data so as to obtain the second output data; the first input data, the first output data and the second output data are shown in the following table: 
         [0000]    
       
         
               
               
               
             
           
               
                   
               
               
                 First input data 
                 First output data 
                 Second output data 
               
               
                   
               
             
             
               
                 1234567890ABCDEF123 
                 80B152BBAB64EAFF80B1 
                 BB12EDB2087206CC0745 
               
               
                 4567890ABCDEF 
                 52BBAB64EAFF 
                 D9D16D91E620 
               
               
                 123456781234567812345 
                 DD1681F0D761A242DD16 
                 885B8830B2C63C0728260 
               
               
                 67812345678 
                 81F0D761A242 
                 2DFAE43C474 
               
               
                 11223344556677889900A 
                 CD09BC4876AC0F2BB716 
                 DDC1DC706F7F71190401 
               
               
                 ABBCCDDEEFF 
                 3C1897EF4700 
                 509044A55682 
               
               
                 FEDCBA0987654321FED 
                 6DB4D45451E4FFD16DB4 
                 6F7A7CAD36C9D5014ED 
               
               
                 CBA0987654321 
                 D45451E4FFD1 
                 35D53F3FADF84 
               
               
                   
               
             
          
         
       
     
         [0141]    3DES algorithm is used for encrypting the first input data and the second output data a key of 11223344556677889900AABBCCDDEEFF so as to obtain the second input data and the third output data; then the second input data and the third output data are correspondingly stored in the detection list. The second input data and the third output data are shown in the following table: 
         [0000]    
       
         
               
               
             
           
               
                   
               
               
                 Second input data 
                 Third output data 
               
               
                   
               
             
             
               
                 1B3606F30B1015071B3606F30B1015 
                 3F2654F07C0336CD987E16820232DFB7 
               
               
                 07 
               
               
                 1C04C8D866790D061C04C8D866790 
                 0C2AD91D799FFDD6021BE506DAEAD40B 
               
               
                 D06 
               
               
                 ED0AC87C52A8A551C7C29D70B371 
                 2E8323C02EFC3E1176ABDC4E7085DE92 
               
               
                 6684 
               
               
                 4462E4C96A4FF4C54462E4C96A4FF 
                 02F2A36D0C30DE5FFB89372973FF59AF 
               
               
                 4C5 
               
               
                   
               
             
          
         
       
     
         [0142]    In the step  209 , the identification device decrypts the obtained preset data to obtain the first input data and the second output data. 
         [0143]    According to the embodiment, the preset data obtained by the identification device includes the second input data 1C04C8D866790D061C04C8D866790D06 and the third output data 0C2AD91D799FFDD6021BE506DAEAD40B; the identification device decrypts the group of above data, and the first input data 12345678123456781234567812345678 and the second output data 885B8830B2C63C07282602DFAE43C474 are accordingly obtained. 
         [0144]    In the step  210 , the identification device sends the first input data to the dongle. 
         [0145]    According to the embodiment, the identification device sends the first input data 12345678123456781234567812345678 to the dongle. 
         [0146]    According to the embodiment, when the dongle receives the first input data sent by the identification device, the dongle performs computation on the first input data based on an inbuilt algorithm to generate fourth output data; and the dongle returns the fourth output data to the identification device. 
         [0147]    According to the embodiment, the dongle uses DES algorithm to perform computation on the first input data 1234567812345678123456781234567 with the key of 1122334455667788, the fourth output data DD1681F0D761A242DD1681F0D761A242 is accordingly generated; and the dongle returns the fourth output data to the identification device. 
         [0148]    According to the embodiment, before the step  210 , the method further includes: verifying, by the identification device, whether the dongle is legitimate; if the dongle is legitimate, the procedure is continued; if the dongle is not legitimate, an error is reported and the procedure is ended. The process of verifying whether the dongle is legitimate includes: obtaining, by the identification device, a PIN from the dongle and determining whether the obtained PIN is identical to a PIN in the identification device; if the obtained PIN is identical to a PIN in the identification device, the dongle is legitimate; if the obtained PIN is not identical to a PIN in the identification device, the dongle is not legitimate. According to the embodiment, the PIN in the identification device is input by a user or prestored. 
         [0149]    In the step  211 , the identification device receives the fourth output data returned by the dongle. 
         [0150]    The step  211  further includes: proceeding to the step  215  in the case that the dongle does not receive the fourth output data sent by the dongle in a preset detection time; according to the embodiment, the preset detection time lasts 5 seconds. 
         [0151]    According to the embodiment, the fourth output data received by the identification device in the preset detection time is DD1681F0D761A242DD1681F0D761A242. 
         [0152]    In the step  212 , the identification device performs computation on the fourth output data based on the second algorithm to obtain fifth output data. 
         [0153]    According to the embodiment, the identification device performs computation on the fourth output data by using MD5 algorithm, and accordingly, the fifth output data 885B8830B2C63C07282602DFAE43C474 is obtained. 
         [0154]    In the step  213 , the identification device determines whether the fifth output data is identical to the second output data, if the fifth output data is identical to the second output data, the procedure proceeds to the step  214 ; if the fifth output data is not identical to the second output data, the procedure proceeds to the step  215 . 
         [0155]    According to the embodiment, the fifth output data is 885B8830B2C63C07282602DFAE43C474 and the second output data is 885B8830B2C63C07282602DFAE43C474. 
         [0156]    In the step  214 , the identification device computes a current count of detection and the identification device determines whether the current count of detection reaches a preset count; if the current count of detection reaches the preset count of detection, the procedure proceeds to the step  216 ; if the current count of detection does not reach the preset count of detection, the procedure proceeds to the step  208 . 
         [0157]    For example, according to the embodiment, an initial value of the current count of detection is 0 and the preset count is set to be 4; the current count of detection is incremented by 1 each time when the identification device is detected, till the current count of detection reaches 4. 
         [0158]    In the step  215 , the identification device returns information that the dongle is pirated and stops providing service. 
         [0159]    In the step  216 , the identification device restores the current count of detection to the initial value and the identification device returns information that the dongle is legitimate. 
         [0160]    Alternatively, according to the embodiment, computation may not be performed on the first output data based on the second algorithm; therefore, after the identification device receives the fourth output data in the step  211 , it is determined whether the fourth output data is identical to the first output data, and corresponding information is returned based on the result of determination. Alternatively according to the embodiment, the detection list may not be encrypted; consequently in the step  108 , the identification device obtains the first input data and the first output data from the detection list or the identification device obtains the first input data and the second output data from the detection list, and then the procedure proceeds to the step  210  of sending the first input data to the dongle by the identification device. 
       A Third Embodiment 
       [0161]    A method for identifying a pirated dongle is provided according to the third embodiment of the invention. An identification device is set in a host and the identification device communicates with a dongle via the host. As shown in  FIG. 3 , the method includes steps  301 - 316 . 
         [0162]    In the step  301 , when the identification device receives a command of dongle invoking, the identification device the identification device determines whether there is any dongle connected to the host; if there is a dongle connected to the host, the procedure proceeds to the step  303 ; if no dongle is connected to the host, the procedure proceeds to the step  302 . 
         [0163]    In the step  302 , the identification device outputs information that no dongle is connected to the host and the procedure is ended. 
         [0164]    In the step  203 , the identification device orderly obtains, from the dongle, a VID (vendor identity) and a PID (product identity) of the dongle. 
         [0165]    In the step  304 , the identification device determines whether the obtained VID and the obtained PID are respectively identical to a prestored VID and a prestored PID; if the obtained VID and the obtained PID are respectively identical to the prestored VID and the prestored PID, the procedure proceeds to the step  305 ; if the obtained VID and the obtained PID are not respectively identical to the prestored VID and the prestored PID, the procedure proceeds to the step  307 . 
         [0166]    In the step  305 , the identification device reads dongle identifier information from the dongle corresponding to the stored VID and PID. 
         [0167]    According to the embodiment, the dongle identifier information includes a UID (user identity) or a user identifier. 
         [0168]    In the step  306 , the identification device determines whether the read dongle identifier information is identical to prestored dongle identifier information; if the read dongle identifier information is identical to the prestored identifier information, the procedure proceeds to the step  308 ; if the read dongle identifier information is not identical to the prestored identifier information, the procedure proceeds to the step  307 . 
         [0169]    In the step  307 , the identification device outputs information that the dongle is wrong and the procedure is ended. 
         [0170]    In the step  308 , the identification device obtains preset data from a detection list. 
         [0171]    Preferably, according to the embodiment, the identification device randomly obtains the preset data from the detection list; alternatively, the identification device may orderly obtain the preset data from the detection list; in a circular detection process, the identification device obtains the data after the preset data obtained in a previous detection. 
         [0172]    According to the embodiment, the detection list is generated by an encryption device in advance and the detection list is stored in the identification device. Data volume of the detection list is larger than a storage capacity of the dongle; preferably, according to the embodiment, the data volume of the detection list is 100 times of the volume of the storage of the dongle. The detection list is stored with encrypted data including second input data and third output data. A method for generating the second input data and the third output data includes: performing computation on first input data by the encryption device based on a first algorithm to obtain first output data, performing a one-way conversion on the first output data based on a second algorithm to obtain second output data, and encrypting the first input data and the second output data by the encryption device based on a third algorithm to obtain the second input data and the third output data; then, the second input data and the third output data are correspondingly stored in the detection list. 
         [0173]    According to the embodiment, the first algorithm is an algorithm of a legitimate dongle. 
         [0174]    Preferably, according to the embodiment, the first algorithm is the algorithm of the legitimate dongle corresponding to user identifier information. 
         [0175]    According to the embodiment, the second algorithm is the one-way conversion such as a digest algorithm; preferably, according to the embodiment, the second algorithm is MD5 algorithm. 
         [0176]    According to the embodiment, the third algorithm includes a symmetrical key cryptographic algorithm and an asymmetrical key cryptographic algorithm; the third algorithm includes DES, 3DES, AES, RSA and ECC, etc.; preferably, 3DES algorithm is used for encrypting the data in the detection list. 
         [0177]    According to the embodiment, the first input data includes: 
         [0178]    1234567890ABCDEF1234567890ABCDEF, 
         [0179]    12345678123456781234567812345678, 
         [0180]    11223344556677889900AABBCCDDEEFF, and 
         [0181]    FEDCBA0987654321FEDCBA0987654321; 
         [0182]    the algorithm of the legitimate dongle is DES, i.e. DES algorithm is used to perform computation on the first input data with a key of 1122334455667788 so as to obtain the first output data; then MD5 algorithm is used to perform the one-way conversion on the first output data so as to obtain the second output data; the first input data, the first output data and the second output data are shown in the following table: 
         [0000]    
       
         
               
               
               
             
           
               
                   
               
               
                 First input data 
                 First output data 
                 Second output data 
               
               
                   
               
             
             
               
                 1234567890ABCDEF123 
                 80B152BBAB64EAFF80B1 
                 BB12EDB2087206CC074 
               
               
                 4567890ABCDEF 
                 52BBAB64EAFF 
                 5D9D16D91E620 
               
               
                 123456781234567812345 
                 DD1681F0D761A242DD16 
                 885B8830B2C63C072826 
               
               
                 67812345678 
                 81F0D761A242 
                 02DFAE43C474 
               
               
                 11223344556677889900A 
                 CD09BC4876AC0F2BB716 
                 DDC1DC706F7F7119040 
               
               
                 ABBCCDDEEFF 
                 3C1897EF4700 
                 1509044A55682 
               
               
                 FEDCBA0987654321FED 
                 6DB4D45451E4FFD16DB4 
                 6F7A7CAD36C9D5014E 
               
               
                 CBA0987654321 
                 D45451E4FFD1 
                 D35D53F3FADF84 
               
               
                   
               
             
          
         
       
     
         [0183]    3DES algorithm is used to encrypt the first input data and the second output data with a key of 11223344556677889900AABBCCDDEEFF so as to obtain the second input data and the third output data; then the second input data and the third output data are correspondingly stored in the detection list. The second input data and the third output data are shown in the following table: 
         [0000]    
       
         
               
               
             
           
               
                   
               
               
                 Second input data 
                 Third output data 
               
               
                   
               
             
             
               
                 1B3606F30B1015071B3606F30B101 
                 3F2654F07C0336CD987E16820232DFB7 
               
               
                 507 
               
               
                 1C04C8D866790D061C04C8D86679 
                 0C2AD91D799FFDD6021BE506DAEAD40B 
               
               
                 0D06 
               
               
                 ED0AC87C52A8A551C7C29D70B37 
                 2E8323C02EFC3E1176ABDC4E7085DE92 
               
               
                 16684 
               
               
                 4462E4C96A4FF4C54462E4C96A4F 
                 02F2A36D0C30DE5FFB89372973FF59AF 
               
               
                 F4C5 
               
               
                   
               
             
          
         
       
     
         [0184]    In the step  309 , the identification device decrypts the obtained preset data to obtain the first input data and the second output data. 
         [0185]    According to the embodiment, the preset data obtained by the identification device includes the second input data ED0AC87C52A8A551C7C29D70B3716684 and the third output data 2E8323C02EFC3E1176ABDC4E7085DE92; the identification device decrypts the group of above data, and the first input data 11223344556677889900AABBCCDDEEFF and the second output data DDC1DC706F7F71190401509044A55682 are accordingly obtained. 
         [0186]    According to the embodiment, if the identification device orderly obtains the preset data from the detection list, when obtaining the preset data again, the preset data obtained by the identification device includes the second input data 4462E4C96A4FF4C54462E4C96A4FF4C5 and the third output data 02F2A36D0C30DE5FFB89372973FF59AF. 
         [0187]    In the step  310 , the identification device sends the first input data to the dongle. 
         [0188]    According to the embodiment, the identification device sends the first input data 11223344556677889900AABBCCDDEEFF to the dongle. 
         [0189]    According to the embodiment, when the dongle receives the first input data sent by the identification device, the dongle performs computation on the first input data based on an inbuilt algorithm to generate fourth output data; and the dongle returns the fourth output data to the identification device. 
         [0190]    According to the embodiment, the dongle uses DES algorithm to perform computation on the first input data 11223344556677889900AABBCCDDEEFF with the key of 1122334455667788, the fourth output data CD09BC4876AC0F2BB7163C1897EF4700 is accordingly generated; and the dongle returns the fourth output data to the identification device. 
         [0191]    According to the embodiment, before the step  310 , the method further includes: verifying, by the identification device, whether the dongle is legitimate; if the dongle is legitimate, the procedure is continued; if the dongle is not legitimate, an error is reported and the procedure is ended. The process of verifying whether the dongle is legitimate includes: obtaining, by the identification device, a PIN from the dongle and determining whether the obtained PIN is identical to a PIN in the identification device; if the obtained PIN is identical to a PIN in the identification device, the dongle is legitimate; if the obtained PIN is not identical to a PIN in the identification device, the dongle is not legitimate. According to the embodiment, the PIN in the identification device is input by a user or prestored. 
         [0192]    In the step  311 , the identification device receives the fourth output data returned by the dongle. 
         [0193]    The step  311  further includes: proceeding to the step  315  in the case that the identification device does not receive the fourth output data sent from the dongle in a preset detection time; continuing the procedure in the case that the identification device receives the fourth output data sent from the dongle in the preset detection time; according to the embodiment, the preset detection time lasts 10 seconds. 
         [0194]    According to the embodiment, the fourth output data received by the identification device in the preset detection time is CD09BC4876AC0F2BB7163C1897EF4700. 
         [0195]    In the step  312 , the identification device performs computation on the fourth output data based on the second algorithm to obtain fifth output data. 
         [0196]    According to the embodiment, the identification device performs computation on the fourth output data based on MD5 algorithm, and accordingly, the fifth output data DDC1DC706F7F71190401509044A55682 is obtained. 
         [0197]    In the step  313 , the identification device computes a current count of detection and determines whether the current count of detection reaches a preset count; if the current count of detection reaches the preset count, the procedure proceeds to the step  314 ; if the current count of detection does not reach the preset count otherwise, the procedure proceeds to the step  308 . 
         [0198]    For example, according to the embodiment, an initial value of the current count of detection is 4 and the preset count is set to be 0; 1 is subtracted from the current count of detection each time when the identification device is detected, till the current count of detection becomes 0. 
         [0199]    In the step  314 , the identification device determines whether all pieces of received fifth output data are respectively identical to corresponding pieces of second output data, if all the pieces of received fifth output data are respectively identical to the corresponding pieces of second output data, the procedure proceeds to the step  316 ; if at least one piece of fifth output data is not identical to the corresponding piece of second output data, the procedure proceeds to the step  315 . 
         [0200]    In the step  315 , the identification device returns information that the dongle is pirated and the procedure is ended. 
         [0201]    In the step  316 , the identification device restores the current count of detection to the initial value and the identification device returns information that the dongle is legitimate. 
         [0202]    Alternatively, according to the embodiment, computation may not be performed on the first output data based on the second algorithm; therefore, after the identification device receives the fourth output data in the step  311 , the procedure proceeds to the step  312 ; in the step  314 , it is determined whether all pieces of received fourth output data are respectively identical to corresponding pieces of first output data, and corresponding information is returned based on the result of determination. Alternatively, according to the embodiment, the detection list may not be encrypted; consequently in the step  108 , the identification device obtains the first input data and the first output data from the detection list or the identification device obtains the first input data and the second output data from the detection list, and then the procedure proceeds to the step  310  of sending the first input data to the dongle by the identification device. 
       A Fourth Embodiment 
       [0203]    A device of identifying a pirated dongle is provided according to the fourth embodiment of the invention. As shown in  FIG. 4 , the device includes a first determination module  40 , a storage module  41 , an obtaining module  42 , a sending module  43 , a receiving module  44 , a second determination module  45  and an output module  46 . 
         [0204]    The first determination module  40  is configured to determine whether there is any qualified dongle connected to a host. 
         [0205]    The first determination module  40  includes a first determination unit  401 , a first obtaining unit  402 , a second determination unit  403 , a second obtaining unit  404  and a third determination unit  405 . 
         [0206]    The first determination unit  401  is configured to determine whether there is any dongle connected to the host. 
         [0207]    The first obtaining unit  402  is configured to obtain a first identifier and a second identifier from the dongle. 
         [0208]    The second determination unit  403  is configured to determine whether the first identifier and the second identifier are respectively identical to a first identifier prestored in the identification device and a second identifier prestored in the identification device. 
         [0209]    The second obtaining unit  404  is configured to obtain a user identity from the dongle. 
         [0210]    The third determination unit  405  is configured to determine whether the user identity is identical to a user identity prestored in the identification device. 
         [0211]    The storage module  41  is configured to store a detection list generated by the identification device; where data volume of the detection list is larger than a storage capacity of the dongle. 
         [0212]    The obtaining module  42  is configured to obtain preset data from the detection list and obtain first input data and first output data based on the preset data. 
         [0213]    The sending module  43  is configured to send the first input data to the dongle. 
         [0214]    The receiving module  44  is configured to receive fifth output data computed based on the first input data by the dongle. 
         [0215]    The second determination module  45  is configured to determine whether the fifth output data is identical to the first output data. 
         [0216]    The output module  46  is configured to output information that dongle is wrong, information that no dongle is connected to the host, information that the dongle is legitimate or information that the dongle is pirated. 
         [0217]    The identification device further includes a verification module  47 , a decryption module  48  and a computation module  49 . 
         [0218]    The verification module  47  is configured to verify whether the dongle is legitimate. 
         [0219]    The verification module includes a third obtaining unit  471  and a fourth determination unit  472 . 
         [0220]    The third obtaining unit  471  is configured to obtain a user password from the dongle. 
         [0221]    The fourth determination unit  472  is configured to determine whether the user password is identical to a user password stored in the identification device. 
         [0222]    The decryption module  48  is configured to decrypt the preset data to obtain the first input data and the first output data or to obtain the first input data and the second output data. 
         [0223]    The computation module  49  is configured to compute the fifth output data based on a conversion algorithm to obtain sixth output data. 
         [0224]    The second determination module  45  is further configured to determine whether the sixth data is identical to the second output data. 
         [0225]    The second determination module  45  includes a first comparison unit  451 , a first computation unit  452  and a second comparison unit  453 . 
         [0226]    The first comparison unit  451  is configured to determine whether the fifth output data is identical to the first output data, or determine whether the sixth output data is identical to the second output data. 
         [0227]    The first computation unit  452  is configured to compute a current count of detection. 
         [0228]    The second comparison unit  453  is configured to determine whether the current count of detection reaches to a preset count. 
         [0229]    The output module  46  includes a second computation unit  461  and a first output unit  462 . 
         [0230]    The second computation unit  461  is configured to restore the current count of detection to an initial value. 
         [0231]    The first output unit  462  is configured to output the information that the dongle is wrong, the information that no dongle is connected to the host, the information that the dongle is legitimate or the information that the dongle is pirated. 
         [0232]    The first comparison unit  451  is further configured to determine whether all pieces of received fifth output data are respectively identical to corresponding pieces of first output data, or determine whether all pieces of received sixth data are respectively identical to corresponding pieces of second output data. 
         [0233]    The described embodiments are only preferred embodiments of the invention and the embodiments are not intended to limit the invention. Any alteration or change easily obtained by those skilled in the art based on the invention should fall in the scope of protection of the invention. Therefore, the invention intends to protect what is claimed in claims.