CN111160505A - Method for realizing universal two-dimension code of smart community - Google Patents

Method for realizing universal two-dimension code of smart community Download PDF

Info

Publication number
CN111160505A
CN111160505A CN202010210182.0A CN202010210182A CN111160505A CN 111160505 A CN111160505 A CN 111160505A CN 202010210182 A CN202010210182 A CN 202010210182A CN 111160505 A CN111160505 A CN 111160505A
Authority
CN
China
Prior art keywords
dimensional code
prefix
steps
authorized
realizing
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.)
Pending
Application number
CN202010210182.0A
Other languages
Chinese (zh)
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.)
Green Man Technology Co ltd
Original Assignee
Green Man Technology 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 Green Man Technology Co ltd filed Critical Green Man Technology Co ltd
Priority to CN202010210182.0A priority Critical patent/CN111160505A/en
Publication of CN111160505A publication Critical patent/CN111160505A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details
    • G06K19/06103Constructional details the marking being embedded in a human recognizable image, e.g. a company logo with an embedded two-dimensional code
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0631Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0637Modes of operation, e.g. cipher block chaining [CBC], electronic codebook [ECB] or Galois/counter mode [GCM]

Abstract

The invention relates to the technical field of two-dimension code application, in particular to a method for realizing a universal two-dimension code of an intelligent community.

Description

Method for realizing universal two-dimension code of smart community
Technical Field
The invention relates to the technical field of two-dimension code application, in particular to a method for realizing a universal two-dimension code for an intelligent community.
Background
With the continuous development of social economy and the rapid improvement of the living standard of resident materials, the smart community becomes an important carrier for the current beautiful life of people. The smart community integrates advanced technologies, such as mobile internet, internet of things, cloud computing and the like, wherein the technologies and means, such as mobile phone APP, particularly two-dimensional codes, are used for achieving door opening, express taking, payment and the like, and the intelligent community is mature and widely applied. However, two-dimensional code among the current wisdom community APP has different two-dimensional code to generate the mode according to different usage, like door opening code, payment code, express delivery sign indicating number etc. and not have a unified standard, cause a great deal of inconvenience for the user on using. In addition, the two-dimension codes used in the current access control system do not support an off-line two-dimension code authentication mode, or are only simple fixed ID authentication, and a large vulnerability exists in safety.
Disclosure of Invention
The invention aims to provide a method for realizing a universal two-dimension code of a smart community, which aims to solve the problems that in the prior art, the diversity of two-dimension codes for realizing equipment control is complicated due to the diversity of intelligent equipment, and the use of users is inconvenient.
In order to achieve the purpose, the invention provides the following technical scheme: a method for realizing a universal two-dimension code for an intelligent community comprises an authorized two-dimension code generation method and an application two-dimension code generation method,
the method for generating the authorized two-dimensional code comprises the following steps:
(1) AES encryption is carried out on the 'old key & new offset & check', the encryption uses the old key and the offset,
(2) then Base64 transcoding is carried out on the encryption result,
(3) generating a two-dimensional code with Logo according to the UAMACODE and the transcoding result;
the application type two-dimensional code generation method comprises the following steps:
(1) a two-dimensional code plaintext is generated,
(2) a new two-dimensional code is generated from the parameter table and encrypted by AES128,
(3) after encryption, the character string is converted into a character string in Base64 format, then a prefix uama is spliced,
(4) then a two-dimensional code picture is generated,
(5) scanning the generated two-dimensional code picture, judging whether the two-dimensional code picture is an internal two-dimensional code according to the prefix uama,
(6) when the prefix judgment is negative, the logic processing is carried out, when the prefix judgment is positive, the prefix uama is removed, then the two-dimensional code decryption is carried out,
(7) and after decryption, performing specific logic processing according to the parameter table.
Preferably, the authorized two-dimensional code generation method is used for device authorization authentication, and a secret key is set through an authorized two-dimensional code for a hardware device with a built-in two-dimensional code decoding and identifying function.
Preferably, the application-type two-dimensional code generation method is used for two-dimensional codes used in various specific applications.
Preferably, various specific applications comprise entrance guard passing, express receiving and dispatching and activity check-in.
Compared with the prior art, the invention has the beneficial effects that: the unified general two-dimension code generation rule has universality and expandability, and simultaneously supports a two-dimension code offline security authentication mode.
Drawings
FIG. 1 is a flow chart of the generation and use of an application-type two-dimensional code according to the present invention;
FIG. 2 is a table of authorized two-dimensional code rule definitions according to the present invention;
FIG. 3 is a protocol header definition table of the present invention;
FIG. 4 is a table of protocol type encodings in accordance with the present invention;
fig. 5-1, 5-2, 5-3 are sequential displays of an application protocol table of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a technical scheme that: a method for realizing a universal two-dimension code of an intelligent community is characterized by comprising the following steps: comprises an authorized two-dimension code generating method and an application two-dimension code generating method,
the method for generating the authorized two-dimensional code comprises the following steps:
(1) AES encryption is carried out on the 'old key & new offset & check', the encryption uses the old key and the offset,
(2) then Base64 transcoding is carried out on the encryption result,
(3) generating a two-dimensional code with Logo according to the UAMACODE and the transcoding result;
as shown in fig. 2, the method for generating the application-type two-dimensional code includes:
(1) a two-dimensional code plaintext is generated,
(2) a new two-dimensional code is generated from the parameter table and encrypted by AES128,
(3) after encryption, the character string is converted into a character string in Base64 format, then a prefix uama is spliced,
(4) then a two-dimensional code picture is generated,
(5) scanning the generated two-dimensional code picture, judging whether the two-dimensional code picture is an internal two-dimensional code according to the prefix uama,
(6) when the prefix judgment is negative, the logic processing is carried out, when the prefix judgment is positive, the prefix uama is removed, then the two-dimensional code decryption is carried out,
(7) and after decryption, performing specific logic processing according to the parameter table.
The authorized two-dimensional code generation method is used for equipment authorization authentication, and a secret key is set through an authorized two-dimensional code aiming at hardware equipment with a built-in two-dimensional code decoding and identifying function.
The application type two-dimensional code generation method is used for two-dimensional codes used in various specific applications.
Various specific applications include entrance guard passage, express delivery receiving and dispatching and activity check-in.
Through the adoption of the technical scheme, the device,
the specific implementation process comprises the following steps: authorized two-dimensional code production rule definition
Except that the protocol header is plaintext, the other contents are encrypted. AES128 encryption, CBC mode, is used. And the fields are divided by using the '&'.
The format is as follows: as shown in fig. 2.
Protocol header: length 8Byte, fixed plaintext UAMACODE, capitalization;
the old key: length 16Byte, device native key. (factory default key 8888888888888888, offset: 9999999999999999)
The new key is as follows: length 16Byte, set the device new key.
New offset: length 16Byte, set the new offset of the device.
Checking: and carrying out XOR (exclusive OR) check on the old key, the new key and the new offset one by one.
Producing the two-dimensional code:
1. and performing AES encryption on the 'old key & new offset & check', wherein the encryption uses the old key and the offset. And then Base64 transcoding is carried out on the encryption result.
2. And generating a two-dimensional code with Logo according to the UAMACODE and transcoding result.
Example (c):
1. plaintext data
UAMACODE&8888888888888888&cP0XwUW27vvxd1uj&tVYZYZcYdIzAgCJw&E(Hex);
2. Encryption and Base64 transcoding
UAMACODE&DShxaeoj/vf5Q3LBLW7iWIcmr10pKLa7Z2DQDhtTGaF742AltkB+upBYnmM1yYt14MGcBZS4Rj573lfe4cl5SA==;
3. Generating a two-dimensional code;
when the device is used for the first time, the secret key is injected into the hardware device by scanning the authorized two-dimensional code. Different items may use different keys. And storing separately in the system.
To prevent the key from being modified by misoperation, the new key must be continuously scanned for 2 times within 3 seconds and the contents are consistent, so that the modification can be completed.
Application type two-dimensional code generation rule
Aiming at various application scenes, a set of standard two-dimensional code generation specifications is defined.
The application two-dimensional code consists of a protocol header and content. The protocol header is plaintext, and the content can be ciphertext or plaintext.
The fields in the two-dimensional code are separated from each other by "&".
If the cipher text is the cipher text, AES128 encryption and a CBC mode are adopted.
Protocol header definitions, as shown in fig. 3.
Protocol Header (HEAD): length 3 bytes, UM _, letter capital
Encrypted identifier (EncodeFlag): length 1 byte. E, indicating content encryption, P, indicating content non-encryption
Protocol type identification: length 2 bytes. And identifying the type of the two-dimensional code, and particularly referring to a protocol type coding table.
Application identification: length 1 byte. The application that generated the dimension code is identified. See the application code table for details.
The protocol header length is 7 Byte.
Protocol type coding table, as shown in fig. 4.
Application coding table
Application numbering: APPID (number + size letter) 36 Description of the invention Two-dimension code icon (option)
0 Is free of
1 Tenant 1
2 Tenant 2
3 Tenant 3
4 Tenant 4
Example (c):
UAMA_&E&21&3&×××××
the application protocol is as follows: access code (AccessCode), as shown in fig. 5.
Application scenarios: the method is applied to the intelligent pedestrian system. Visitor code, owner pass, manager
The fields are separated by "&" and the passcode must be encrypted.
Each campus uses a different key for differentiation.
And (3) permission definition:
TYPE:
0: the administrator, the system administrator, has the maximum authority.
1: staff, property staff, general managers. Restricted access
2: owner, restricted access
3: visitor, temporary Access, restricted Access
Timestamp ID TYPE Mode Duration Count ChannelNo
Y Y
0 0,1,2,3 Y - -
Y Y 1 0,1,2,3 Y - Y
Y Y
2 0 - - Y
Y - 3 0 Y Y Y
The/timestamp + ID constitutes the unique identification of the pass record.
And each two-dimension code has an effective time limit system, and the effective time can be set. Default 3 minutes, calculated from the timestamp. Timestamp +3 minutes
The validity period of the guest code is calculated as timestamp + validity period.
Example (c):
plaintext:
UM_&E&21&3&20190508182601&13819170646&0&0&0&0&0&{0}&{0}$
AES encryption, Base64 transcoding: (Key 8888888888888888, offset 9999999999999999)
UM_&E&21&3&9ktTL3fCqBGnHGtO8qVGu8iOLxgGrDFK17RYH1dnTZxvD9kMzYr2Xt2XbMtipj4y
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (4)

1. A method for realizing universal two-dimensional codes of smart communities is characterized by comprising the following steps: comprises an authorized two-dimension code generating method and an application two-dimension code generating method,
the method for generating the authorized two-dimensional code comprises the following steps:
AES encryption is carried out on the 'old key & new offset & check', the encryption uses the old key and the offset,
then Base64 transcoding is carried out on the encryption result,
generating a two-dimensional code with Logo according to the UAMACODE and the transcoding result;
the application type two-dimensional code generation method comprises the following steps:
a two-dimensional code plaintext is generated,
a new two-dimensional code is generated from the parameter table and encrypted by AES128,
after encryption, the character string is converted into a character string in Base64 format, then a prefix uama is spliced,
then a two-dimensional code picture is generated,
scanning the generated two-dimensional code picture, judging whether the two-dimensional code picture is an internal two-dimensional code according to the prefix uama,
when the prefix judgment is negative, the logic processing is carried out, when the prefix judgment is positive, the prefix uama is removed, then the two-dimensional code decryption is carried out,
and after decryption, performing specific logic processing according to the parameter table.
2. The method for realizing the universal two-dimensional code of the smart community according to claim 1, wherein the method comprises the following steps: the authorized two-dimensional code generation method is used for equipment authorization authentication, and a secret key is set through an authorized two-dimensional code aiming at hardware equipment with a built-in two-dimensional code decoding and identifying function.
3. The method for realizing the universal two-dimensional code of the smart community according to claim 1, wherein the method comprises the following steps: the application type two-dimensional code generation method is used for two-dimensional codes used in various specific applications.
4. The method for realizing the universal two-dimensional code of the smart community according to claim 3, wherein the method comprises the following steps: various specific applications include entrance guard passage, express delivery receiving and dispatching and activity check-in.
CN202010210182.0A 2020-03-24 2020-03-24 Method for realizing universal two-dimension code of smart community Pending CN111160505A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010210182.0A CN111160505A (en) 2020-03-24 2020-03-24 Method for realizing universal two-dimension code of smart community

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010210182.0A CN111160505A (en) 2020-03-24 2020-03-24 Method for realizing universal two-dimension code of smart community

Publications (1)

Publication Number Publication Date
CN111160505A true CN111160505A (en) 2020-05-15

Family

ID=70567944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010210182.0A Pending CN111160505A (en) 2020-03-24 2020-03-24 Method for realizing universal two-dimension code of smart community

Country Status (1)

Country Link
CN (1) CN111160505A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102710420A (en) * 2012-06-04 2012-10-03 华为终端有限公司 Method, system and device for setting password
CN105069876A (en) * 2015-08-04 2015-11-18 珠海格力电器股份有限公司 Control method and system for intelligent access control
CN106452756A (en) * 2016-11-08 2017-02-22 王栋 Construction verification method and device capable of verifying security two-dimensional code offline
CN107342854A (en) * 2017-06-20 2017-11-10 杭州高锦科技有限公司 The encrypting and decrypting method and intelligent access control system of gate inhibition's Quick Response Code authority information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102710420A (en) * 2012-06-04 2012-10-03 华为终端有限公司 Method, system and device for setting password
CN105069876A (en) * 2015-08-04 2015-11-18 珠海格力电器股份有限公司 Control method and system for intelligent access control
CN106452756A (en) * 2016-11-08 2017-02-22 王栋 Construction verification method and device capable of verifying security two-dimensional code offline
CN107342854A (en) * 2017-06-20 2017-11-10 杭州高锦科技有限公司 The encrypting and decrypting method and intelligent access control system of gate inhibition's Quick Response Code authority information

Similar Documents

Publication Publication Date Title
CN108055235B (en) Control method of intelligent lock, related equipment and system
CN101350724B (en) Encrypting method base on biology characteristic information
AU595426B2 (en) Process and apparatus for the protection of secret elements in a network of encrypting devices with open key management
CN102664885B (en) Identity authentication method based on biological feature encryption and homomorphic algorithm
CN101029546A (en) Electronic coding lock system and its controllable starting method
CN101262349A (en) SMS-based identity authentication method and device
CN107492161A (en) A kind of lock management scheme of time-based dynamic token and low-power consumption bluetooth technology
CN109617675B (en) Method and system for authenticating identifiers of both sides between charge and discharge facility and user terminal
CN103646455A (en) Intelligent lock device and usage method thereof as well as configuration method for electronic keys
CN109035519B (en) Biological feature recognition device and method
CN202854880U (en) SMS payment system based on fingerprint identification mobile phone
CN109412812A (en) Data safe processing system, method, apparatus and storage medium
CN104537300A (en) Safe password setting and verifying mode
CN109474419A (en) A kind of living body portrait photo encryption and decryption method and encrypting and deciphering system
CN107154847A (en) Towards the method for generating cipher code, verification method and its smart machine of offline environment
CN107864124A (en) A kind of end message method for security protection, terminal and bluetooth lock
CN104123777B (en) A kind of gate inhibition's remote-authorization method
CN107342854A (en) The encrypting and decrypting method and intelligent access control system of gate inhibition's Quick Response Code authority information
KR20120112598A (en) Implementing method, system of universal card system and smart card
CN104408363A (en) Safe password system
CN109285256A (en) Computer room based on block chain authentication enter permission give method
CN106792669A (en) Information of mobile terminal encryption method and device based on Hybrid Encryption algorithm
CN106101140B (en) A kind of method and server of authentification of message
CN105282148A (en) Data remote authentication system and method
CN108055124A (en) Lock administration system and lock management method

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