CN103401679A - Method for encrypting and decoding two-dimensional codes - Google Patents

Method for encrypting and decoding two-dimensional codes Download PDF

Info

Publication number
CN103401679A
CN103401679A CN2013103023458A CN201310302345A CN103401679A CN 103401679 A CN103401679 A CN 103401679A CN 2013103023458 A CN2013103023458 A CN 2013103023458A CN 201310302345 A CN201310302345 A CN 201310302345A CN 103401679 A CN103401679 A CN 103401679A
Authority
CN
China
Prior art keywords
ciphertext
quick response
response code
key
decoding
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.)
Granted
Application number
CN2013103023458A
Other languages
Chinese (zh)
Other versions
CN103401679B (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.)
HUBEI CHUTIAN MEDIA NETWORK TECHNOLOGY Co Ltd
Original Assignee
HUBEI CHUTIAN MEDIA NETWORK 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 HUBEI CHUTIAN MEDIA NETWORK TECHNOLOGY Co Ltd filed Critical HUBEI CHUTIAN MEDIA NETWORK TECHNOLOGY Co Ltd
Priority to CN201310302345.8A priority Critical patent/CN103401679B/en
Publication of CN103401679A publication Critical patent/CN103401679A/en
Application granted granted Critical
Publication of CN103401679B publication Critical patent/CN103401679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to a method for encrypting and decoding two-dimensional codes, relating to an encrypting and decoding technology of two-dimensional information. In the method, a specific key and a specific symmetric encryption algorithm are allocated for each two-dimensional code. The method has the advantages that if the key and the corresponding symmetric encryption algorithm are unknown, decryption is difficult; and even if a certain two-dimensional code is decrypted and decoded, decryption and decoding are only specific to the two-dimensional code, and are invalid for other two-dimensional codes of the same batch, so that the risk of counterfeit is lowered, and the reliability is improved.

Description

A kind of encryption of Quick Response Code and coding/decoding method
Technical field
The present invention relates to information encryption, more specifically relate to encryption and the decoding technique of 2 D code information.
Background technology
The preferential convertible note of merchant issued, to the user, is a kind of important way and the means of current businessman commercial promotions.Along with popularizing of cellphone subscriber, preferential convertible note usually adopts the form of electronics convertible note.
Symmetric encipherment algorithm is prior art, is the cryptographic algorithm of applying early, technology maturation.In symmetric encipherment algorithm, data transmission side's general's plaintext (initial data) and encryption key after special cryptographic algorithm is processed, make it become complicated encryption ciphertext and send out together.After the destination receives ciphertext,, if want to understand original text, need to use to encrypt with the key of crossing and the algorithm for inversion of identical algorithms ciphertext is decrypted, just can make it revert to readable plaintext.In symmetric encipherment algorithm, the key of use only has one, sends out collection of letters both sides and all uses this key to be encrypted and to decipher data, and this will solve close side must know encryption key in advance.
The electronics convertible note has a variety of releasing modes at present, mainly contains: plaintext redemption code, Quick Response Code convertible note etc.Adopt the expressly mode of redemption code to have the risk that easily is forged, preferential convertible note may be falsely used by other people, finally damages businessman and user benefit., so more businessman adopts the mode of Quick Response Code convertible note, and Quick Response Code is encrypted, make to forge and falsely use to become more difficult.Symmetric encipherment algorithm is mainly used in the encryption of at present Quick Response Code being carried out, and namely the Quick Response Code of every a collection of electronics convertible note adopts certain symmetric encipherment algorithm to be encrypted, and confirms the true and false of electronics convertible note by decoding.This method is really reliably a lot of than the mode of using the plaintext redemption code.But the weak point of the method is: all there is the possibility that is decrypted and decodes in any encryption method, and the method is no exception.And if be decrypted and decode, this a collection of electronics convertible note just is easy to be forged, preferential convertible note is also just probably falsely used by other people.This will be to businessman huge prestige and economic loss.
Summary of the invention
The present invention is directed to the deficiency that prior art exists, a kind of encryption and coding/decoding method of Quick Response Code is provided.The method is equipped with a specific key and a specific symmetric encipherment algorithm for each Quick Response Code.Advantage is: if do not know key and corresponding symmetric encipherment algorithm, it is very difficult decoding; Even if some Quick Response Codes are decrypted and decode, its decoding and decoding also can only be for this Quick Response Codes, and to other Quick Response Code of same batch, are invalid, make the risk that is forged drop to minimum, thereby make reliability become very high.
In order to achieve the above object, the present invention adopts following technical scheme:
A kind of encryption of Quick Response Code and coding/decoding method, the method is to be some definite nonnegative integers for N(N) bar the source language message (the source language message refers to: a group of character string, set of number or passage) is encrypted and decodes, i bar wherein, 1≤i≤N, encryption and the coding/decoding method of the source language message comprise the following step:
One, encrypting step
(1), for i bar the source language message, 1≤i≤N, generate the character string of a k position at random as key, is designated as a i, 4≤k≤128 wherein;
(2), set up the symmetric encipherment algorithm database, each in database is recorded as a kind of symmetric encipherment algorithm;
(3), in the symmetric encipherment algorithm database record of random choose, be designated as A i
(4), with key a iWith symmetric encipherment algorithm A iBe stored in the cipher mode database as data, and the Major key of return recording, be designated as A i(a i);
(5), to i bar the source language message cipher mode A i(a i) be encrypted, be called ciphertext C i1
(6), at ciphertext C i1Front or back add A i(a i) sign, be called ciphertext C i2
(7), with ciphertext C i2Generate Quick Response Code i;
Two, decoding step
(8), extract Quick Response Code i information, obtain ciphertext C i2
(9), with ciphertext C i2Information decomposition be ciphertext C i1With A i(a i) sign;
(10), obtain A in the cipher mode database i(a i) the corresponding cryptographic algorithm A of sign iWith key a iAnd to ciphertext C i1Be decrypted;
(11), obtain i bar the source language message after successful decryption.
Advantage of the present invention is: the method is equipped with a specific key and a specific symmetric encipherment algorithm for each Quick Response Code.
1, because each Quick Response Code all has key and symmetric encipherment algorithm, if do not know key and symmetric encipherment algorithm, it is very difficult decoding.
2, due to different Quick Response Codes, its key is all not identical with symmetric encipherment algorithm, even if some Quick Response Codes are decrypted and decode, its decoding and decoding also can only be for this Quick Response Codes, and to other Quick Response Code, be invalid, make the risk that is forged drop to minimum, thereby make reliability become very high.
Embodiment
Below in conjunction with instantiation, the present invention is further illustrated.
Embodiment 1
A kind of encryption of Quick Response Code and coding/decoding method, the method are be encrypted and decode for N bar the source language message, and wherein the i(1≤i≤N) encryption and the coding/decoding method of bar the source language message comprise the following step:
One, encrypting step
(1), for i bar the source language message, 1≤i≤N, generate the character string of a k position at random as key, is designated as a i, 4≤k≤128 wherein;
(2), set up the symmetric encipherment algorithm database, each in database is recorded as a kind of symmetric encipherment algorithm;
(3), in the symmetric encipherment algorithm database record of random choose, be designated as A i
(4), with key a iWith symmetric encipherment algorithm A iBe stored in the cipher mode database as data, and the Major key of return recording, be designated as A i(a i);
(5), to i bar the source language message cipher mode A i(a i) be encrypted, be called ciphertext C i1
(6), at ciphertext C i1Front or back add A i(a i) sign, be called ciphertext C i2
(7), with ciphertext C i2Generate Quick Response Code i;
Two, decoding step
(8), extract Quick Response Code i information, obtain ciphertext C i2
(9), with ciphertext C i2Information decomposition be ciphertext C i1With A i(a i) sign;
(10), obtain A in the cipher mode database i(a i) the corresponding cryptographic algorithm A of sign iWith key a iAnd to ciphertext C i1Be decrypted;
(11), obtain i bar the source language message after successful decryption.
Embodiment 2
There iing on the market the multiple reward voucher that purchases by group to be applied in transaction and to use on flow process and have link not easily, generally to leave among client or note with the string number code form such as present user obtains reward voucher, then to trade company exchange preferential time, need to quote a lot of numeral or copy in the notepad that trade company provides, be entered in the enterprise backstage and verify by the salesman of trade company again, exchange the more and more team of arranging of user and allow especially the salesman in a rush.It is more convenient for the user is exchanged, we are generated as a Quick Response Code with a lot of redemption code, exchange efficiency to improve, because Quick Response Code itself is an existing current techique, as without technical finesse, being easy to, the redemption code information in Quick Response Code is forged, there are on the market some by redemption code is encrypted to prevent, to forge, but after cryptographic algorithm is cracked, other has with the Quick Response Code that identical cryptographic algorithm generates the risk that is forged, falsely uses, infringement businessman and consumer's interests.We use the mode of " a yard close " to be encrypted the redemption code word string now, each redemption code word string is encrypted with unique algorithm, cipher key combinations, even if the cryptographic algorithm of certain Quick Response Code, key are penetrated entirely, also can only affect the use of current this Quick Response Code, can not produce other Quick Response Code and forge risk.Concrete application scenarios is as follows:
One, encrypting step
(a) scanned the Quick Response Code of a preferential activity on the propaganda board of user Xiao Zhang before A shops of businessman, the rule of this activity is that any participant can freely obtain ice cream, after this moment, Xiao Zhang was scanned Quick Response Code with cell phone software, service high in the clouds had generated a string redemption code (as: 12345678) at random for Xiao Zhang;
(b) for realizing the encryption to redemption code, the character string (as: 1qazxsw23edcvfr45tgbnhy67ujmki89olp0) that the random generation in service high in the clouds is a string 32 is as key;
(c) service high in the clouds simultaneously in having the title cryptographic algorithm database in high in the clouds random choose a cryptographic algorithm (as: DES algorithm);
(d) symmetric encipherment algorithm DES algorithm and key 1qazxsw23edcvfr45tgbnhy67ujmki89olp0 are deposited in database as data, and return to the Major key (as: g1) of this record;
(e) with symmetric encipherment algorithm DES algorithm and key 1qazxsw23edcvfr45tgbnhy67ujmki89olp0, redemption code 12345678 is encrypted and obtains ciphertext abcdefgh, be called ciphertext A;
That (f) encloses in the ciphertext back then that service end just now returns records Major key g1, and the character string of generation is: abcdefgh, and g1, be called ciphertext B;
(g) service end is with character string abcdefgh, and g1 generates Quick Response Code and sends to user Xiao Zhang, and had Quick Response Code convertible note encryption after in Xiao Zhang's mobile phone this moment.
Two, decoding step
(h), Xiao Zhang enters in shops to want to use and just now obtained convertible note, he has shown Quick Response Code to waiter, waiter has been scanned Xiao Zhang's Quick Response Code convertible note with cell phone software, extracted the information of Quick Response Code, obtains character string abcdefgh, g1;
(i), service end is received character string abcdefgh, after g1 information, is at first that it is broken, and information is divided into the Major key g1 that has had record in ciphertext abcdefgh and database;
(j), service end finds out the corresponding record of g1 in database, the symmetric encipherment algorithm DES algorithm and the key 1qazxsw23edcvfr45tgbnhy67ujmki89olp0 that wherein record are taken out, then ciphertext abcdefgh is decrypted;
(k), after successful decryption, the source language message 12345678 after being deciphered.
This source language message 12345678 is complementary and returns to the information of being verified with the redemption code of service end generation before, and waiter confirms to give the user Xiao Zhang with the prize ice cream after checking, and this moment, whole encryption decode procedure finished.

Claims (3)

1. the encryption of a Quick Response Code and coding/decoding method, is characterized in that, the method is be encrypted and decode for N bar the source language message, i bar wherein, and 1≤i≤N, encryption and the coding/decoding method of the source language message comprise the following step:
One, encrypting step
(1), for i bar the source language message, 1≤i≤N, generate the character string of a k position at random as key, is designated as a i, 4≤k≤128 wherein;
(2), set up the symmetric encipherment algorithm database, each in database is recorded as a kind of symmetric encipherment algorithm;
(3), in the symmetric encipherment algorithm database record of random choose, be designated as A i
(4), with key a iWith symmetric encipherment algorithm A iBe stored in the cipher mode database as data, and the Major key of return recording, be designated as A i(a i);
(5), to i bar the source language message cipher mode A i(a i) be encrypted, be called ciphertext C i1
(6), at ciphertext C i1Front or back add A i(a i) sign, be called ciphertext C i2
(7), with ciphertext C i2Generate Quick Response Code i;
Two, decoding step
(8), extract Quick Response Code i information, obtain ciphertext C i2
(9), with ciphertext C i2Information decomposition be ciphertext C i1With A i(a i) sign;
(10), obtain A in the cipher mode database i(a i) the corresponding cryptographic algorithm A of sign iWith key a iAnd to ciphertext C i1Be decrypted;
(11), obtain i bar the source language message after successful decryption.
2., according to encryption and the coding/decoding method of right 1 described a kind of Quick Response Code, it is characterized in that, in the k described in step (1), wherein 8≤k≤32.
3., according to encryption and the coding/decoding method of right 1 described a kind of Quick Response Code, it is characterized in that, at the k described in step (1), wherein k=16.
CN201310302345.8A 2013-07-18 2013-07-18 Method for encrypting and decoding two-dimensional codes Active CN103401679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310302345.8A CN103401679B (en) 2013-07-18 2013-07-18 Method for encrypting and decoding two-dimensional codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310302345.8A CN103401679B (en) 2013-07-18 2013-07-18 Method for encrypting and decoding two-dimensional codes

Publications (2)

Publication Number Publication Date
CN103401679A true CN103401679A (en) 2013-11-20
CN103401679B CN103401679B (en) 2015-02-04

Family

ID=49565210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310302345.8A Active CN103401679B (en) 2013-07-18 2013-07-18 Method for encrypting and decoding two-dimensional codes

Country Status (1)

Country Link
CN (1) CN103401679B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717056A (en) * 2013-12-11 2015-06-17 中国移动通信集团安徽有限公司 Two-dimensional code encryption and decryption method and encryption and decryption device
CN104915701A (en) * 2015-06-09 2015-09-16 广西中烟工业有限责任公司 Self-encrypting self-checking two-dimensional code encoding and decoding method
CN105701435A (en) * 2016-01-12 2016-06-22 信码互通(北京)科技有限公司 Multi-code association coding method capable of realizing self-verification and decoding method
CN105763525A (en) * 2014-12-19 2016-07-13 北大方正集团有限公司 Identification code generation method, device, identification code decryption method and device
TWI547880B (en) * 2015-02-13 2016-09-01 A special two-dimensional code corresponding to the information recorded in the red envelope and a method of generating the same
CN106022848A (en) * 2016-07-11 2016-10-12 深圳壹号柜科技股份有限公司 Method and system for exchanging sample rewards by scanning codes
CN106301777A (en) * 2016-08-03 2017-01-04 国家计算机网络应急技术处理协调中心 Quick Response Code encrypted transmission method and system
CN107016499A (en) * 2017-03-23 2017-08-04 国家电网公司 A kind of substation equipment patrol method recognized based on two-dimentional code encryption
CN107294964A (en) * 2017-06-16 2017-10-24 北京鼎九信息工程研究院有限公司 A kind of method of information transfer
US10659220B2 (en) 2015-07-28 2020-05-19 Fujian Landi Commercial Equipment Co., Ltd. Method and system for encrypting and decrypting two-dimensional code mask
CN113808288A (en) * 2021-09-07 2021-12-17 重庆畅停智慧停车服务有限公司 Real-time timing consumption deduction analysis method and system for parking lot
CN113868618A (en) * 2021-09-03 2021-12-31 浙江创建科技有限公司 Multi-code collaborative fusion and authentication system based on multiple two-dimensional code standards
CN115001676A (en) * 2022-06-02 2022-09-02 深圳市爱克信智能股份有限公司 Two-dimensional code encryption method, decryption method, system, terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102118710A (en) * 2011-03-08 2011-07-06 上海红松信息技术有限公司 System and method for transmitting data between mobile terminals
CN102750510A (en) * 2012-06-19 2012-10-24 袁开国 Credible two-dimensional code scheme based on public key infrastructure (PKI) and HASH algorithm
WO2013061174A2 (en) * 2011-10-26 2013-05-02 Nds Limited Two-dimensional barcode system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102118710A (en) * 2011-03-08 2011-07-06 上海红松信息技术有限公司 System and method for transmitting data between mobile terminals
WO2013061174A2 (en) * 2011-10-26 2013-05-02 Nds Limited Two-dimensional barcode system
CN102750510A (en) * 2012-06-19 2012-10-24 袁开国 Credible two-dimensional code scheme based on public key infrastructure (PKI) and HASH algorithm

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717056A (en) * 2013-12-11 2015-06-17 中国移动通信集团安徽有限公司 Two-dimensional code encryption and decryption method and encryption and decryption device
CN105763525A (en) * 2014-12-19 2016-07-13 北大方正集团有限公司 Identification code generation method, device, identification code decryption method and device
TWI547880B (en) * 2015-02-13 2016-09-01 A special two-dimensional code corresponding to the information recorded in the red envelope and a method of generating the same
CN104915701A (en) * 2015-06-09 2015-09-16 广西中烟工业有限责任公司 Self-encrypting self-checking two-dimensional code encoding and decoding method
CN104915701B (en) * 2015-06-09 2018-06-08 广西中烟工业有限责任公司 A kind of Quick Response Code coding-decoding method from encryption self checking
US10659220B2 (en) 2015-07-28 2020-05-19 Fujian Landi Commercial Equipment Co., Ltd. Method and system for encrypting and decrypting two-dimensional code mask
CN105701435A (en) * 2016-01-12 2016-06-22 信码互通(北京)科技有限公司 Multi-code association coding method capable of realizing self-verification and decoding method
CN106022848B (en) * 2016-07-11 2020-11-06 芜湖文青机械设备设计有限公司 Method and system for exchanging sample reward through code scanning
CN106022848A (en) * 2016-07-11 2016-10-12 深圳壹号柜科技股份有限公司 Method and system for exchanging sample rewards by scanning codes
CN106301777A (en) * 2016-08-03 2017-01-04 国家计算机网络应急技术处理协调中心 Quick Response Code encrypted transmission method and system
CN107016499A (en) * 2017-03-23 2017-08-04 国家电网公司 A kind of substation equipment patrol method recognized based on two-dimentional code encryption
CN107294964A (en) * 2017-06-16 2017-10-24 北京鼎九信息工程研究院有限公司 A kind of method of information transfer
CN107294964B (en) * 2017-06-16 2022-01-11 北京鼎九信息工程研究院有限公司 Information transmission method
CN113868618A (en) * 2021-09-03 2021-12-31 浙江创建科技有限公司 Multi-code collaborative fusion and authentication system based on multiple two-dimensional code standards
CN113808288A (en) * 2021-09-07 2021-12-17 重庆畅停智慧停车服务有限公司 Real-time timing consumption deduction analysis method and system for parking lot
CN115001676A (en) * 2022-06-02 2022-09-02 深圳市爱克信智能股份有限公司 Two-dimensional code encryption method, decryption method, system, terminal and storage medium

Also Published As

Publication number Publication date
CN103401679B (en) 2015-02-04

Similar Documents

Publication Publication Date Title
CN103401679B (en) Method for encrypting and decoding two-dimensional codes
CN105825257B (en) Information hiding and hiding information extracting method and system based on two-dimensional bar code
CN109347878A (en) The data verification of decentralization and data safety transaction system and method
CN105307165B (en) Communication means, server-side and client based on mobile application
CN101964793A (en) Method and system for transmitting data between terminal and server and sign-in and payment method
CN104393993B (en) A kind of safety chip and its implementation for electricity-selling terminal
CN102833244B (en) Communication method for authentication by fingerprint information
CN104618334A (en) Method and system for generating and verifying dynamic two-dimensional code
WO2010141501A3 (en) Purchase transaction system with encrypted payment card data
WO2017016447A1 (en) Two-dimensional code mask encryption and decryption method and system
CN1988441A (en) Data safety transmission method
US20160132871A1 (en) Secure redemption code generation for gift cards and promotions
CN103618705A (en) Personal code managing tool and method under open cloud platform
CN103108245B (en) A kind of intelligent television pays cipher key system and method for payment based on intelligent television
CN104318437A (en) Online payment system and payment method for virtual prepaid card
CN109543434A (en) Block chain information encryption method, decryption method, storage method and device
CN105337733A (en) Two-dimensional code locking control method based on combination of synchronous-asynchronous secret key verification
CN102684884A (en) Portal Web server and method for preventing off-line request forgery
CN108809936A (en) A kind of intelligent mobile terminal auth method and its realization system based on Hybrid Encryption algorithm
CN101374251B (en) Method for encrypting short message and used terminal equipment thereof
CN108847924A (en) Encryption method, device, computer equipment and storage medium
CN102332978B (en) Lottery ticket off-line verification system
CN102223229A (en) Method for safe transmission of data in public network
CN109726583A (en) Cloud data base encryption server system
CN103929722A (en) Short message encryption method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 430077 No. 181, East Lake Road, Wuchang District, Hubei, Wuhan

Applicant after: HUBEI JINCHU NETWORK TECHNOLOGY CO., LTD.

Address before: 430077 No. 181, East Lake Road, Wuchang District, Hubei, Wuhan

Applicant before: Hubei Chutian Media Network Technology Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: HUBEI CHUTIAN MEDIA NETWORK TECHNOLOGY CO., LTD. TO: HUBEI JINGCHU NETWORK TECHNOLOGY CO., LTD.

C14 Grant of patent or utility model
GR01 Patent grant