CN106470108B - Method and device for generating password of target event - Google Patents

Method and device for generating password of target event Download PDF

Info

Publication number
CN106470108B
CN106470108B CN201510515381.1A CN201510515381A CN106470108B CN 106470108 B CN106470108 B CN 106470108B CN 201510515381 A CN201510515381 A CN 201510515381A CN 106470108 B CN106470108 B CN 106470108B
Authority
CN
China
Prior art keywords
random number
value
interval
numerical
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510515381.1A
Other languages
Chinese (zh)
Other versions
CN106470108A (en
Inventor
唐志慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510515381.1A priority Critical patent/CN106470108B/en
Publication of CN106470108A publication Critical patent/CN106470108A/en
Application granted granted Critical
Publication of CN106470108B publication Critical patent/CN106470108B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention relates to a method and a device for generating a password of a target event, wherein the method comprises the following steps: when a target event is triggered, acquiring a historical random number list; the historical random number list comprises random numbers corresponding to the generated passwords; generating a target random number which is not located in the historical random number list in the first value interval; and determining the password of the target event according to the target random number. In the invention, a large number of different random values do not need to be generated in advance, so that more time is not occupied by the generation of a large number of different random values in advance; and a large amount of random numerical values generated in advance do not need to be stored locally; therefore, the local large storage space is not occupied.

Description

Method and device for generating password of target event
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for generating a password of a target event.
Background
With the rapid development of the technology, the password technology has become the mainstream of the identity authentication technology, and is widely applied to the fields of electronic commerce, online games, finance and the like, so that the problem of user identity authentication can be effectively solved, and further, the property loss of a user caused by illegal intrusion of a lawbreaker into a user account can be prevented.
At present, in the prior art, when a pure digital password needs to be generated, a large number of passwords with the same digits and different digits can be generated in advance in an interval consisting of one digit and another digit, for example, when a pure digital password with 6 digits needs to be generated, 100 ten thousand different passwords in 000000-999999 are generated in advance, and when a pure digital password with 9 digits needs to be generated, 10 hundred million different passwords in 0-9999999 are generated in advance; then all the generated passwords are stored to the local, and when one password needs to be used, one password can be extracted from the local and used; the extracted password is then deleted locally to avoid duplicate extractions.
However, the process of generating a large number of passwords in advance in the prior art takes a lot of time, and storing a large number of passwords locally takes up a very large storage space.
Disclosure of Invention
To overcome the problems in the related art, the present invention provides a method and an apparatus for generating a password of a target event.
According to a first aspect of embodiments of the present invention, there is provided a method of generating a password for a target event, the method including:
when a target event is triggered, acquiring a historical random number list; the historical random number list comprises random numbers corresponding to the generated passwords;
generating a target random number which is not located in the historical random number list in the first value interval;
and determining the password of the target event according to the target random number.
Further, the method further comprises:
storing the target random number in the historical random number list.
Wherein said generating a target random number not located in said historical random number list within said first value interval comprises:
generating a first interval random number within said first interval;
judging whether the first numerical interval random number is in the historical random number list or not;
and when the first numerical interval random number is not in the historical random number list, determining the first numerical interval random number as the target random number.
Further, the method further comprises:
and when the first value interval random number is positioned in the historical random number list, returning to the step of generating the first value interval random number positioned in the first value interval until the generated first value interval random number is not positioned in the historical random number list.
Further, the method further comprises:
when the first numerical interval random number is located in the historical random number list, counting the generation times of generating the first numerical interval random number in an accumulated mode;
comparing the generation times with preset times;
when the execution times are less than the preset times, returning to the step of generating a first numerical interval random number located in the first numerical interval;
and when the execution times is equal to the preset times, generating a second numerical interval reference number in a second numerical interval which is not coincident with the first numerical interval, and determining the password of the target event according to the second numerical interval reference number.
Wherein the generating a second value interval reference number comprises:
determining a reference value interval according to the difference value between the maximum value and the minimum value in the second value interval and a preset alternative value;
selecting one value from the values not selected from the reference value interval as an encryption base value;
encrypting the encryption basic value according to a preset encryption mode to obtain an encrypted value smaller than the difference value;
and adding the encrypted numerical value and the minimum numerical value in the second numerical value interval to obtain a numerical value positioned in the second numerical value interval, and using the numerical value as the reference number of the second numerical value interval.
Wherein, encrypting the encryption basic value according to a preset encryption mode comprises:
encrypting the encryption basic value according to the following formula;
C=(k1m+k2)mod n;
in the above formula, C is the encrypted numerical value, k1 is a first preset numerical value, k2 is a second preset numerical value, m is the encrypted basic numerical value, n is a third preset numerical value, and mod is a remainder operation symbol.
According to a second aspect of the embodiments of the present invention, there is provided an apparatus for generating a password of a target event, the apparatus including:
the acquisition module is used for acquiring a historical random number list when a target event is triggered; the historical random number list comprises random numbers corresponding to the generated passwords;
the generating module is used for generating a target random number which is not positioned in the historical random number list in the first numerical value interval;
and the determining module is used for determining the password of the target event according to the target random number.
Further, the apparatus further comprises:
and the storage module is used for storing the target random number into the historical random number list.
Wherein the generating module comprises:
the first generating unit is used for generating a first numerical interval random number positioned in the first numerical interval;
the judging unit is used for judging whether the first numerical interval random number is positioned in the historical random number list or not;
a determining unit, configured to determine the first value interval random number as the target random number when the first value interval random number is not located in the history random number list.
Further, the generating module further comprises:
the first generating unit is further configured to return to the step of generating a first value interval random number located in the first value interval when the first value interval random number is located in the history random number list until the generated first value interval random number is not located in the history random number list.
Further, the generating module further comprises:
the statistical unit is used for counting the generation times of generating the first numerical interval random number in an accumulated mode when the first numerical interval random number is located in the historical random number list;
the comparison unit is used for comparing the generation times with preset times;
the first generating unit is further configured to return to the step of generating a first numerical interval random number located in the first numerical interval when the execution times is less than the preset times;
and the second generating unit is used for generating a second numerical value interval reference number in a second numerical value interval which is not overlapped with the first numerical value interval when the execution times is equal to the preset times, and determining the password of the target event according to the second numerical value interval reference number.
Wherein the second generating unit includes:
the determining subunit is used for determining a reference value interval according to the difference value between the maximum value and the minimum value in the second value interval and a preset alternative value;
a selection subunit, configured to select one of the values that have not been selected from the reference value interval as an encryption base value;
the encryption subunit is used for encrypting the encryption basic value according to a preset encryption mode to obtain an encryption value smaller than the difference value;
and the adding subunit is configured to add the encrypted numerical value to the minimum numerical value in the second numerical value interval to obtain a numerical value located in the second numerical value interval, and use the numerical value as the reference number of the second numerical value interval.
The encryption subunit is specifically configured to encrypt the encryption basic value according to the following formula;
C=(k1m+k2)mod n;
in the above formula, C is the encrypted numerical value, k1 is a first preset numerical value, k2 is a second preset numerical value, m is the encrypted basic numerical value, n is a third preset numerical value, and mod is a remainder operation symbol.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects: in the invention, when a target event is triggered, a historical random number list is obtained; the history random number list comprises random numbers corresponding to the generated passwords; generating a target random number which is not positioned in the historical random number list in the first numerical value interval; and determining the password of the target event according to the target random number. According to the method provided by the embodiment of the invention, a large number of different random values do not need to be generated in advance, so that more time is not occupied by the generation of a large number of different random values in advance; and a large amount of random numerical values generated in advance do not need to be stored locally; therefore, the local large storage space is not occupied.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow diagram illustrating a method of generating a password for a target event in accordance with an exemplary embodiment.
FIG. 2 is a flow diagram illustrating a method of generating a password for a target event in accordance with an exemplary embodiment.
FIG. 3 is a flow diagram illustrating a method of generating a password for a target event in accordance with an exemplary embodiment.
FIG. 4 is a block diagram illustrating an apparatus for generating a password for a target event in accordance with an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
FIG. 1 is a flow diagram illustrating a method of generating a password for a target event, as shown in FIG. 1, according to an exemplary embodiment.
In step S101, when a target event is triggered, a history random number list is acquired;
the history random number list comprises random numbers corresponding to the generated passwords;
all random numbers included in the historical random number table are values in the first value interval, and the values are randomly generated values.
In the history process, when a random number in a first value interval is generated and the password of a certain event is determined according to the generated random number, the generated random number is stored in a history random value table.
For example, assume that the historical random number list is shown in Table 1 below. The random numbers 100123, 205489, 374152, 387412, and 587412 stored in table 1 are all random numbers corresponding to passwords generated for certain events in the history.
TABLE 1
Historical random number list
100123
205489
374152
387412
578412
In step S102, a target random number not located in the history random number list is generated in the first value interval;
the target event may be an event that requires generation of an authentication code, for example, when a user wants to log in to the server, the server generates an authentication code so that the user enters the authentication code in the authentication code input box at the time of logging in.
The target event can also be an event needing to generate a password, for example, when a user registers a login account and a login password for logging in a server, if the user does not want to set the login password by himself, the server can randomly generate a login password for the user.
The first value interval may be any two different value intervals with end point values, for example, the first value interval may be 100000 and the first value interval may be 100000-899999 with end point values of 899999.
In this case, a random number that is not in the history random number list may be generated for the target event within the first value interval using an existing random algorithm, and used as the target random number.
For example, the target random number that is not in the history random number list generated in the first value interval is 213025.
In step S103, a password of the target event is determined from the target random number.
Wherein the target random number can be directly used as the password of the target event.
Further, the target random number is stored in the history random number list.
This allows the generation of a password for an event later on without the generation of the same random number corresponding to the password as the one generated for the target event.
For example, the generated random number 213025 is added to the history random number list shown in table 1, resulting in a history random number list shown in table 2.
TABLE 2
Historical random number list
100123
205489
374152
387412
578412
213025
In the embodiment of the invention shown in fig. 1, when a target event is triggered, a history random number list is obtained; the history random number list comprises random numbers corresponding to the generated passwords; generating a target random number which is not positioned in the historical random number list in the first numerical value interval; and determining the password of the target event according to the target random number. According to the method provided by the embodiment of the invention, a large number of different random values do not need to be generated in advance, so that more time is not occupied by the generation of a large number of different random values in advance; and a large amount of random numerical values generated in advance do not need to be stored locally; therefore, the local large storage space is not occupied.
In another embodiment of the present invention, referring to fig. 2, step S102 includes:
in step S201, a first value interval random number within a first value interval is generated;
in step S202, it is determined whether the first value interval random number is in the history random number list;
the method comprises the steps of obtaining a first random number in a history random number list, comparing the first random number with a first numerical interval random number, and determining that the first numerical interval random number is located in the history random number list if the first random number is the same as the first numerical interval random number. If the two are different, a second random number in the historical random number list is obtained, the second random number is compared with the first numerical interval random number, and if the second random number is the same as the first numerical interval random number, the first numerical interval random number is determined to be located in the historical random number list. And if the two random numbers are different, acquiring a third random number in the historical random number list, and continuing to execute the steps until the last random number in the historical random number list is acquired, if the last random number is the same as the first numerical interval random number, determining that the first numerical interval random number is positioned in the historical random number list, and if the last random number is different from the first numerical interval random number, determining that the first numerical interval random number is not positioned in the historical random number list.
When the first value range random number is not located in the history random number list, the first value range random number is determined as the target random number in step S203.
When the first value interval random number is not in the history random number list, it indicates that the password of an event is not determined according to the first value interval random number in the history process, that is, the first value interval random number is not taken as the random number corresponding to the password of the event, so that the password of the target event can be determined according to the first value interval random number.
For example, assume that the first numerical range random number generated in step S201 is 213025; if the same random number as the first value interval random number 213025 is not found in the history random number list shown in table 1, it means that the password of an event has not been determined from the first value interval random number 213025 in the history process, that is, the first value interval random number 213025 has not been taken as the random number corresponding to the password of an event, and therefore, the password of the target event can be determined from the first value interval random number 213025.
When the first value interval random number is in the history random number list, returning to step S201: generating a first range random number within a first range of values; until the generated first value interval random number is not in the history random number list.
When the first value interval random number is in the history random number list, it is described that the password of an event is determined according to the first value interval random number in the history process, that is, the first value interval random number is used as the random number corresponding to the password of the event, so that, in order to avoid that the random numbers corresponding to the passwords of a plurality of different events are the same, a first value interval random number in the first value interval needs to be generated again until the generated first value interval random number is not in the history random number list, that is, until the generated first value interval random number is not used as the random number corresponding to the password of the event in the history process, that is, until the first value interval random number is not in the history random number list. Therefore, when the first value section random number is located in the history random number list, the process returns to step S201.
For example, assume that the first numerical range random number generated in step S201 is 205489; if the first random number 100123 in the history random number list shown in table 1 is acquired, and the first random number 100123 is compared with the first value interval random number 205489, and if the first random number 100123 is different from the first value interval random number 205489, the second random number 205489 in the history random number list is acquired, and the second random number 205489 is compared with the first value interval random number 205489, and if the second random number is the same as the first value interval random number 205489, it indicates that the first value interval random number 205489 is located in the history random number list, and the step S201 is returned until the generated first value interval random number is not located in the history random number list.
In another embodiment of the present invention, referring to fig. 3, when the first value interval random number is located in the history random number list, the method further comprises the steps of:
in step S301, the number of times of generating a first numerical interval random number is counted up and accumulated;
when the target event is triggered, counting is carried out each time a first value interval random number in a first value interval is generated for the target event.
For example, when a first value interval random number within a first value interval is generated for a target event for the first time, the generation number is set to 1; if the first value interval random number generated for the first time is located in the historical random number list, a first value interval random number located in the first value interval is generated for the target event again, and the generation times 1 and the value 1 are added to obtain the generation times 2.
In step S302, the generation number is compared with a preset number;
in the embodiment shown in fig. 2 of the present invention, the password of the target event is not determined according to the generated first value interval random number until the generated first value interval random number is not located in the history random number list. Otherwise, step S201 is executed all the time: a first interval random number is generated within the first interval. However, sometimes it is likely that a first value interval random number not located in the history random number list is obtained after the step S201 is performed many times, but although the password of the target event can be determined according to the first value interval random number not located in the history random number list, since the step S201 is performed many times, the whole process takes much time, and the step S201 is performed many times, and many system resources are occupied. Thus, the embodiment of FIG. 2 of the present invention does not meet the demand time requirement when the password of the target event needs to be obtained quickly.
Therefore, in the embodiment of the present invention shown in fig. 3, the technician sets the preset number locally in advance, so that when the generation number of the random number in the first value interval, which is located in the first value interval, generated for the target event reaches the preset number, in order to ensure that a password which has not been generated for other events before can be generated for the target event immediately, the process does not return to step S201, and step S303 is executed.
When the generation number of the first value interval random number within the first value interval generated for the target event reaches the preset number, the process may return to step S201 again.
For example, assuming that the preset number of times is 3, when both the first numeric-interval random number within the first numeric interval generated for the target event for the first time and the first numeric-interval random number within the first numeric interval generated for the target event for the second time are in the historical random number list, if the first numeric-interval random number within the first numeric interval generated for the target event for the third time is also in the historical random number list, in order to ensure that a password that has not been generated for another event before can be immediately generated for the target event, the process does not return to step S201, and step S303 is executed.
When the execution times is less than the preset times, in step S201, generating a first value interval random number located in the first value interval;
when the execution times is equal to the preset times, in step S303, a second value interval reference number is generated within a second value interval that does not overlap with the first value interval;
any value in the second value interval is different from any value in the first value interval.
For example, the second value range is 900000-999999; wherein, the second value interval 900000-999999 is not overlapped with the first value interval 100000-899999.
The step can be specifically realized by the following process, including:
11) determining a reference value interval according to the difference value between the maximum value and the minimum value in the second value interval and a preset alternative value;
specifically, two endpoint values of a second value interval are obtained; subtracting the larger end point value from the smaller end point value to obtain a difference value, and then forming a reference value interval taking the preset alternative value and the difference value as the end point value;
the preset candidate value is different from the difference, and the preset candidate value may be greater than the difference or smaller than the difference, which is not limited in the present invention. The present invention is illustrated by taking the example that the preset candidate value is smaller than the difference, but not by limiting the protection scope of the present invention.
For example, the second value interval is 900000-999999, which is not overlapped with the first value interval 000000-899999, and the values of the two end points of the second value interval 900000-999999 are 900000 and 99999999, respectively. Of these two endpoint values, endpoint value 999999 is the larger endpoint value and endpoint value 900000 is the smaller endpoint value. Subtracting the larger end point value 999999 from the smaller end point value 900000 to obtain a difference value 99999, and if the preset candidate value is 0, forming a reference value interval 0-99999 with the preset candidate value 0 and the difference value 99999 as end point values.
12) Selecting one value from the values which are not selected from the reference value interval as an encryption basic value;
generally, in this step, when a value is selected from the reference value range 0 to 99999, the value is selected according to a rule of sequentially selecting the values, for example, when the value is selected from the reference value range 0 to 99999 for the first time, the value 0 is selected from the reference value range 0 to 99999 for the second time, the value 1 is selected as the encryption basic value when the value is selected from the reference value range 0 to 99999 for the second time, the value 2 is selected as the encryption basic value when the value is selected from the reference value range 0 to 99999 for the third time, and so on, that is, when a value is selected from the reference value range 0 to 99999 for the nth time, the selected value is N-1 as the encryption basic value. In this way it can be ensured that the value selected from the reference value interval each time has never been selected during the history.
13) Encrypting the encrypted basic numerical value according to a preset encryption mode to obtain an encrypted numerical value smaller than the difference value;
specifically, the encryption base value may be encrypted according to the following formula;
C=(k1m+k2)mod n;
in the above formula, C is an encrypted numerical value, k1 is a first preset numerical value, k2 is a second preset numerical value, m is an encrypted basic numerical value, n is a third preset numerical value, and mod is a remainder operation symbol.
For example, assuming that the first preset numerical value k1 is 7, the second preset numerical value k2 is 3, the third preset numerical value n is 26, and the encryption basic numerical value selected from the reference numerical value ranges 0 to 99999 is 13, the first preset numerical value 7 is multiplied by the encryption basic numerical value 13 to obtain a numerical value 91, the numerical value 91 is added to the second preset numerical value 3 to obtain a numerical value 94, the numerical value 94 is divided by the third preset numerical value 26 to obtain a remainder 14, and the remainder 14 is used as the encryption numerical value.
14) And adding the encrypted numerical value and the minimum numerical value in the second numerical value interval to obtain a numerical value in the second numerical value interval, and using the numerical value as a reference number of the second numerical value interval.
And 900014 is obtained by adding the encrypted value 14 and the smaller end point value 900000 of the second numerical interval 900000-999999, and the obtained result is used as the reference number of the second numerical interval. Wherein 900014 is located in the second numerical range 900000 ~ 999999.
In step S304, the password of the target event is determined according to the second numerical interval reference number.
For example, the password for the target event is determined from the second numerical interval reference 900014.
Wherein, the second numerical interval reference number can be directly used as the password of the target event. For example, the second numerical interval reference number 900014 is used as the password for the target event.
FIG. 4 is a block diagram illustrating an apparatus for generating a password for a target event in accordance with an exemplary embodiment. Referring to fig. 4, the apparatus includes:
an obtaining module 11, configured to obtain a history random number list when a target event is triggered; the historical random number list comprises random numbers corresponding to the generated passwords;
a generating module 12, configured to generate a target random number that is not in the history random number list within the first value interval;
and the determining module 13 is configured to determine a password of the target event according to the target random number.
In the embodiment of the present invention shown in fig. 4, when a target event is triggered, a history random number list is obtained; the history random number list comprises random numbers corresponding to the generated passwords; generating a target random number which is not positioned in the historical random number list in the first numerical value interval; and determining the password of the target event according to the target random number. According to the method provided by the embodiment of the invention, a large number of different random values do not need to be generated in advance, so that more time is not occupied by the generation of a large number of different random values in advance; and a large amount of random numerical values generated in advance do not need to be stored locally; therefore, the local large storage space is not occupied.
Further, the apparatus further comprises:
and the storage module is used for storing the target random number into the historical random number list.
Wherein the generating module 12 comprises:
the first generating unit is used for generating a first numerical interval random number positioned in the first numerical interval;
the judging unit is used for judging whether the first numerical interval random number is positioned in the historical random number list or not;
a determining unit, configured to determine the first value interval random number as the target random number when the first value interval random number is not located in the history random number list.
Further, the generating module 12 further includes:
the first generating unit is further configured to return to the step of generating a first value interval random number located in the first value interval when the first value interval random number is located in the history random number list until the generated first value interval random number is not located in the history random number list.
Further, the generating module 12 further includes:
the statistical unit is used for counting the generation times of generating the first numerical interval random number in an accumulated mode when the first numerical interval random number is located in the historical random number list;
the comparison unit is used for comparing the generation times with preset times;
the first generating unit is further configured to return to the step of generating a first numerical interval random number located in the first numerical interval when the execution times is less than the preset times;
and the second generating unit is used for generating a second numerical value interval reference number in a second numerical value interval which is not overlapped with the first numerical value interval when the execution times is equal to the preset times, and determining the password of the target event according to the second numerical value interval reference number.
Wherein the second generating unit includes:
the determining subunit is used for determining a reference value interval according to the difference value between the maximum value and the minimum value in the second value interval and a preset alternative value;
a selection subunit, configured to select one of the values that have not been selected from the reference value interval as an encryption base value;
the encryption subunit is used for encrypting the encryption basic value according to a preset encryption mode to obtain an encryption value smaller than the difference value;
and the adding subunit is configured to add the encrypted numerical value to the minimum numerical value in the second numerical value interval to obtain a numerical value located in the second numerical value interval, and use the numerical value as the reference number of the second numerical value interval.
The encryption subunit is specifically configured to encrypt the encryption basic value according to the following formula;
C=(k1m+k2)mod n;
in the above formula, C is the encrypted numerical value, k1 is a first preset numerical value, k2 is a second preset numerical value, m is the encrypted basic numerical value, n is a third preset numerical value, and mod is a remainder operation symbol.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (6)

1. A method of generating a password for a target event, the method comprising:
when a target event is triggered, acquiring a historical random number list; the historical random number list comprises random numbers corresponding to the generated passwords;
generating a target random number not located in the historical random number list within a first value interval;
determining a password of the target event according to the target random number;
wherein said generating a target random number not located in said historical random number list within a first value interval comprises:
generating a first interval random number within said first interval;
judging whether the first numerical interval random number is in the historical random number list or not;
determining the first numerical interval random number as the target random number when the first numerical interval random number is not located in the history random number list;
the method further comprises the following steps:
when the first value interval random number is in the historical random number list, returning to the step of generating the first value interval random number in the first value interval until the generated first value interval random number is not in the historical random number list;
the method further comprises the following steps:
when the first numerical interval random number is located in the historical random number list, counting the generation times of generating the first numerical interval random number in an accumulated mode;
comparing the generation times with preset times;
when the generation times are smaller than the preset times, returning to the step of generating a first numerical interval random number located in the first numerical interval;
when the generation times are equal to the preset times, generating a second numerical interval reference number in a second numerical interval which is not coincident with the first numerical interval, and determining the password of the target event according to the second numerical interval reference number;
wherein the generating a second value interval reference number comprises:
determining a reference value interval according to the difference value between the maximum value and the minimum value in the second value interval and a preset alternative value;
selecting an encryption base value, wherein the encryption base value is a selected one of the values that have not been selected within the reference value interval;
encrypting the encryption basic value according to a preset encryption mode to obtain an encrypted value smaller than the difference value;
and adding the encrypted numerical value and the minimum numerical value in the second numerical value interval to obtain a numerical value positioned in the second numerical value interval, and using the numerical value as the reference number of the second numerical value interval.
2. The method of claim 1, further comprising:
storing the target random number in the historical random number list.
3. The method according to claim 1, wherein the encrypting the encryption base value according to the preset encryption mode comprises:
encrypting the encryption basic value according to the following formula;
C=(k1m+k2)mod n;
wherein, in the above formula, C is the encrypted value, k1Is a first predetermined value, k2Is a second preset value, m is the encryption base value, n is a third preset value, mod is a remainder operation symbol.
4. An apparatus for generating a password for a target event, the apparatus comprising:
the acquisition module is used for acquiring a historical random number list when a target event is triggered; the historical random number list comprises random numbers corresponding to the generated passwords;
a generation module, configured to generate a target random number that is not located in the history random number list within a first value interval;
the determining module is used for determining the password of the target event according to the target random number;
wherein the generating module comprises:
the first generating unit is used for generating a first numerical interval random number positioned in the first numerical interval;
the judging unit is used for judging whether the first numerical interval random number is positioned in the historical random number list or not;
a determining unit configured to determine the first value interval random number as the target random number when the first value interval random number is not located in the history random number list;
the generation module further comprises:
the first generating unit is further configured to return to the step of generating a first value interval random number located in the first value interval when the first value interval random number is located in the historical random number list, until the generated first value interval random number is not located in the historical random number list;
the generation module further comprises:
the statistical unit is used for counting the generation times of generating the first numerical interval random number in an accumulated mode when the first numerical interval random number is located in the historical random number list;
the comparison unit is used for comparing the generation times with preset times;
the first generating unit is further configured to return to the step of generating a first numerical interval random number located in the first numerical interval when the generation number is smaller than the preset number;
a second generating unit, configured to generate a second numerical interval reference number in a second numerical interval that does not overlap with the first numerical interval when the generation number is equal to the preset number, and determine the password of the target event according to the second numerical interval reference number;
wherein the second generating unit includes:
the determining subunit is used for determining a reference value interval according to the difference value between the maximum value and the minimum value in the second value interval and a preset alternative value;
a selecting subunit, configured to select an encryption base value, where the encryption base value is a selected one of the unselected values in the reference value interval;
the encryption subunit is used for encrypting the encryption basic value according to a preset encryption mode to obtain an encryption value smaller than the difference value;
and the adding subunit is configured to add the encrypted numerical value to the minimum numerical value in the second numerical value interval to obtain a numerical value located in the second numerical value interval, and use the numerical value as the reference number of the second numerical value interval.
5. The apparatus of claim 4, further comprising:
and the storage module is used for storing the target random number into the historical random number list.
6. The apparatus according to claim 4, wherein the encryption subunit is specifically configured to encrypt the encryption base value according to the following formula;
C=(k1m+k2)mod n;
wherein, in the above formula, C is the encrypted value, k1Is a first predetermined value, k2Is a second predetermined value, m isAnd n is a third preset value, and mod is a complementation operation symbol.
CN201510515381.1A 2015-08-20 2015-08-20 Method and device for generating password of target event Active CN106470108B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510515381.1A CN106470108B (en) 2015-08-20 2015-08-20 Method and device for generating password of target event

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510515381.1A CN106470108B (en) 2015-08-20 2015-08-20 Method and device for generating password of target event

Publications (2)

Publication Number Publication Date
CN106470108A CN106470108A (en) 2017-03-01
CN106470108B true CN106470108B (en) 2020-02-14

Family

ID=58229703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510515381.1A Active CN106470108B (en) 2015-08-20 2015-08-20 Method and device for generating password of target event

Country Status (1)

Country Link
CN (1) CN106470108B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111355645A (en) * 2020-03-06 2020-06-30 海信(广东)空调有限公司 Household appliance, cloud server and corresponding data transmission method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938359A (en) * 2010-09-14 2011-01-05 联通兴业科贸有限公司 Method and system for password generation in card production course
CN103516525A (en) * 2013-10-22 2014-01-15 天地融科技股份有限公司 Dynamic password generation method and system
CN104049935A (en) * 2013-09-13 2014-09-17 深圳报业集团印务有限公司 Method for generating variable printing random numbers of newspapers

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4940824B2 (en) * 2006-08-18 2012-05-30 富士通セミコンダクター株式会社 Nonvolatile semiconductor memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938359A (en) * 2010-09-14 2011-01-05 联通兴业科贸有限公司 Method and system for password generation in card production course
CN104049935A (en) * 2013-09-13 2014-09-17 深圳报业集团印务有限公司 Method for generating variable printing random numbers of newspapers
CN103516525A (en) * 2013-10-22 2014-01-15 天地融科技股份有限公司 Dynamic password generation method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《JAVA 语言随机数的产生及其应用》;李连第;《浙江工贸职业技术学院学报》;20051231;第5卷(第4期);第78页 *

Also Published As

Publication number Publication date
CN106470108A (en) 2017-03-01

Similar Documents

Publication Publication Date Title
CN109067791B (en) User identity authentication method and device in network
JP6285536B2 (en) System and method for encrypting data
US10431123B2 (en) Method for testing and hardening software applications
US9569176B2 (en) Deriving entropy from multiple sources having different trust levels
JP6676623B2 (en) Method and apparatus for unlocking a user interface
US20170244547A1 (en) Method of testing the resistance of a circuit to a side channel analysis
CN108628611B (en) Data calling method and data calling device
US10715320B2 (en) Password generation with key and derivation parameter
CN105591743B (en) Method and device for identity authentication through equipment operation characteristics of user terminal
US8904482B1 (en) Techniques for securing a one-time passcode with an alteration code
US20150318999A1 (en) Derivation of a Device-Specific Value
US10885516B2 (en) Secure validation using hardware security modules
EP3410334B1 (en) Method for authenticating an intergrated circuit device
CN111971931A (en) Method for verifying transactions in a blockchain network and nodes forming the network
WO2021137769A1 (en) Method and apparatus for sending and verifying request, and device thereof
AU2017273371B2 (en) Method and device for preventing server from being attacked
US10630471B1 (en) System and method for enforcement of correctness for key derivation
FR3102272A1 (en) PERIODIC RANDOM FUNCTION GENERATION IN CLOUD COMPUTER
CN106470108B (en) Method and device for generating password of target event
US20220147613A1 (en) Automatic password expiration based on password integrity
US20170180345A1 (en) Multi-factor user authentication based on user credentials and entry timing
JP2018517347A (en) Method for generating a value specific to an electronic circuit, electronic circuit for generating this value, and method for using such a value
CN115292729A (en) Privacy-protecting multi-party data processing method, device and equipment
CN111092721B (en) Method and device for setting access password
JP6411321B2 (en) Authentication means selection device, authentication means selection method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200922

Address after: Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200922

Address after: Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: Grand Cayman Islands

Patentee before: Alibaba Group Holding Ltd.