CN106780880B - Method for generating cipher code, device and smart lock - Google Patents

Method for generating cipher code, device and smart lock Download PDF

Info

Publication number
CN106780880B
CN106780880B CN201611141964.3A CN201611141964A CN106780880B CN 106780880 B CN106780880 B CN 106780880B CN 201611141964 A CN201611141964 A CN 201611141964A CN 106780880 B CN106780880 B CN 106780880B
Authority
CN
China
Prior art keywords
smart lock
password
array
group
obtains
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
CN201611141964.3A
Other languages
Chinese (zh)
Other versions
CN106780880A (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.)
Shenzhen Song Chuang Technology Co Ltd
State Grid Corp of China SGCC
State Grid Beijing Electric Power Co Ltd
Original Assignee
Shenzhen Song Chuang Technology Co Ltd
State Grid Corp of China SGCC
State Grid Beijing Electric Power Co 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 Shenzhen Song Chuang Technology Co Ltd, State Grid Corp of China SGCC, State Grid Beijing Electric Power Co Ltd filed Critical Shenzhen Song Chuang Technology Co Ltd
Priority to CN201611141964.3A priority Critical patent/CN106780880B/en
Publication of CN106780880A publication Critical patent/CN106780880A/en
Application granted granted Critical
Publication of CN106780880B publication Critical patent/CN106780880B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00817Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the lock can be programmed

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Lock And Its Accessories (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a kind of method for generating cipher code, device and smart locks.Wherein, this method comprises: obtaining smart lock number;Smart lock is numbered using default initial key and carries out cryptographic calculation, obtains the key of smart lock;Obtain the password group # of user's input;Password group # is filled, password group # array is obtained;Cryptographic calculation is carried out using the key pair password group # array of smart lock, obtains the first dynamic password.The present invention solves the technical problem that smart lock cryptosecurity performance is low in the prior art.

Description

Method for generating cipher code, device and smart lock
Technical field
The present invention relates to smart lock fields, in particular to a kind of method for generating cipher code, device and smart lock.
Background technique
The smart lock that cooperation batch meter uses is very universal in current application, since smart lock can be using Password Input Mode verifies the identity of user, solves the inconvenience with key and loses key bring risk.
The password of existing smart lock frequently with smart lock code keyboard, 3des key algorithm or key dispersion technology, and Password is stored in the EEPROM of smart lock, the password of use be it is fixed, need user oneself increase, delete, modification; The password of other passwords can be modified super code;And password is usually to be made of 6 bit digitals, that is to say, that be up to 100 Ten thousand groups of passwords;Since password is fixed storage in the chip of EEPROM, and the cipher code set that can be used is limited, and usually one makes One group of user;Thus exist after a certain group of password be leaked, all passwords is needed all to replace;It can not know it is not in reality It is that someone has revealed password, so that the coded lock safety using this fixed password is relatively low.General producer may require that user A period of time replaces a password.
For the low problem of the above-mentioned cryptosecurity performance of smart lock in the prior art, effective solution side is not yet proposed at present Case.
Summary of the invention
The embodiment of the invention provides a kind of method for generating cipher code, device and smart locks, at least to solve in the prior art The low technical problem of smart lock cryptosecurity performance.
According to an aspect of an embodiment of the present invention, a kind of method for generating cipher code is provided, comprising: obtain smart lock and compile Number;Smart lock is numbered using default initial key and carries out cryptographic calculation, obtains the key of smart lock;Obtain the close of user's input Code character number;Password group # is filled, password group # array is obtained;Use the key pair password group # of smart lock Array carries out cryptographic calculation, obtains the first dynamic password.
Further, after obtaining the first dynamic password, comprising: to each byte of the first dynamic password to 10 remainders, Obtain the second dynamic password.
Further, after acquisition smart lock number, further includes: determine whether smart lock number is 8 bytes;In smart lock In the case that number is not 8 bytes, smart lock number is converted into 8 bytes.
Further, password group # is filled, obtains password group # array, comprising: using 0,x80 16 into It makes several pairs of password group # to be filled, obtained password group # array is an array of 8 byte lengths.
Further, cryptographic calculation is that 3DES disperses the symmetry algorithms such as cryptographic calculation or DES, presets the length of initial key For 128 bit.
According to another aspect of an embodiment of the present invention, a kind of password generating apparatus is additionally provided, comprising: first obtains mould Block, for obtaining smart lock number;First encrypting module, for using default initial key to carry out encryption fortune to smart lock number It calculates, obtains the key of smart lock;Second obtains module, for obtaining the password group # of user's input;Module is filled, being used for will Password group # is filled, and obtains password group # array;Second encrypting module, for using the key pair password of smart lock Group # array carries out cryptographic calculation, obtains the first dynamic password.
Further, device further include: remainder module is obtained for each byte to the first dynamic password to 10 remainders To the second dynamic password.
Further, device further include: determining module, for first acquisition module get smart lock number after, really Determine whether smart lock number is 8 bytes;Conversion module, in the case where smart lock number is not 8 byte, smart lock to be compiled Number be converted to 8 bytes.
Further, filling module include: filling submodule, for using 0x80 hexadecimal number to password group # into Row filling, obtained password group # array are an array of 8 byte lengths.
According to another aspect of an embodiment of the present invention, a kind of smart lock, including above-mentioned password generating apparatus are additionally provided.
In embodiments of the present invention, by obtaining smart lock number;Smart lock is numbered using default initial key and is carried out Cryptographic calculation obtains the key of smart lock;Obtain the password group # of user's input;Password group # is filled, is obtained Password group # array;Cryptographic calculation is carried out using the key pair password group # array of smart lock, obtains the first dynamic password, Achieve the purpose that generate dynamic password, and under the premise of not changing original smart lock Password Input habit, to password Generating mode is changed, and keeps smart lock more convenient when in use, is not needed artificial increase, modification, is deleted password, close Code can be with dynamic generation, and has uniqueness, and security performance is high, and then solves smart lock cipher safety in the prior art The low technical problem of energy.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of according to embodiments of the present invention 1 method for generating cipher code;And
Fig. 2 is a kind of structure chart of according to embodiments of the present invention 2 password generating apparatus.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of the method for method for generating cipher code is provided, it should be noted that attached The step of process of figure illustrates can execute in a computer system such as a set of computer executable instructions, though also, So logical order is shown in flow charts, but in some cases, it can be to be different from shown by sequence execution herein Or the step of description.
Fig. 1 is method for generating cipher code according to an embodiment of the present invention, as shown in Figure 1, this method comprises the following steps:
Step S102 obtains smart lock number.
Specifically, the number of each smart lock is unique.
Step S104 numbers smart lock using default initial key and carries out cryptographic calculation, obtains the key of smart lock.
Specifically, default initial key customized can be modified, by modifying default initial key, the first final dynamic Password can also change correspondingly, the risk that can prevent user password from revealing.
Step S106 obtains the password group # of user's input.
Specifically, password group # can be customized by the user setting, some lucky numbers can be used for example, such as 88,66 etc., the birthday of user also can be used, and password group # can be set by intelligent mobile terminal, such as mobile phone It sets.
S106 through the above steps joined password group # during password generates, that is to say, that final the One dynamic password can be customized by the user selection.
Password group # is filled by step S108, obtains password group # array.
Step S110 carries out cryptographic calculation using the key pair password group # array of smart lock, it is close to obtain the first dynamic Code.
In embodiments of the present invention, by obtaining smart lock number;Smart lock is numbered using default initial key and is carried out Cryptographic calculation obtains the key of smart lock;Obtain the password group # of user's input;Password group # is filled, is obtained Password group # array;Cryptographic calculation is carried out using the key pair password group # array of smart lock, obtains the first dynamic password, Achieve the purpose that generate dynamic password, and under the premise of not changing original smart lock Password Input habit, to password Generating mode is changed, and keeps smart lock more convenient when in use, is not needed artificial increase, modification, is deleted password, close Code can be with dynamic generation, and has uniqueness, and security performance is high, and then solves smart lock cipher safety in the prior art The low technical problem of energy.
In an alternative embodiment, after step S110, comprising: step S202, to each of first dynamic password Byte obtains the second dynamic password to 10 remainders.
In an alternative embodiment, after step S102, further includes: whether step S302 determines smart lock number For 8 bytes;In the case where smart lock number is not 8 byte, smart lock number is converted into 8 bytes.
Specifically, 0 can be added before smart lock is numbered if smart lock numbers inadequate 8 byte, until smart lock is numbered Byte can be deleted accordingly if smart lock is numbered more than 8 bytes for 8 bytes.
In an alternative embodiment, step S108 includes: to be carried out using 0x80 hexadecimal number to password group # Filling, obtained password group # array are an array of 8 byte lengths.
In an alternative embodiment, cryptographic calculation is that 3DES disperses the symmetry algorithms such as cryptographic calculation or DES, is preset just The length of beginning key is 128 bit.
In an alternative embodiment, after obtaining smart lock number, smart lock can be numbered and is set as LID, LID is by one The array of a 8 byte forms, and presetting initial key is 128 bit, can be set to VKEY, using VKEY as encryption key to LID into Row 3DES disperses cryptographic calculation, obtains the key of smart lock, the length of the key of the smart lock is also 128 bit, the smart lock Key be exactly smart lock privately owned private key, can be set to PKEY;It is then possible to password group # is inputted by user, and And password group # is filled with 0x80 hexadecimal number, obtained password group # array is one of 8 byte lengths Array, such as the password group # that inputs are 01, then the password group # array generated be exactly (0x01,0x80,0x80, 0x80,0x80,0x80,0x80,0x80), password group # array can be set as GNUM;Then using PKEY as encryption key pair GNUM carries out 3DES and disperses cryptographic calculation, obtains the first dynamic password, and the length of the first dynamic password is 8 bytes, then by the 8 numbers that each byte of the array of one dynamic password to 10 complementations, obtain are exactly the second dynamic password, can be with It is set as PASSWD.
Embodiment 2
According to embodiments of the present invention, a kind of product embodiments of password generating apparatus are provided, Fig. 2 is real according to the present invention The password generating apparatus of example is applied, as shown in Fig. 2, the device includes the first acquisition module, the first encrypting module, the second acquisition mould Block, filling module and the second encrypting module.
Wherein, first module is obtained, for obtaining smart lock number;First encrypting module, for using default initial close Key numbers smart lock and carries out cryptographic calculation, obtains the key of smart lock;Second obtains module, for obtaining the close of user's input Code character number;It fills module and obtains password group # array for password group # to be filled;Second encrypting module is used In carrying out cryptographic calculation using the key pair password group # array of smart lock, the first dynamic password is obtained.
In embodiments of the present invention, module is obtained by first obtain smart lock number;First encrypting module uses default Initial key numbers smart lock and carries out cryptographic calculation, obtains the key of smart lock;Second, which obtains module, obtains user's input Password group #;Password group # is filled by filling module, obtains password group # array;Second encrypting module uses intelligence The key pair password group # array that can be locked carries out cryptographic calculation, obtains the first dynamic password, has reached and has generated dynamic password Purpose, and under the premise of not changing original smart lock Password Input habit, the generating mode of password is changed, is made Smart lock is more convenient when in use, does not need artificial increase, modification, deletes password, password can be with dynamic generation, and has There is uniqueness, security performance is high, and then solves the technical problem that smart lock cryptosecurity performance is low in the prior art.
In an alternative embodiment, device further include: remainder module, for each byte to the first dynamic password To 10 remainders, the second dynamic password is obtained.
In an alternative embodiment, device further include: determining module, for getting intelligence in the first acquisition module After lock number, determine whether smart lock number is 8 bytes;Conversion module, for the case where smart lock number is not 8 byte Under, smart lock number is converted into 8 bytes.
In an alternative embodiment, filling module includes: filling submodule, for using 0x80 hexadecimal number pair Password group # is filled, and obtained password group # array is an array of 8 byte lengths.
Embodiment 3
According to embodiments of the present invention, a kind of product embodiments of smart lock are provided, which includes that above-mentioned password is raw At device.
In an alternative embodiment, the smart lock in the present invention can cooperate batch meter to use.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-OnlyMemory), arbitrary access are deposited Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of method for generating cipher code characterized by comprising
Obtain smart lock number;
The smart lock is numbered using default initial key and carries out cryptographic calculation, obtains the key of the smart lock;
Obtain the password group # of user's input;
The password group # is filled, password group # array is obtained;
Password group # array described in key pair using the smart lock carries out cryptographic calculation, obtains the first dynamic password.
2. the method according to claim 1, wherein after obtaining the first dynamic password, comprising:
To each byte of first dynamic password to 10 remainders, the second dynamic password is obtained.
3. the method according to claim 1, wherein after obtaining smart lock number, further includes:
Determine whether the smart lock number is 8 bytes;
In the case where smart lock number is not 8 byte, smart lock number is converted into 8 bytes.
4. obtaining cipher code set the method according to claim 1, wherein the password group # is filled Number array, comprising:
The password group # is filled using 0x80 hexadecimal number, the obtained password group # array is 8 words Save an array of length.
5. method according to claim 1-4, which is characterized in that the cryptographic calculation is 3DES dispersion encryption fortune It calculates or DES symmetry algorithm, the length of the default initial key is 128 bit.
6. a kind of password generating apparatus characterized by comprising
First obtains module, for obtaining smart lock number;
First encrypting module is carried out cryptographic calculation for being numbered using default initial key to the smart lock, obtains the intelligence The key that can be locked;
Second obtains module, for obtaining the password group # of user's input;
It fills module and obtains password group # array for the password group # to be filled;
Second encrypting module is obtained for using password group # array described in the key pair of the smart lock to carry out cryptographic calculation To the first dynamic password.
7. device according to claim 6, which is characterized in that described device further include:
Remainder module obtains the second dynamic password for each byte to first dynamic password to 10 remainders.
8. device according to claim 6, which is characterized in that described device further include:
Determining module, for determining the smart lock number after the first acquisition module gets the smart lock number It whether is 8 bytes;
Conversion module, in the case where smart lock number is not 8 byte, smart lock number to be converted to 8 words Section.
9. device according to claim 6, which is characterized in that the filling module includes:
Fill submodule, for being filled using 0x80 hexadecimal number to the password group #, the obtained password Group # array is an array of 8 byte lengths.
10. a kind of smart lock, which is characterized in that including the described in any item password generating apparatus of the claims 6-9.
CN201611141964.3A 2016-12-12 2016-12-12 Method for generating cipher code, device and smart lock Active CN106780880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611141964.3A CN106780880B (en) 2016-12-12 2016-12-12 Method for generating cipher code, device and smart lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611141964.3A CN106780880B (en) 2016-12-12 2016-12-12 Method for generating cipher code, device and smart lock

Publications (2)

Publication Number Publication Date
CN106780880A CN106780880A (en) 2017-05-31
CN106780880B true CN106780880B (en) 2019-04-12

Family

ID=58880383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611141964.3A Active CN106780880B (en) 2016-12-12 2016-12-12 Method for generating cipher code, device and smart lock

Country Status (1)

Country Link
CN (1) CN106780880B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109787749B (en) * 2019-01-07 2022-05-10 中国电子科技集团公司第七研究所 Door lock password generation method based on DES algorithm and password management method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101294463A (en) * 2008-06-18 2008-10-29 大连交通大学 Dynamically encrypting and unlock method based on electronic trick lock
US8572725B2 (en) * 2011-03-25 2013-10-29 International Business Machines Corporation Dynamic password strength dependent on system state
CN105245505A (en) * 2015-09-14 2016-01-13 深圳市优友互联有限公司 Data transmitting method and device, data receiving method and device, and receiving-transmitting system
CN105471903A (en) * 2015-12-31 2016-04-06 中国建设银行股份有限公司 Method for generating electronic lock activation information and related system, device and unlocking method
CN105635089A (en) * 2014-11-28 2016-06-01 珠海汇金科技股份有限公司 Authentication method, unlocking method and unlocking system for dynamic password lock

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101294463A (en) * 2008-06-18 2008-10-29 大连交通大学 Dynamically encrypting and unlock method based on electronic trick lock
US8572725B2 (en) * 2011-03-25 2013-10-29 International Business Machines Corporation Dynamic password strength dependent on system state
CN105635089A (en) * 2014-11-28 2016-06-01 珠海汇金科技股份有限公司 Authentication method, unlocking method and unlocking system for dynamic password lock
CN105245505A (en) * 2015-09-14 2016-01-13 深圳市优友互联有限公司 Data transmitting method and device, data receiving method and device, and receiving-transmitting system
CN105471903A (en) * 2015-12-31 2016-04-06 中国建设银行股份有限公司 Method for generating electronic lock activation information and related system, device and unlocking method

Also Published As

Publication number Publication date
CN106780880A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
AU2007202243B2 (en) System portable device and method for digital authenticating, crypting and signing by generating short-lived cryptokeys
CN109698822A (en) Combination learning method and system based on publicly-owned block chain and encryption neural network
KR101604596B1 (en) A method for secure communication in a network, a communication device, a network and a computer program therefor
JP2009169929A (en) Authentication method using icon password
US20100138399A1 (en) Method for data encryption and method for data search using conjunctive keyword
CN107070660A (en) A kind of design Storage method of block chain encrypted radio-frequency chip
WO2006070322A1 (en) Key generation using biometric data and secret extraction codes
CN109714307B (en) Cloud platform client data encryption and decryption system and method based on cryptographic algorithm
CN107181600A (en) A kind of password login authentication method, system and user equipment and certificate server
WO2002080430A1 (en) Method and apparatus for camouflaging of data, information and functional transformations
CN107733655B (en) APUF security authentication method based on polynomial reconstruction
CN106411516B (en) Fixed password generation method, device, dynamic token
CN105208005A (en) Fingerprint authentication method, connection equipment and terminal equipment
CN106453393B (en) The secret protection data type matching process that can verify that in participatory perception
CN113378148A (en) Internet of things equipment identity authentication system and method based on block chain
CN111163107A (en) Zigbee safety communication method and system
KR100629495B1 (en) Method for generating group key
CN105306200B (en) The encryption method and device of network account password
CN113343286A (en) Data encryption and decryption method, data uploading end, data receiving end and system
CN105808998A (en) Fingerprint identification device
CN110719172A (en) Signature method, signature system and related equipment in block chain system
CN106780880B (en) Method for generating cipher code, device and smart lock
CN110191467A (en) A kind of method for authenticating of internet of things equipment, unit and storage medium
CN109918877A (en) A kind of data ciphering method, system, client and computer readable storage medium
CN112235319B (en) Data encryption and decryption method and device and encryption and decryption circuit

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