Hash algorithm payment encryption method and system based on block chain

文档序号:1649982 发布日期:2019-12-24 浏览:12次 中文

阅读说明:本技术 一种基于区块链的散列算法支付加密方法及系统 (Hash algorithm payment encryption method and system based on block chain ) 是由 陈新 庞松涛 商广勇 王伟兵 马岩堂 赵树林 姜鑫 陶鑫 刘伟巍 于 2019-09-23 设计创作,主要内容包括:本发明公开了一种基于区块链的散列算法支付加密方法及系统,属于支付安全加密技术领域。本发明的基于区块链的散列算法支付加密方法客户端对支付参数进行加密,返回密文一,客户端将密文和当前时间戳写入区块链中,并将密文与支付参数一同传递给服务端,服务端对支付参数采用相同的加密形式进行加密,返回密文二,再根据支付参数中的时间戳从区块链中获取密文三,将密文一、密文二和密文三进行对比,若密文一、密文二和密文三相同,则进行支付操作,否则,不进行支付操作。该发明的基于区块链的散列算法支付加密方法能够有效的保证支付参数在传输过程中的安全,杜绝参数的非法篡改,具有很好的推广应用价值。(The invention discloses a hash algorithm payment encryption method and system based on a block chain, and belongs to the technical field of payment security encryption. The client encrypts the payment parameters based on the hash algorithm of the block chain, returns a first ciphertext, writes the ciphertext and a current timestamp into the block chain, transmits the ciphertext and the payment parameters to the server together, encrypts the payment parameters in the same encryption mode by the server, returns a second ciphertext, acquires a third ciphertext from the block chain according to the timestamp in the payment parameters, compares the first ciphertext, the second ciphertext and the third ciphertext, performs payment operation if the first ciphertext, the second ciphertext and the third ciphertext are the same, and does not perform payment operation if the first ciphertext, the second ciphertext and the third ciphertext are the same. The hash algorithm payment encryption method based on the block chain can effectively ensure the safety of the payment parameters in the transmission process, prevent the illegal tampering of the parameters and has good popularization and application values.)

1. A hash algorithm payment encryption method based on a block chain is characterized in that: in the method, a client encrypts payment parameters, returns a first ciphertext, writes the ciphertext and a current time stamp into a block chain, transmits the ciphertext and the payment parameters to a server together, encrypts the payment parameters in the same encryption mode by the server, returns a second ciphertext, acquires a third ciphertext from the block chain according to the time stamp in the payment parameters, compares the first ciphertext, the second ciphertext and the third ciphertext, performs payment operation if the first ciphertext, the second ciphertext and the third ciphertext are the same, and does not perform payment operation if the first ciphertext, the second ciphertext and the third ciphertext are the same.

2. The blockchain-based hash algorithm payment encryption method of claim 1, wherein: the method specifically comprises the following steps:

s1, the client side carries out safety encryption on the payment parameters and returns the ciphertext I to the client side;

s2, the client writes the ciphertext and the current timestamp into the block chain;

s3, the server receives the request transmitted by the client to obtain the ciphertext and the payment parameter, and the server encrypts the payment parameter in the same encryption mode and returns a ciphertext II;

s4, the server side obtains a ciphertext III from the block chain;

s5, the server side carries out safety verification on the payment parameters, whether the ciphertext I, the ciphertext II and the ciphertext III are consistent or not is judged, if yes, payment operation is carried out, and if not, the payment operation is not carried out.

3. The blockchain-based hash algorithm payment encryption method of claim 2, wherein: when the client encrypts the payment parameters, SHA256 salt adding encryption is adopted to encrypt the sensitive parameters.

4. The blockchain-based hash algorithm payment encryption method of claim 3, wherein: the client writes the ciphertext and the current time stamp into the block chain, the time stamp can prevent repeated payment, and only one payment transaction is ensured at each time point.

5. The blockchain-based hash algorithm payment encryption method of claim 4, wherein: and the server receives the ciphertext and the payment parameters transmitted by the client, and encrypts the sensitive parameters by SHA256 salt-adding encryption.

6. The blockchain-based hash algorithm payment encryption method of claim 5, wherein: and the server side acquires the payment key in the block chain according to the time stamp in the payment parameter, so that the ciphertext III is acquired from the block chain.

7. A hash algorithm payment encryption system based on blockchain, characterized by: the system comprises a client payment parameter security encryption module, a block chain writing module, a server payment parameter security encryption module, a server ciphertext acquisition module and a server security verification module:

the client payment parameter security encryption module is responsible for the client to perform security encryption on the payment parameters and return a ciphertext I to the client;

the block chain writing module is responsible for writing the ciphertext and the current timestamp into the block chain by the client;

the server side payment parameter security encryption module is responsible for receiving a request transmitted by the client side by the server side, acquiring a ciphertext and payment parameters, encrypting the payment parameters by the server side in the same encryption mode and returning a ciphertext II;

the server side ciphertext acquisition module is responsible for acquiring a ciphertext III from the block chain by the server side;

and the server side safety verification module is responsible for carrying out safety verification on the payment parameters by the server side, judging whether the ciphertext I, the ciphertext II and the ciphertext III are consistent, if so, carrying out payment operation, and if not, carrying out payment operation.

8. The blockchain-based hash algorithm payment encryption system of claim 7, wherein: when the client payment parameter security encryption module is in charge of encrypting the payment parameters by the client, SHA256 salt adding encryption is adopted to encrypt the sensitive parameters.

9. The blockchain-based hash algorithm payment encryption system of claim 8, wherein: in the block chain writing module, the client writes the ciphertext and the current time stamp into the block chain, the time stamp can prevent repeated payment, and only one payment transaction at each time point is ensured.

10. The blockchain-based hash algorithm payment encryption system of claim 9, wherein: in the server-side ciphertext obtaining module, the server side obtains the payment key in the block chain according to the time stamp in the payment parameter, and accordingly obtains a ciphertext III from the block chain.

Technical Field

The invention relates to the technical field of payment security encryption, and particularly provides a hash algorithm payment encryption method and system based on a block chain.

Background

With the continuous development of internet finance, payment is an indispensable important link in internet transaction, but many security risks are exposed, so that a security guarantee needs to be provided for payment. It is known that if the plaintext is directly hashed and encrypted, a hacker can easily obtain the plaintext by obtaining this cryptographic hash value and then by looking up the hash value dictionary. Salt is added, namely salt, which is an extra random value added in the password hash process, so that the problem can be effectively solved. The block chain technology has the characteristics of distributed storage and non-tampering, and ensures a secure payment environment by combining hash encryption.

Disclosure of Invention

The technical task of the invention is to provide a hash algorithm payment encryption method based on a block chain, which can effectively ensure the safety of payment parameters in the transmission process and prevent the illegal tampering of the parameters, aiming at the problems.

A further technical task of the present invention is to provide a block chain based hash algorithm payment encryption system.

In order to achieve the purpose, the invention provides the following technical scheme:

a hash algorithm payment encryption method based on a block chain is characterized in that a client encrypts payment parameters, a first ciphertext is returned, the client writes the ciphertext and a current time stamp into the block chain, the ciphertext and the payment parameters are transmitted to a server together, the server encrypts the payment parameters in the same encryption mode, a second ciphertext is returned, a third ciphertext is obtained from the block chain according to the time stamp in the payment parameters, the first ciphertext, the second ciphertext and the third ciphertext are compared, if the first ciphertext, the second ciphertext and the third ciphertext are the same, payment operation is conducted, and if not, payment operation is not conducted.

The block chain-based HASH algorithm payment encryption method can prevent the data from being intercepted carelessly in the data transmission process, the encrypted data can be obtained in a reverse query mode, the security of the payment parameters is greatly improved by adding an extra random value (SALT) in the HASH process, the loss caused by data leakage is reduced, the data cannot be tampered, and therefore the data security is guaranteed.

Preferably, the block chain-based hash algorithm payment encryption method specifically includes the following steps:

s1, the client side carries out safety encryption on the payment parameters and returns the ciphertext I to the client side;

s2, the client writes the ciphertext and the current timestamp into the block chain;

s3, the server receives the request transmitted by the client to obtain the ciphertext and the payment parameter, and the server encrypts the payment parameter in the same encryption mode and returns a ciphertext II;

s4, the server side obtains a ciphertext III from the block chain;

s5, the server side carries out safety verification on the payment parameters, whether the ciphertext I, the ciphertext II and the ciphertext III are consistent or not is judged, if yes, payment operation is carried out, and if not, the payment operation is not carried out.

Preferably, when the client encrypts the payment parameters, SHA256 salt encryption is adopted to encrypt the sensitive parameters.

Preferably, the client writes the ciphertext and the current time stamp into the block chain, and the time stamp can prevent repeated payment and ensure that only one payment transaction exists at each time point. And each transaction is recorded and stored independently, so that the single record is prevented from being controlled or tampered by people, and the safety of the transaction record is ensured.

The block chain has the uniqueness of distributed storage, each node stores complete data according to a block chain structure, and the storage of each node is independent and equal in status.

Preferably, the server receives the ciphertext and the payment parameter transmitted by the client, and encrypts the sensitive parameter by SHA256 salt-adding encryption.

Preferably, the server acquires the payment key in the blockchain according to the time stamp in the payment parameter, so as to acquire the ciphertext III from the blockchain.

A hash algorithm payment encryption system based on a block chain comprises a client payment parameter security encryption module, a block chain writing module, a server payment parameter security encryption module, a server ciphertext acquisition module and a server security verification module:

the client payment parameter security encryption module is responsible for the client to perform security encryption on the payment parameters and return a ciphertext I to the client;

the block chain writing module is responsible for writing the ciphertext and the current timestamp into the block chain by the client;

the server side payment parameter security encryption module is responsible for receiving a request transmitted by the client side by the server side, acquiring a ciphertext and payment parameters, encrypting the payment parameters by the server side in the same encryption mode and returning a ciphertext II;

the server side ciphertext acquisition module is responsible for acquiring a ciphertext III from the block chain by the server side;

and the server side safety verification module is responsible for carrying out safety verification on the payment parameters by the server side, judging whether the ciphertext I, the ciphertext II and the ciphertext III are consistent, if so, carrying out payment operation, and if not, carrying out payment operation.

Preferably, when the client-side payment parameter security encryption module is in charge of encrypting the payment parameters by the client side, SHA256 salt adding encryption is adopted to encrypt the sensitive parameters.

Preferably, in the block chain writing module, the client writes the ciphertext and the current time stamp into the block chain, and the time stamp can prevent repeated payment and ensure that only one payment transaction exists at each time point.

Preferably, in the server-side ciphertext obtaining module, the server side obtains the payment key in the block chain according to the time stamp in the payment parameter, so as to obtain the ciphertext three from the block chain.

Compared with the prior art, the hash algorithm payment encryption method based on the block chain has the following outstanding beneficial effects:

the block chain-based hash algorithm payment encryption method is based on the decentralization, the distributed storage and the independence of each node of the block chain, so that the data of each transaction is not tampered, and the credibility is high;

and (II) through SHA256 salt adding encryption, a hacker is effectively prevented from illegally calling a payment interface through own payment parameters and own generated hash value, a healthy payment environment is ensured, and the method has good popularization and application values.

Drawings

Fig. 1 is a flow chart of a block chain-based hash algorithm payment encryption method according to the present invention.

Detailed Description

The block chain based hash algorithm payment encryption method and system of the present invention will be described in further detail with reference to the accompanying drawings and embodiments.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:通过自主管控身份信息提供服务的方法、装置及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!