WO2020164280A1 - 数据传输加密方法、装置及存储介质、服务器 - Google Patents

数据传输加密方法、装置及存储介质、服务器 Download PDF

Info

Publication number
WO2020164280A1
WO2020164280A1 PCT/CN2019/118388 CN2019118388W WO2020164280A1 WO 2020164280 A1 WO2020164280 A1 WO 2020164280A1 CN 2019118388 W CN2019118388 W CN 2019118388W WO 2020164280 A1 WO2020164280 A1 WO 2020164280A1
Authority
WO
WIPO (PCT)
Prior art keywords
token
key
data
encryption
current
Prior art date
Application number
PCT/CN2019/118388
Other languages
English (en)
French (fr)
Inventor
李敏
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020164280A1 publication Critical patent/WO2020164280A1/zh

Links

Classifications

    • 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/40Network security protocols
    • 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
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials

Definitions

  • This application relates to the fields of encryption technology, information encryption and decryption, and symmetric encryption technology, and specifically relates to a data transmission encryption method, device, storage medium, and server.
  • An embodiment of the application provides a data transmission encryption method, including:
  • the performing AES encryption on the data to be stored based on the first token and the first random bit includes:
  • the first key is determined according to the key conversion array.
  • the determining the first key according to the key conversion array includes:
  • a key string is obtained according to the character, and a first key is determined based on the key string.
  • said performing md5 encryption on the first key to obtain a ciphertext data packet includes:
  • the method includes:
  • a data transmission packet is generated based on the first token, the current timestamp, the ciphertext data packet, and the encrypted data to be stored.
  • the method includes:
  • An embodiment of the present application also provides a data transmission encryption device, including:
  • An obtaining module configured to obtain a current data storage request, and generate a first token and a first random bit according to the current data storage request;
  • the first key determining module is configured to extract the data to be stored contained in the current data storage request, and perform AES encryption on the data to be stored based on the first token and the first random bit to obtain the first key ,
  • the first token is a universal identification code
  • the encryption module is used to perform md5 encryption on the first key to obtain a ciphertext data packet.
  • the first key determining module includes:
  • a character acquiring unit configured to acquire a number of characters corresponding to the first random bit from the first token through the first random bit
  • a conversion unit configured to convert the character into an Ascii code value, and process the Ascii code value to obtain a key conversion array
  • the first key determining unit is configured to determine the first key according to the key conversion array.
  • the embodiment of the present application also provides a server, including:
  • One or more processors are One or more processors;
  • One or more application-readable instructions wherein the one or more application-readable instructions are stored in the memory and configured to be executed by the one or more processors, and the one or more applications may
  • the read command configuration is used to execute the steps of the data transmission encryption method according to any technical solution.
  • a data transmission encryption method includes: obtaining a current data storage request, generating a first token and a first random bit according to the current data storage request; extracting the current data storage request including The data to be stored is encrypted by AES based on the first token and the first random bit to obtain a first key, where the first token is a universal identification code; A key is used for md5 encryption to obtain a ciphertext data packet.
  • the front-end After receiving the current data storage request, the front-end extracts the data to be stored from the current data storage request so that the front-end can obtain the data to be stored, in order to ensure the security of the front-end transmitting the data to be stored to the back-end;
  • the security of the end data transmission process after the front end encrypts the data to be stored, the back end can verify the transmitted data in a timely manner to ensure the consistency of the front and back keys.
  • the first token and the first random bit are determined by the back end Generated and provided to the front end, while ensuring the security of data transmission, while ensuring the verifiability of the key.
  • a method for encrypting data transmission provided by an embodiment of the present application, wherein the md5 encryption on the first key to obtain the ciphertext data packet includes: obtaining the first token and the current timestamp ; Generate a data transmission packet based on the first token, the current timestamp, the ciphertext data packet and the encrypted data to be stored.
  • the backend is provided with a data transmission packet that facilitates the backend to perform key verification, and the data transmission packet includes
  • the first order in the data transmission packet can be directly verified
  • the card and current timestamp are verified to prevent the back-end from discovering that the data to be stored has been intercepted after multiple verifications are completed, which improves the efficiency of back-end verification. That is, the backend can extract the first token and the current timestamp in the data transmission packet to verify the valid time.
  • FIG. 1 is a schematic flowchart of an implementation manner in a typical embodiment of the data transmission encryption method of this application;
  • FIG. 2 is a schematic structural diagram of a typical embodiment of a data transmission encryption device according to the application.
  • Fig. 3 is a schematic structural diagram of an embodiment of the application server.
  • the embodiments provided in this application are mainly used in systems that transmit data to the back-end through the front-end.
  • the front-end receives a data storage request
  • the data that needs to be transmitted is encrypted and transmitted, that is, the transmitted data is encrypted and transmitted.
  • the back-end when the back-end receives the data that needs to be stored, it verifies the data transmission password. When the password is correct, the data is stored in the back-end. If the password is incorrect, the back-end rejects the data storage request.
  • the separation of data transmission and storage including front-end and back-end systems is realized.
  • the front-end will perform every data storage request.
  • the data transmitted in the request is encrypted, and the password is dynamically generated by AES each time, thereby improving the security of data transmission. Encrypting the transmitted data through AES facilitates the adjustment of the password algorithm, increases the difficulty of password cracking, and further improves the security of the data during transmission.
  • the data transmission encryption method provided by the embodiment of the present application in one of the implementation manners, as shown in FIG. 1, includes: S100, S200, and S300.
  • S100 Obtain a current data storage request, and generate a first token and a first random bit according to the current data storage request;
  • S200 Extract the to-be-stored data contained in the current data storage request, and perform AES encryption on the to-be-stored data based on the first token and the first random bit to obtain a first key, where the first
  • the token is a universal identification code
  • S300 Perform md5 encryption on the first key to obtain a ciphertext data packet.
  • the front end After the front end receives the current data storage request, it extracts the data to be stored from the current data storage request so that the front end can obtain the data to be stored. In order to ensure the security of the front end transmitting the data to be stored to the back end, obtain the data to be stored After the data, the front end immediately generates the first token (Token) and the first random bit, where Token is a 32-bit UUID (Universal Identification Code), so that all elements in the system can have unique identification information. The identification information needs to be specified through the central control terminal.
  • the random bit can be a random number less than 32 bits.
  • the back-end in order to ensure the security of the front-end and back-end data transmission process, after the front-end encrypts the data to be stored, the back-end can verify the data to be transmitted in a timely manner to ensure the consistency of the front-end and back-end keys.
  • a token and the first random bit are generated by the back-end and provided to the front-end. While ensuring the security of data transmission, it also ensures the verifiability of the key. Since the current data storage request is obtained and the subsequent steps are carried out, a new token and random bit will be generated every time a new key is obtained, thereby ensuring that the AES encryption key is not encrypted every time. Similarly, improve the security of the key and the difficulty of cracking.
  • the data to be stored needs to be encrypted.
  • the encryption key is generated based on the first token and the first random bit.
  • the key generation process is completed at the front end, so that the front end can encrypt the stored data in a timely manner.
  • the specific encryption key generation process is detailed in the following text, and will not be repeated here.
  • the AES encryption is performed on the data to be stored based on the first token and the first random bit to obtain a first key, where the first token is a universal identification code and includes:
  • the first key is determined according to the key conversion array.
  • the data to be stored needs to be encrypted.
  • the encryption key is generated based on the first token and the first random bit.
  • the encryption key The generation process is completed at the front end, so that the front end can encrypt the stored data in a timely manner.
  • the first random bit is used to obtain the corresponding number of characters from the first token from the first random bit. Since the first random bit can be adjusted, the first random bit can be adjusted every time. The characters and the number of characters obtained in a token are different, which ensures that the key of the data to be stored in each data storage request is different, which increases the difficulty of cracking the key.
  • the number of random bits changes, so The number of characters obtained from acquiring Token is also different each time, which further increases the difficulty of riddle solving. It can be seen from the foregoing process that the number of random bits is easy to adjust, which makes it easier to adjust the algorithm for calculating the key each time. On the basis of ensuring the security of data transmission, it will not increase the amount of system calculation and ensure the speed of the key calculation process. Sex. In the process of calculating the first key, after obtaining the number of characters corresponding to the first random bit, the character is converted into an Ascii code value, and then the key conversion array can be obtained through the contrast method. If the key conversion data is further processed, the first key of the data to be stored can be determined.
  • the key conversion array can also directly extract the array of corresponding digits from the Ascii code value.
  • a new Token and random bits are generated each time the key is obtained;
  • Token is a 32-bit UUID;
  • the random bit is a random number less than 32, and the front end can obtain the corresponding key according to the newly obtained Token and random bit.
  • the determining the first key according to the key conversion array includes:
  • a key string is obtained according to the character, and a first key is determined based on the key string.
  • the characters corresponding to the subscripts are extracted from the first token based on the key conversion array, that is, each character in the token has a corresponding subscript.
  • the subscript of a character in the key conversion array is equal to a certain number in the key conversion array
  • a character with the subscript is extracted as the content of the first key, because the key conversion array has multiple Element, that is, multiple numbers. Therefore, multiple characters can be extracted from the Token through the key conversion array to form a string. All the content of the string is used as the content of the first key, and the string is used as the key at the same time String.
  • said performing md5 encryption on the first key to obtain a ciphertext data packet includes:
  • Md5 encryption is performed on the basis of the first token, the current timestamp, and the first key to obtain the ciphertext data packet.
  • the timestamp generated at the same time as the key string is obtained. That is, the time stamp and the key string are generated at the same time, so it is the current time stamp of the key string.
  • the key string and the current timestamp are encrypted with md5 to obtain the first key, wherein the first token is a universal identification code.
  • the md5 encryption algorithm is an information-digest algorithm.
  • the method includes:
  • a data transmission packet is generated based on the first token, the current timestamp, the ciphertext data packet, and the encrypted data to be stored.
  • the backend is provided with a data transmission packet that facilitates the backend to perform key verification, and the data transmission packet includes
  • the first token, the current timestamp, the ciphertext data packet, and the encrypted data to be stored are further verified at the back end, the first order in the data transmission packet can be directly verified
  • the card and current timestamp are verified to prevent the back-end from discovering that the data to be stored has been intercepted after multiple verifications are completed, which improves the efficiency of back-end verification.
  • the method includes:
  • the aforementioned data transmission packet is transmitted to the data storage server (back-end server).
  • the Token and the current timestamp are extracted.
  • the current timestamp is used to generate the secret key.
  • the key string is generated at the same time, and then it is verified whether the Token and the current timestamp are within the two respective preset valid times. If one of the Token and the current timestamp exceeds its corresponding valid time, it means that the data to be stored is It may have been intercepted and tampered with. In order to ensure the security of other data stored in the backend, the system will reject the aforementioned current data storage request.
  • the validity period of a Token is 15 minutes, and the timestamp must be within 3 minutes. If the above two conditions are not met, the system will reject the aforementioned current data storage request by ensuring that both the Token and the timestamp are in The corresponding validity period improves the security of back-end data storage and guarantees the security of data transmission.
  • the front-end can retrieve the data storage request including the data to be stored, and perform a new AES on the data to be stored
  • the encryption process makes the front-end encryption keys inconsistent each time, which improves the security of data transmission.
  • the embodiment of the present application also provides a data transmission encryption device.
  • a data transmission encryption device In one of the implementation manners, as shown in FIG. 2, it includes: a first acquisition module 100, a first key determination module 200, and an encryption module 300:
  • the first obtaining module 100 is configured to obtain a current data storage request, and generate a first token and a first random bit according to the current data storage request;
  • the first key determining module 200 is configured to extract the data to be stored contained in the current data storage request, and perform AES encryption on the data to be stored based on the first token and the first random bit to obtain the first key Key, wherein the first token is a universal identification code;
  • the encryption module 300 is configured to perform md5 encryption on the first key to obtain a ciphertext data packet.
  • the data transmission encryption method and apparatus further includes: a character obtaining unit 210, configured to obtain the first token from the first token through the first random bit A random number of characters corresponding to a random bit; the conversion unit 220 is used to convert the characters into Ascii code values, and the Ascii code values are processed to obtain a key conversion array; the first key determination unit 230 is used to determine The key conversion array determines the first key.
  • the extracting unit 231 is configured to extract the character corresponding to each element in the key conversion array with the subscript of the string in the first token; the key string obtaining unit 232 is configured to obtain the key character according to the character String, the first key is determined based on the key string.
  • the obtaining unit 310 is configured to obtain the first token and the current time stamp; the ciphertext data packet obtaining unit 320 is configured to compare the first token, the current time stamp, and the first key Perform md5 encryption to obtain the ciphertext data packet.
  • the second obtaining module 410 is used to obtain the first token and the current time stamp; the data transmission packet generating module 420 is used to generate data based on the first token, the current time stamp, and the ciphertext data
  • the packet and the encrypted data to be stored generate a data transmission packet.
  • the extraction module 430 is configured to transmit the data transmission packet to the data storage server, and extract the first token and the current time stamp in the data transmission packet; the judgment module 440 is configured to judge the first token And whether the current timestamp is within the preset valid time; the rejection module 450 is configured to reject the current time stamp when any one of the first token and the current time stamp is not within the preset valid time Data storage request.
  • the data transmission encryption method and device provided in the embodiments of the present application can implement the foregoing embodiments of the data transmission encryption method.
  • an embodiment of the present application provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, and when the readable instructions are executed by a processor, the data transmission encryption described in any one of the technical solutions is implemented method.
  • the computer-readable storage medium includes but is not limited to any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory, read-only memory), RAM (Random AcceSS Memory, random memory), EPROM (EraSable Programmable Read-Only Memory, erasable programmable read-only memory), EEPROM (Electrically EraSable Programmable Read-Only Memory, electrically erasable programmable read-only memory), flash memory, magnetic card or optical card.
  • a storage device includes any medium that stores or transmits information in a readable form by a device (for example, a computer, a mobile phone), and may be a read-only memory, a magnetic disk, or an optical disk
  • An embodiment of the application provides a computer-readable storage medium.
  • the computer-readable storage medium may be a non-volatile readable storage medium, which can implement the embodiment of the above-mentioned data transmission encryption method.
  • data is transmitted to At the back end, when the front end receives a data storage request, it encrypts the data that needs to be transmitted, that is, encrypts the transmitted data and transmits it to the back end.
  • the back end receives the data that needs to be stored, the data transmission is verified If the password is correct, the data will be stored in the backend. If the password is incorrect, the backend will reject the data storage request.
  • This method realizes the separation of data transmission and storage including front-end and back-end systems.
  • the front-end transmits data to each data storage request.
  • the data is encrypted, and the password is dynamically generated by AES each time, thereby improving the security of data transmission.
  • the transmitted data is encrypted by AES, which facilitates the adjustment of the password algorithm, increases the difficulty of password cracking, and further improves the security of the data in the transmission process;
  • the data transmission encryption method provided by the embodiment of this application includes: obtaining current A data storage request, generating a first token and a first random bit according to the current data storage request; extracting the to-be-stored data contained in the current data storage request, comparing the data based on the first token and the first random bit
  • the data to be stored is encrypted by AES to obtain a first key, where the first token is a universal identification code; md5 encryption is performed on the first key to obtain a ciphertext data packet.
  • the front end After the front end receives the current data storage request, it extracts the data to be stored from the current data storage request so that the front end can obtain the data to be stored. In order to ensure the security of the front end transmitting the data to be stored to the back end, obtain the data to be stored After the data, the front end immediately generates the first token (Token) and the first random bit, where Token is a 32-bit UUID (Universal Identification Code), so that all elements in the system can have unique identification information. The identification information needs to be specified through the central control terminal.
  • the random bit can be a random number less than 32 bits.
  • the back-end in order to ensure the security of the front-end and back-end data transmission process, after the front-end encrypts the data to be stored, the back-end can verify the data to be transmitted in a timely manner to ensure the consistency of the front-end and back-end keys.
  • a token and the first random bit are generated by the back-end and provided to the front-end. While ensuring the security of data transmission, it also ensures the verifiability of the key. Since the current data storage request is obtained and the subsequent steps are carried out, a new token and random bit will be generated every time a new key is obtained, thereby ensuring that the AES encryption key is not encrypted every time. Similarly, improve the security of the key and the difficulty of cracking.
  • the data to be stored needs to be encrypted.
  • the encryption key is generated based on the first token and the first random bit.
  • the key generation process is completed at the front end, so that the front end can encrypt the stored data in a timely manner.
  • the specific encryption key generation process is detailed in the following text, and will not be repeated here.
  • the present application also provides a server.
  • the memory 505 may be used to store application-readable instructions 501 and various functional modules.
  • the processor 503 runs the application-readable instructions 501 stored in the memory 505 to execute various functional applications and data processing of the device.
  • the memory 505 may be an internal memory or an external memory, or include both internal memory and external memory.
  • the internal memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, or random access memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • flash memory or random access memory.
  • External storage can include hard disks, floppy disks, ZIP disks, U disks, tapes, etc.
  • the memory disclosed in this application includes but is not limited to these types of memory.
  • the memory 505 disclosed in this application is only an example and not a limitation.
  • the input unit 507 is used to receive signal input, as well as personal information and related physical condition information input by the user.
  • the input unit 507 may include a touch panel and other input devices.
  • the touch panel can collect customer touch operations on or near it (for example, customers use fingers, stylus and other suitable objects or accessories to operate on the touch panel or near the touch panel), and according to the preset
  • the readable instructions drive the corresponding connection device; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as playback control buttons, switch buttons, etc.), trackball, mouse, and joystick.
  • the display unit 509 can be used to display information input by the customer or information provided to the customer and various menus of the computer device.
  • the display unit 509 can take the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the processor 503 is the control center of the computer equipment. It uses various interfaces and lines to connect the various parts of the entire computer, runs or executes the software readable instructions and/or modules stored in the memory 503, and calls the data stored in the memory. , Perform various functions and process data.
  • the one or more processors 503 shown in FIG. 3 can execute and realize the functions of the first acquisition module 100, the functions of the first key determination module 200, the functions of the encryption module 300, and the character acquisition unit shown in FIG.
  • the function of 210, the function of the conversion unit 220, the function of the first key determining unit 230, the function of the extraction unit 231, the function of the key string obtaining unit 232, the function of the obtaining unit 310, the function of the ciphertext data packet obtaining unit 320 The function, the function of the second acquisition module 410, the function of the data transmission packet generation module 420, the function of the extraction module 430, the function of the judgment module 440, and the function of the rejection module 450.
  • the server includes one or more processors 503, one or more memories 505, and one or more application-readable instructions 501, wherein the one or more application-readable instructions 501 are It is stored in the memory 505 and configured to be executed by the one or more processors 503, and the one or more application-readable instructions 301 are configured to execute the data transmission encryption method described in the above embodiments.
  • a server provided by an embodiment of this application can implement the above-mentioned embodiment of the data transmission encryption method.
  • the front-end transmits data to the back-end.
  • the data needs to be transmitted.
  • Data is encrypted for transmission, that is, the transmitted data is encrypted and transmitted to the backend.
  • the backend receives the data that needs to be stored, the password for the data transmission is verified.
  • the password is correct, the data is stored in the backend. If the password is incorrect, the backend rejects the data storage request.
  • This method realizes the separation of data transmission and storage including front-end and back-end systems.
  • the front-end transmits data to each data storage request.
  • the data is encrypted, and the password is dynamically generated by AES each time, thereby improving the security of data transmission.
  • the transmitted data is encrypted by AES, which facilitates the adjustment of the password algorithm, increases the difficulty of password cracking, and further improves the security of the data in the transmission process;
  • the data transmission encryption method provided by the embodiment of this application includes: obtaining current A data storage request, generating a first token and a first random bit according to the current data storage request; extracting the to-be-stored data contained in the current data storage request, comparing the data based on the first token and the first random bit
  • the data to be stored is encrypted by AES to obtain a first key, where the first token is a universal identification code; md5 encryption is performed on the first key to obtain a ciphertext data packet.
  • the front end After the front end receives the current data storage request, it extracts the data to be stored from the current data storage request so that the front end can obtain the data to be stored. In order to ensure the security of the front end transmitting the data to be stored to the back end, obtain the data to be stored After the data, the front end immediately generates the first token (Token) and the first random bit, where Token is a 32-bit UUID (Universal Identification Code), so that all elements in the system can have unique identification information. The identification information needs to be specified through the central control terminal.
  • the random bit can be a random number less than 32 bits.
  • the back-end in order to ensure the security of the front-end and back-end data transmission process, after the front-end encrypts the data to be stored, the back-end can verify the data to be transmitted in a timely manner to ensure the consistency of the front-end and back-end keys.
  • a token and the first random bit are generated by the back-end and provided to the front-end. While ensuring the security of data transmission, it also ensures the verifiability of the key. Since the current data storage request is obtained and the subsequent steps are carried out, a new token and random bit will be generated every time a new key is obtained, thereby ensuring that the AES encryption key is not encrypted every time. Similarly, improve the security of the key and the difficulty of cracking.
  • the data to be stored needs to be encrypted.
  • the encryption key is generated based on the first token and the first random bit.
  • the key generation process is completed at the front end, so that the front end can encrypt the stored data in a timely manner.
  • the specific encryption key generation process is detailed in the following text, and will not be repeated here.
  • the server provided in the embodiment of the present application can implement the embodiment of the data transmission encryption method provided above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

本申请涉及信息加解密技术领域,本申请实施例提供的一种数据传输加密方法,包括:获取当前数据存储请求,依据所当前数据存储请求生成第一令牌和第一随机位;提取当前数据存储请求中包含的待存储数据,基于第一令牌和第一随机位对待存储数据进行AES加密,获得第一密钥;对第一密钥进行md5加密,获得密文数据包。本申请中前端在接收一次数据存储请求时,则对该次需要传输的数据进行加密传输并传输到后端中,后端验证该数据传输的密码,在密码不正确,则后端拒绝该次数据存储请求。前端每次通过AES动态生成密码,进而提高了数据传输的安全性。通过AES密码算法便于调整,增加了密码破解难度,再次提高了数据在传输的安全性。

Description

数据传输加密方法、装置及存储介质、服务器
本申请要求于2019年02月13日提交中国专利局、申请号为201910113188.3、发明名称为“数据传输加密方法、装置及存储介质、服务器”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及密码技术、信息加解密、对称加密技术领域,具体涉及一种数据传输加密方法、装置及存储介质、服务器。
背景技术
随着各类应用系统的发展,数据在互联网上的安全受到了重视,特别是对于数据安全要求程度比较高的一些业务;如银行、军工、证券等行业。数据广泛在互联网上进行传输,随时有可能被截取的可能,如果数据使用明文发送,数据的安全毫无保证。同时有些行业,客户众多、业务需求大,如果使用固定的加密密钥进行相关数据的传送,会存在大量管理各种密钥的问题。常用RSA和AES加密算法进行加密传输等对传输数据加密,RSA是非对称密钥,安全性高,性能比较慢,对于大并发处理不太合适;AES是对称密钥,安全性高,性能块,但是密码只有一个,所以前端存储不安全。为了提高系统的运行效率和安全性,业务需要提高加解密速度的同时又能保证数据加密的安全性,其中,多数会采用AES对称密钥进行加密传输到后台。但是,通过AES对传输数据进行加密,密钥的安全性取决于密钥的获取方法和存储,而目前密钥的获取方法和存储使得通过AES加密的传输数据的安全性较低。
发明内容
为克服以上技术问题,特别是通过AES对传输数据加密时,密钥的获取方法和存储使得通过AES加密的传输数据的安全性较低的问题,特提出以下技术方案:
本申请实施例提供的一种数据传输加密方法,包括:
获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;
对所述第一密钥进行md5加密,获得密文数据包。
可选地,所述基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,包括:
通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;
将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;
依据所述密钥转换数组确定第一密钥。
可选地,所述依据所述密钥转换数组确定第一密钥包括:
提取第一令牌中字符串下标与所述密钥转换数组中的各元素相对应的字符;
依据所述字符获得密钥字符串,基于所述密钥字符串确定第一密钥。
可选地,所述对所述第一密钥进行md5加密,获得密文数据包,包括:
获取所述第一令牌和所述当前时间戳;
对所述第一令牌、所述当前时间戳和所述第一密钥进行md5加密,获得所述密文数据包。
可选地,所述对所述第一密钥进行md5加密,获得密文数据包之后,包括:
获取所述第一令牌和所述当前时间戳;
基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。
可选地,所述基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包之后,包括:
将所述数据传输包传输到数据存储服务器,提取所述数据传输包中的第一令牌和所述当前时间戳;
判断所述第一令牌和所述当前时间戳是否在预设有效时间内;
当所述第一令牌和所述当前时间戳中任一个不在所述预设有效时间内时,拒绝所述当前数据存储请求。
本申请实施例还提供了一种数据传输加密装置,包括:
获取模块,用于获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
第一密钥确定模块,用于提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;
加密模块,用于对所述第一密钥进行md5加密,获得密文数据包。
可选地,所述第一密钥确定模块,包括:
字符获取单元,用于通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;
转换单元,用于将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;
第一密钥确定单元,用于依据所述密钥转换数组确定第一密钥。
本申请实施例还提供了一种服务器,包括:
一个或多个处理器;
存储器;
一个或多个应用可读指令,其中所述一个或多个应用可读指令被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用可读指令配置用于执行根据任一技术方案所述的数据传输加密方法的步骤。
本申请与现有技术相比,具有以下有益效果:
1、本申请实施例提供的一种数据传输加密方法,包括:获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;对所述第一密钥进行md5加密,获得密文数据包。前端接收到当前次的数据存储请求之后,从当前次数据存储请求中提取出待存储数据,以便于前端能够获得待存储数据,为了保证前端将待存储数据传输到后端的安全性;为了保证前后端数据传输过程的安全性,在前端对待存储数据进行加密之后,后端能够及时地对待传输数据进行验证,保证前后端密钥的一致性,第一令牌和第一随机位是由后端生成并提供给前端的,在保证数据传输安全性时,同时保证密钥的可验证性。
2、本申请实施例提供的一种数据传输加密方法,所述对所述第一密钥进行md5加密,获得密文数据包之后,包括:获取所述第一令牌和所述当前时间戳;基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。前端对待存储数据进行AES加密之后,保证了数据传输过程的安全,且在AES加密前的第一密钥,保证了该待存储数据存储在后端的安全性。为了避免后端对AES加密之后的待存储数据进行解密的过程,在本申请提供的实施例中,为后端提供了方便后端进行密钥验证的数据传输包,该数据传输包中包括了所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据,进而在后端进行验证时,则可以直接验证对数据传输包中的第一令牌、当前时间戳进行验证,避免后端在多次验证完成之后,才发现待存储数据被截获过,提高了后端验证的效率。即后端可以提取数据传输包中的第一令牌和当前时间戳进行有效时间的验证,如果第一令牌和当前时间戳中有一个是超出其对应的有效时间时,则说明该待存储数据则可能被截获篡改过,为了保证后端中其他存储的其他数据的安全性,系统就会拒绝前述的当前数据存储请求。同时也提高了后端密钥验证的速率。
本申请附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本申请的实践了解到。
附图说明
本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:
图1为本申请数据传输加密方法的典型实施例中一种实施方式的流程示意图;
图2为本申请数据传输加密装置的典型实施例的结构示意图;
图3为本申请服务器的一实施例结构示意图。
具体实施方式
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本申请,而不能解释为对本申请的限制。
本申请提供的实施例中,主要应用于通过前端将数据传输到后端的系统中,前端在接收一次数据存储请求时,则对该次需要传输的数据进行加密传输,即将传输的数据加密并传输到后端中,后端接收到需要存储的数据时,验证该数据传输的密码,在密码正确时,则将该数据存储在后端中,若密码不正确,则后端拒绝该次数据存储请求。通过该方法实现了包括前端和后端系统的数据传输和存储的分离,在本申请提供的实施例中,不管是否为同一客户端提出的多次数据存储请求时,前端则对每一次数据存储请求中传输的数据进行加密,且每次密码通过AES动态生成,进而提高了数据传输的安全性。通过AES对传输的数据进行加密,便于调整密码算法,增加了密码破解难度,进一步地提高了数据在传输过程中的安全性。
本申请实施例提供的一种数据传输加密方法,在其中一种实施方式中,如图1所示,包括:S100、S200、S300。
S100:获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
S200:提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;
S300:对所述第一密钥进行md5加密,获得密文数据包。
前端接收到当前次的数据存储请求之后,从当前次数据存储请求中提取出待存储数据,以便于前端能够获得待存储数据,为了保证前端将待存储数据传输到后端的安全性,获得待存储数据之后,前端则立刻生成第一令牌(Token)和第一随机位,其中Token是32位的UUID(通用识别码),让系统中的所有元素,都能有唯一的辨识信息,而不需要通过中央控制端来做辨识信息的指定。随机位可以为一个小于32位的随机数。在本申请提供的实施例中,为了保证前后端数据传输过程的安全性,在前端对待存储数据进行加密之后,后端能够及时地对待传输数据进行验证,保证前后端密钥的一致性,第一令牌和第一随机位是由后端生成并提供给前端的,在保证数据传输安全性时,同时保证密钥的可验证性。由于仅是在获取到当前数据存储请求之后,并进行后续的步骤,进而实现了每一次获取新的密钥时,都会生成一个新的token和随机位,进而保证AES每一次加密密钥都不一样,提高密钥的安全性和破解难度。在前述的基础上,为了保证待存储数据从前端传输到后端过程中的安全性,则需要对待存储数据进行加密,加密密钥是基于第一令牌和第一随机位生成的,加密密钥的生成过程在前端完成,以便于前端能够及时地对待存储数据进行加密。具体加密密钥的生成过程详见后文,在此不做赘述。为了能够更好地保证待存储数据在传输过程中的安全性,在本申请提供的实施例中,还需要通过md5对第一密钥加密,即针对第一密钥中的内容进行加密,通过再一次的加密也再一次增加了第一密钥的破解难度,进一步地保证可待存储数据在传输过程中的安全性。由于AES是对称密钥,安全性高、加密过程的性能快,且密码只有一个,该方法也保证了待存储数据传输的快捷性,一个密码方便后端对该AES加密的密码进行验证。由于前端仅是对待存储数据加密,后端用于存储数据,进而在保证数据传输过程中的安全性时,也能够保证数据存储的安全性。
可选地,所述基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码,包括:
通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;
将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;
依据所述密钥转换数组确定第一密钥。
如前所述,为了保证待存储数据从前端传输到后端过程中的安全性,则需要对待存储数据进行加密,加密密钥是基于第一令牌和第一随机位生成的,加密密钥的生成过程在前端完成,以便于前端能够及时地对待存储数据进行加密。在本申请提供的实施例中,通过第一随机位从第一令牌中获取所述第一随随机位对应数量的字符,由于第一随机位是可以调整的,进而可以使得每一次从第一令牌中获取的字符以及字符数量都不一样,进而保证每一次数据存储请求中待存储数据的密钥都不一样,增加了密钥的破解难度,同时随着随机位位数变化,使得每一次从获取Token中获取的字符数量也不同,进一步增加了谜语破解难度。从前述过程可知,随机位的位数容易调整,使得每一次计算密钥的算法比较容易调整,在保证数据传输安全性的基础上,也不会增加系统计算量,保证密钥计算过程的快捷性。在第一密钥计算过程中,获取到所述第一随随机位对应数量的字符之后,则将该字符转换成Ascii码值,之后可以通过前后异的方法获取到密钥转换数组,在对密钥转换数据进一步处理,则可以确定待存储数据的第一密钥。密钥转换数组还可以直接从Ascii码值中直接提取对应位数的数组。为了便于理解,本申请的实施例提供了如下示例进行说明,如前所述,对于每次获取密钥的时候会生成新的Token和随机位; Token是32位的UUID; 随机位是一个小于32的随机数,前端根据最新得到的Token和随机位可以得到对应的密钥。例如,通过随机位从Token中对应的位置开始计算获取17个字符,再将这17个字符转换成对应Ascii码值,进行前后异或获取一组16位数组,如:这样一组Ascii码值[57, 100, 49, 54, 97, 49, 51, 49, 53, 51, 53, 100, 101, 100, 50, 97, 101] 计算方式:57异或100,100异或49以此类推,得到一个16位的数组,该16位数组即为前述的密钥转换数组。对密钥转换数据进一步处理,确定待存储数据的第一密钥的过程详见后文,在此不做赘述。
可选地,所述依据所述密钥转换数组确定第一密钥包括:
提取第一令牌中字符串下标与所述密钥转换数组中的各元素相对应的字符;
依据所述字符获得密钥字符串,基于所述密钥字符串确定第一密钥。
在前述的基础上确定了密钥转换数组之后,则基于该密钥转换数组从第一令牌中提取对应下标的字符出来,即Token中的每个字符都具有相应的下标,当Token中的某个字符的下标与密钥转换数组中的某一数字相等时,则将具有该下标的某个字符提取出来,作为第一密钥的内容,由于密钥转换数组具有中具有多个元素,即多个数字,因此,可以通过密钥转换数组从Token中提取出多个字符,组成一个字符串,该字符串的所有内容作为第一密钥的内容,同时该字符串作为密钥字符串。结合前述示例,在获得16位的密钥转换数组之后,通过这16位的数字数组在Token这个字符串中提取对应下标的字符出来,组成一个字符串,该字符串中至少包括了16个字符。可选地,所述对所述第一密钥进行md5加密,获得密文数据包,包括:
获取所述第一令牌和所述当前时间戳;
对依据所述第一令牌、所述当前时间戳和所述第一密钥进行md5加密,获得所述密文数据包。
为了提高后端验证的安全性,在获得密钥字符串之后,还需要对第一密钥进一步地进行具有时效的安全加密。因此,获取产生该密钥字符串同时产生的时间戳。即该时间戳和密钥字符串同时产生,因此为密钥字符串的当前时间戳。将密钥字符串和当前时间戳一起进行md5加密,获得第一密钥,其中,所述第一令牌为通用识别码。md5加密算法是信息-摘要算法。通过该方法在后期验证时可以保证前端传输到后端的待存储数据一致性,避免待存储数据在传输过程中被截获重新加密后被存储在后端中。
可选地,所述对所述第一密钥进行md5加密,获得密文数据包之后,包括:
获取所述第一令牌和所述当前时间戳;
基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。
前端对待存储数据进行AES加密之后,保证了数据传输过程的安全,且在AES加密前的第一密钥,保证了该待存储数据存储在后端的安全性。为了避免后端对AES加密之后的待存储数据进行解密的过程,在本申请提供的实施例中,为后端提供了方便后端进行密钥验证的数据传输包,该数据传输包中包括了所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据,进而在后端进行验证时,则可以直接验证对数据传输包中的第一令牌、当前时间戳进行验证,避免后端在多次验证完成之后,才发现待存储数据被截获过,提高了后端验证的效率。
可选地,所述基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包之后,包括:
将所述数据传输包传输到数据存储服务器,提取所述数据传输包中的第一令牌和所述当前时间戳;
判断所述第一令牌和所述当前时间戳是否在预设有效时间内;
当所述第一令牌和所述当前时间戳中任一个不在所述预设有效时间内时,拒绝所述当前数据存储请求。
如前所述,将前述数据传输包传输到数据存储服务器(后端服务器),后端验证数据传输包中的密钥之前,先提取其中的Token和当前时间戳,该当前时间戳在产生密钥字符串同时产生,之后验证Token和当前时间戳是否在两各自对应的预设有效时间内,如果Token和当前时间戳中有一个是超出其对应的有效时间时,则说明该待存储数据则可能被截获篡改过,为了保证后端中其他存储的其他数据的安全性,系统就会拒绝前述的当前数据存储请求。示例性的,一个Token的有效期是15分钟,时间戳必须在3分钟内的,如果以上两个条件没满足,系统就会拒绝前述的当前数据存储请求,通过保证Token和时间戳两者均在其对应的有效期内,提高了后端数据存储的安全性,也保证了数据传输的安全性,前端则可以重新获取包括该待存储数据的数据存储请求,并对该待存储数据进行新的AES加密过程,以使得前端每一次加密的密钥不一致,提高了数据传输的安全性。
本申请实施例还提供了一种数据传输加密装置,在其中一种实施方式中,如图2所示,包括:第一获取模块100、第一密钥确定模块200、加密模块300:
第一获取模块100,用于获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
第一密钥确定模块200,用于提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;
加密模块300,用于对所述第一密钥进行md5加密,获得密文数据包。
进一步地,如图2所示,本申请实施例中提供的一种数据传输加密方法装置还包括:字符获取单元210,用于通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;转换单元220,用于将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;第一密钥确定单元230,用于依据所述密钥转换数组确定第一密钥。提取单元231,用于提取第一令牌中字符串下标与所述密钥转换数组中的各元素相对应的字符;密钥字符串获得单元232,用于依据所述字符获得密钥字符串,基于所述密钥字符串确定第一密钥。获取单元310,用于获取所述第一令牌和所述当前时间戳;密文数据包获得单元320,用于对所述第一令牌、所述当前时间戳和所述第一密钥进行md5加密,获得所述密文数据包。第二获取模块410,用于获取所述第一令牌和所述当前时间戳;数据传输包生成模块420,用于基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。提取模块430,用于将所述数据传输包传输到数据存储服务器,提取所述数据传输包中的第一令牌和所述当前时间戳;判断模块440,用于判断所述第一令牌和所述当前时间戳是否在预设有效时间内;拒绝模块450,用于当所述第一令牌和所述当前时间戳中任一个不在所述预设有效时间内时,拒绝所述当前数据存储请求。
本申请实施例提供的一种数据传输加密方法装置可以实现上述数据传输加密方法的实施例,具体功能实现请参见方法实施例中的说明,在此不再赘述。
本申请实施例提供的一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,该可读指令被处理器执行时实现任一项技术方案所述的数据传输加密方法。其中,所述计算机可读存储介质包括但不限于任何类型的盘(包括软盘、硬盘、光盘、CD-ROM、和磁光盘)、ROM(Read-Only Memory,只读存储器)、RAM(Random AcceSS Memory,随即存储器)、EPROM(EraSable Programmable Read-Only Memory,可擦写可编程只读存储器)、EEPROM(Electrically EraSable Programmable Read-Only Memory,电可擦可编程只读存储器)、闪存、磁性卡片或光线卡片。也就是,存储设备包括由设备(例如,计算机、手机)以能够读的形式存储或传输信息的任何介质,可以是只读存储器,磁盘或光盘等。
本申请实施例提供的一种计算机可读存储介质,计算机可读存储介质可以是非易失性可读存储介质,可实现上述数据传输加密方法的实施例,在本申请中通过前端将数据传输到后端,前端在接收一次数据存储请求时,则对该次需要传输的数据进行加密传输,即将传输的数据加密并传输到后端中,后端接收到需要存储的数据时,验证该数据传输的密码,在密码正确时,则将该数据存储在后端中,若密码不正确,则后端拒绝该次数据存储请求。通过该方法实现了包括前端和后端系统的数据传输和存储的分离,在本申请提供的实施例中,同一客户端提出了多次数据存储请求时,前端则对每一次数据存储请求中传输的数据进行加密,且每次密码通过AES动态生成,进而提高了数据传输的安全性。通过AES对传输的数据进行加密,便于调整密码算法,增加了密码破解难度,进一步地提高了数据在传输过程中的安全性;本申请实施例提供的一种数据传输加密方法,包括:获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;对所述第一密钥进行md5加密,获得密文数据包。前端接收到当前次的数据存储请求之后,从当前次数据存储请求中提取出待存储数据,以便于前端能够获得待存储数据,为了保证前端将待存储数据传输到后端的安全性,获得待存储数据之后,前端则立刻生成第一令牌(Token)和第一随机位,其中Token是32位的UUID(通用识别码),让系统中的所有元素,都能有唯一的辨识信息,而不需要通过中央控制端来做辨识信息的指定。随机位可以为一个小于32位的随机数。在本申请提供的实施例中,为了保证前后端数据传输过程的安全性,在前端对待存储数据进行加密之后,后端能够及时地对待传输数据进行验证,保证前后端密钥的一致性,第一令牌和第一随机位是由后端生成并提供给前端的,在保证数据传输安全性时,同时保证密钥的可验证性。由于仅是在获取到当前数据存储请求之后,并进行后续的步骤,进而实现了每一次获取新的密钥时,都会生成一个新的token和随机位,进而保证AES每一次加密密钥都不一样,提高密钥的安全性和破解难度。在前述的基础上,为了保证待存储数据从前端传输到后端过程中的安全性,则需要对待存储数据进行加密,加密密钥是基于第一令牌和第一随机位生成的,加密密钥的生成过程在前端完成,以便于前端能够及时地对待存储数据进行加密。具体加密密钥的生成过程详见后文,在此不做赘述。为了能够更好地保证待存储数据在传输过程中的安全性,在本申请提供的实施例中,还需要通过md5对第一密钥加密,即针对第一密钥中的内容进行加密,通过再一次的加密也再一次增加了第一密钥的破解难度,进一步地保证可待存储数据在传输过程中的安全性。由于AES是对称密钥,安全性高、加密过程的性能快,且密码只有一个,该方法也保证了待存储数据传输的快捷性,一个密码方便后端对该AES加密的密码进行验证。由于前端仅是对待存储数据加密,后端用于存储数据,进而在保证数据传输过程中的安全性时,也能够保证数据存储的安全性。
此外,在又一种实施例中,本申请还提供一种服务器,如图3所示,所述服务器处理器503、存储器505、输入单元507以及显示单元509等器件。本领域技术人员可以理解,图3示出的结构器件并不构成对所有服务器的限定,可以包括比图示更多或更少的部件,或者组合某些部件。存储器505可用于存储应用可读指令501以及各功能模块,处理器503运行存储在存储器505的应用可读指令501,从而执行设备的各种功能应用以及数据处理。存储器505可以是内存储器或外存储器,或者包括内存储器和外存储器两者。内存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)、快闪存储器、或者随机存储器。外存储器可以包括硬盘、软盘、ZIP盘、U盘、磁带等。本申请所公开的存储器包括但不限于这些类型的存储器。本申请所公开的存储器505只作为例子而非作为限定。
输入单元507用于接收信号的输入,以及用户输入的个人信息和相关的身体状况信息。输入单元507可包括触控面板以及其它输入设备。触控面板可收集客户在其上或附近的触摸操作(比如客户使用手指、触笔等任何适合的物体或附件在触控面板上或在触控面板附近的操作),并根据预先设定的可读指令驱动相应的连接装置;其它输入设备可以包括但不限于物理键盘、功能键(比如播放控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。显示单元509可用于显示客户输入的信息或提供给客户的信息以及计算机设备的各种菜单。显示单元509可采用液晶显示器、有机发光二极管等形式。处理器503是计算机设备的控制中心,利用各种接口和线路连接整个电脑的各个部分,通过运行或执行存储在存储器503内的软件可读指令和/或模块,以及调用存储在存储器内的数据,执行各种功能和处理数据。图3中所示的一个或多个处理器503能够执行、实现图2中所示的第一获取模块100的功能、第一密钥确定模块200的功能、加密模块300的功能、字符获取单元210的功能、转换单元220的功能、第一密钥确定单元230的功能、提取单元231的功能、密钥字符串获得单元232的功能、获取单元310的功能、密文数据包获得单元320的功能、第二获取模块410的功能、数据传输包生成模块420的功能、提取模块430的功能、判断模块440的功能、拒绝模块450的功能。
在一种实施方式中,所述服务器包括一个或多个处理器503,以及一个或多个存储器505,一个或多个应用可读指令501,其中所述一个或多个应用可读指令501被存储在存储器505中并被配置为由所述一个或多个处理器503执行,所述一个或多个应用可读指令301配置用于执行以上实施例所述的数据传输加密方法。
本申请实施例提供的一种服务器,可实现上述数据传输加密方法的实施例,在本申请中通过前端将数据传输到后端,前端在接收一次数据存储请求时,则对该次需要传输的数据进行加密传输,即将传输的数据加密并传输到后端中,后端接收到需要存储的数据时,验证该数据传输的密码,在密码正确时,则将该数据存储在后端中,若密码不正确,则后端拒绝该次数据存储请求。通过该方法实现了包括前端和后端系统的数据传输和存储的分离,在本申请提供的实施例中,同一客户端提出了多次数据存储请求时,前端则对每一次数据存储请求中传输的数据进行加密,且每次密码通过AES动态生成,进而提高了数据传输的安全性。通过AES对传输的数据进行加密,便于调整密码算法,增加了密码破解难度,进一步地提高了数据在传输过程中的安全性;本申请实施例提供的一种数据传输加密方法,包括:获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;对所述第一密钥进行md5加密,获得密文数据包。前端接收到当前次的数据存储请求之后,从当前次数据存储请求中提取出待存储数据,以便于前端能够获得待存储数据,为了保证前端将待存储数据传输到后端的安全性,获得待存储数据之后,前端则立刻生成第一令牌(Token)和第一随机位,其中Token是32位的UUID(通用识别码),让系统中的所有元素,都能有唯一的辨识信息,而不需要通过中央控制端来做辨识信息的指定。随机位可以为一个小于32位的随机数。在本申请提供的实施例中,为了保证前后端数据传输过程的安全性,在前端对待存储数据进行加密之后,后端能够及时地对待传输数据进行验证,保证前后端密钥的一致性,第一令牌和第一随机位是由后端生成并提供给前端的,在保证数据传输安全性时,同时保证密钥的可验证性。由于仅是在获取到当前数据存储请求之后,并进行后续的步骤,进而实现了每一次获取新的密钥时,都会生成一个新的token和随机位,进而保证AES每一次加密密钥都不一样,提高密钥的安全性和破解难度。在前述的基础上,为了保证待存储数据从前端传输到后端过程中的安全性,则需要对待存储数据进行加密,加密密钥是基于第一令牌和第一随机位生成的,加密密钥的生成过程在前端完成,以便于前端能够及时地对待存储数据进行加密。具体加密密钥的生成过程详见后文,在此不做赘述。为了能够更好地保证待存储数据在传输过程中的安全性,在本申请提供的实施例中,还需要通过md5对第一密钥加密,即针对第一密钥中的内容进行加密,通过再一次的加密也再一次增加了第一密钥的破解难度,进一步地保证可待存储数据在传输过程中的安全性。由于AES是对称密钥,安全性高、加密过程的性能快,且密码只有一个,该方法也保证了待存储数据传输的快捷性,一个密码方便后端对该AES加密的密码进行验证。由于前端仅是对待存储数据加密,后端用于存储数据,进而在保证数据传输过程中的安全性时,也能够保证数据存储的安全性。
本申请实施例提供的服务器可以实现上述提供的数据传输加密方法的实施例,具体功能实现请参见方法实施例中的说明,在此不再赘述。
以上所述仅是本申请的部分实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (20)

  1. 一种数据传输加密方法,其特征在于,包括:
    获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
    提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥;
    对所述第一密钥进行md5加密,获得密文数据包;
    其中,所述基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥包括:
    通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;
    将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;
    依据所述密钥转换数组确定第一密钥;
    其中,所述依据所述密钥转换数组确定第一密钥包括:
    提取第一令牌中字符串下标与所述密钥转换数组中的各元素相对应的字符;
    依据所述字符获得密钥字符串,基于所述密钥字符串确定第一密钥。
  2. 根据权利要求1所述的数据传输加密方法,其特征在于,所述对所述第一密钥进行md5加密,获得密文数据包,包括:
    获取所述第一令牌和所述当前时间戳;
    对所述第一令牌、所述当前时间戳和所述第一密钥进行md5加密,获得所述密文数据包。
  3. 根据权利要2所述的数据传输加密方法,其特征在于,所述对所述第一密钥进行md5加密,获得密文数据包之后,包括:
    获取所述第一令牌和所述当前时间戳;
    基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。
  4. 根据权利要3所述的数据传输加密方法,其特征在于,所述基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包之后,包括:
    将所述数据传输包传输到数据存储服务器,提取所述数据传输包中的第一令牌和所述当前时间戳;
    判断所述第一令牌和所述当前时间戳是否在预设有效时间内;
    当所述第一令牌和所述当前时间戳中任一个不在所述预设有效时间内时,拒绝所述当前数据存储请求。
  5. 根据权利要1所述的数据传输加密方法,其特征在于,所述第一令牌为通用识别码。
  6. 一种数据传输加密装置,其特征在于,包括:
    获取模块,用于获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
    第一密钥确定模块,用于提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;
    加密模块,用于对所述第一密钥进行md5加密,获得密文数据包;
    其中,所述第一密钥确定模块,包括:
    字符获取单元,用于通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;
    转换单元,用于将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;
    第一密钥确定单元,用于依据所述密钥转换数组确定第一密钥;
    其中,所述第一密钥确定单元,还包括:
    提取单元,用于提取第一令牌中字符串下标与所述密钥转换数组中的各元素相对应的字符;
    密钥字符串获得单元,用于依据所述字符获得密钥字符串,基于所述密钥字符串确定第一密钥。
  7. 根据权利要求6所述的数据传输加密装置,其特征在于,所述加密模块,包括:
    获取单元,用于获取所述第一令牌和所述当前时间戳;
    密文数据包获得单元,用于对所述第一令牌、所述当前时间戳和所述第一密钥进行md5加密,获得所述密文数据包。
  8. 根据权利要7所述的数据传输加密装置,其特征在于,数据传输加密装置,还包括:
    第二获取模块,用于获取所述第一令牌和所述当前时间戳;
    数据传输包生成模块,用于基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。
  9. 根据权利要8所述的数据传输加密装置,其特征在于,所述数据传输加密装置,包括:
    提取模块,用于将所述数据传输包传输到数据存储服务器,提取所述数据传输包中的第一令牌和所述当前时间戳;
    判断模块,用于判断所述第一令牌和所述当前时间戳是否在预设有效时间内;
    拒绝模块,用于当所述第一令牌和所述当前时间戳中任一个不在所述预设有效时间内时,拒绝所述当前数据存储请求。
  10. 根据权利要6所述的数据传输加密装置,其特征在于,所述第一令牌为通用识别码。
  11. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机可读指令,该可读指令被处理器执行以下步骤:
    获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
    提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;
    对所述第一密钥进行md5加密,获得密文数据包;
    其中,所述基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码,包括:
    通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;
    将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;
    依据所述密钥转换数组确定第一密钥。
    其中,所述依据所述密钥转换数组确定第一密钥包括:
    提取第一令牌中字符串下标与所述密钥转换数组中的各元素相对应的字符;
    依据所述字符获得密钥字符串,基于所述密钥字符串确定第一密钥。
  12. 根据权利要11所述的计算机可读存储介质,其特征在于,所述对所述第一密钥进行md5加密,获得密文数据包,包括:
    获取所述第一令牌和所述当前时间戳;
    对所述第一令牌、所述当前时间戳和所述第一密钥进行md5加密,获得所述密文数据包。
  13. 根据权利要12所述的计算机可读存储介质,其特征在于,所述对所述第一密钥进行md5加密,获得密文数据包之后,包括:
    获取所述第一令牌和所述当前时间戳;
    基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。
  14. 根据权利要13所述的计算机可读存储介质,其特征在于,所述基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包之后,包括:
    将所述数据传输包传输到数据存储服务器,提取所述数据传输包中的第一令牌和所述当前时间戳;
    判断所述第一令牌和所述当前时间戳是否在预设有效时间内;
    当所述第一令牌和所述当前时间戳中任一个不在所述预设有效时间内时,拒绝所述当前数据存储请求。
  15. 根据权利要13所述的计算机可读存储介质,其特征在于,所述第一令牌为通用识别码。
  16. 一种服务器,其特征在于,包括:一个或多个处理器;存储器;
    一个或多个应用可读指令,其中所述一个或多个应用可读指令被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个应用可读指令配置用于执行以下步骤:
    获取当前数据存储请求,依据所述当前数据存储请求生成第一令牌和第一随机位;
    提取所述当前数据存储请求中包含的待存储数据,基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码;
    对所述第一密钥进行md5加密,获得密文数据包;
    其中,所述基于所述第一令牌和第一随机位对所述待存储数据进行AES加密,获得第一密钥,其中,所述第一令牌为通用识别码,包括:
    通过所述第一随机位从第一令牌中获取所述第一随随机位对应数量的字符;
    将所述字符转换成Ascii码值,对所述Ascii码值进行处理获得密钥转换数组;
    依据所述密钥转换数组确定第一密钥;
    其中,所述依据所述密钥转换数组确定第一密钥包括:
    提取第一令牌中字符串下标与所述密钥转换数组中的各元素相对应的字符;
    依据所述字符获得密钥字符串,基于所述密钥字符串确定第一密钥。
  17. 根据权利要16所述的服务器,其特征在于,所述一个或多个应用可读指令配置用于执行所述对所述第一密钥进行md5加密,获得密文数据包,包括:
    获取所述第一令牌和所述当前时间戳;
    对所述第一令牌、所述当前时间戳和所述第一密钥进行md5加密,获得所述密文数据包。
  18. 根据权利要17所述的服务器,其特征在于,所述一个或多个应用可读指令配置用于执行所述对所述第一密钥进行md5加密,获得密文数据包之后,包括:
    获取所述第一令牌和所述当前时间戳;
    基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包。
  19. 根据权利要18所述的服务器,其特征在于,所述一个或多个应用可读指令配置用于执行所述基于所述第一令牌、所述当前时间戳、所述密文数据包和加密后的所述待存储数据生成数据传输包之后,包括:
    将所述数据传输包传输到数据存储服务器,提取所述数据传输包中的第一令牌和所述当前时间戳;
    判断所述第一令牌和所述当前时间戳是否在预设有效时间内;
    当所述第一令牌和所述当前时间戳中任一个不在所述预设有效时间内时,拒绝所述当前数据存储请求。
  20. 根据权利要16所述的服务器,其特征在于,所述第一令牌为通用识别码。
PCT/CN2019/118388 2019-02-13 2019-11-14 数据传输加密方法、装置及存储介质、服务器 WO2020164280A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910113188.3 2019-02-13
CN201910113188.3A CN109921894B (zh) 2019-02-13 2019-02-13 数据传输加密方法、装置及存储介质、服务器

Publications (1)

Publication Number Publication Date
WO2020164280A1 true WO2020164280A1 (zh) 2020-08-20

Family

ID=66961580

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118388 WO2020164280A1 (zh) 2019-02-13 2019-11-14 数据传输加密方法、装置及存储介质、服务器

Country Status (2)

Country Link
CN (1) CN109921894B (zh)
WO (1) WO2020164280A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113703995A (zh) * 2021-08-13 2021-11-26 深圳市中博科创信息技术有限公司 前后端数据交互方法、装置、电子设备及存储介质
CN116702218A (zh) * 2023-08-07 2023-09-05 腾讯科技(深圳)有限公司 小程序中三维模型的渲染方法、装置、终端及存储介质

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109688160B (zh) * 2019-01-28 2021-09-28 平安科技(深圳)有限公司 数据加密传输控制方法、装置、计算机设备及存储介质
CN109921894B (zh) * 2019-02-13 2022-08-12 平安科技(深圳)有限公司 数据传输加密方法、装置及存储介质、服务器
CN111211891B (zh) * 2020-01-13 2023-04-28 广东跑合中药材电子商务有限公司 一种多维度aes对称加解密方法
CN111586066B (zh) * 2020-05-12 2022-08-12 上海依图网络科技有限公司 一种多媒体数据加密处理的方法及装置
CN111818078B (zh) * 2020-07-21 2022-06-24 成都英孚克斯科技有限公司 一种基于环境因子的称重数据安全传输方法及系统
CN113761550A (zh) * 2020-11-05 2021-12-07 北京沃东天骏信息技术有限公司 一种加密的方法和装置
CN112580076A (zh) * 2020-12-21 2021-03-30 天元大数据信用管理有限公司 一种应用在金融交易类前端项目中的安全保密方法
CN114338008B (zh) * 2021-12-27 2024-05-14 中国电信股份有限公司 加密传输方法、装置、系统以及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050182934A1 (en) * 2004-01-28 2005-08-18 Laszlo Elteto Method and apparatus for providing secure communications between a computer and a smart card chip
CN104683111A (zh) * 2015-03-18 2015-06-03 中国联合网络通信集团有限公司 一种基于md5的加密方法及系统
CN106534176A (zh) * 2016-12-08 2017-03-22 西安交大捷普网络科技有限公司 一种云环境下数据安全存储方法
CN109921894A (zh) * 2019-02-13 2019-06-21 平安科技(深圳)有限公司 数据传输加密方法、装置及存储介质、服务器

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050005108A1 (en) * 2003-05-13 2005-01-06 Bsi2000, Inc. Cryptographically secure transactions with optical cards
CN101340279B (zh) * 2008-07-09 2011-02-02 深圳市金蝶友商电子商务服务有限公司 数据加密及解密方法、系统及设备
DE102015201298A1 (de) * 2015-01-26 2016-07-28 Robert Bosch Gmbh Verfahren zum kryptographischen Bearbeiten von Daten
US10061932B1 (en) * 2018-01-04 2018-08-28 WindTalker, LLC Securing portable data elements between containers in insecure shared memory space
CN108429736A (zh) * 2018-02-11 2018-08-21 众算(上海)数据科技有限公司 一种数据解密方法
CN108494740B (zh) * 2018-03-01 2021-08-24 捷开通讯(深圳)有限公司 令牌生成和校验方法、智能终端及服务器
CN108600268B (zh) * 2018-05-09 2020-09-22 聚龙股份有限公司 一种应用于非授信认证的加密解密方法及非授信认证系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050182934A1 (en) * 2004-01-28 2005-08-18 Laszlo Elteto Method and apparatus for providing secure communications between a computer and a smart card chip
CN104683111A (zh) * 2015-03-18 2015-06-03 中国联合网络通信集团有限公司 一种基于md5的加密方法及系统
CN106534176A (zh) * 2016-12-08 2017-03-22 西安交大捷普网络科技有限公司 一种云环境下数据安全存储方法
CN109921894A (zh) * 2019-02-13 2019-06-21 平安科技(深圳)有限公司 数据传输加密方法、装置及存储介质、服务器

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113703995A (zh) * 2021-08-13 2021-11-26 深圳市中博科创信息技术有限公司 前后端数据交互方法、装置、电子设备及存储介质
CN113703995B (zh) * 2021-08-13 2024-04-16 深圳市中博科创信息技术有限公司 前后端数据交互方法、装置、电子设备及存储介质
CN116702218A (zh) * 2023-08-07 2023-09-05 腾讯科技(深圳)有限公司 小程序中三维模型的渲染方法、装置、终端及存储介质
CN116702218B (zh) * 2023-08-07 2023-12-05 腾讯科技(深圳)有限公司 小程序中三维模型的渲染方法、装置、终端及存储介质

Also Published As

Publication number Publication date
CN109921894B (zh) 2022-08-12
CN109921894A (zh) 2019-06-21

Similar Documents

Publication Publication Date Title
WO2020164280A1 (zh) 数据传输加密方法、装置及存储介质、服务器
US10248578B2 (en) Methods and systems for protecting data in USB systems
WO2020237868A1 (zh) 数据传输方法、电子设备、服务器及存储介质
WO2018194350A1 (ko) Utxo 기반 프로토콜을 이용한 블록체인 기반의 문서 관리 방법 및 이를 이용한 문서 관리 서버
WO2017111383A1 (ko) 생체 정보 기반 인증 장치, 이와 연동하는 제어 서버, 그리고 이들의 생체 정보 기반 로그인 방법
WO2018030707A1 (ko) 인증 시스템 및 방법과 이를 수행하기 위한 사용자 단말, 인증 서버 및 서비스 서버
WO2018194351A1 (ko) Utxo 기반 프로토콜에서 머클 트리 구조를 이용하는 블록체인 기반의 문서 관리 방법 및 이를 이용한 문서 관리 서버
JP4240297B2 (ja) 端末機器、認証端末プログラム、機器認証サーバ、機器認証プログラム
WO2020204444A2 (ko) 월렛 앱이 설치된 소유 디바이스 및/또는 블록체인 노드에 키를 분산 저장하는 비밀 키 보안 방법
WO2016169410A1 (zh) 登录方法、服务器和登录系统
WO2017105072A1 (ko) 생체 정보 기반 인증 장치 그리고 이의 동작 방법
WO2017071329A1 (zh) 密码管理方法、密码管理系统及终端设备
WO2014069778A1 (ko) 아이디 기반 암호화, 복호화 방법 및 이를 수행하기 위한 장치
WO2017135669A1 (ko) 파일에 대한 노터리 서비스를 제공하고 상기 노터리 서비스를 사용하여 기록된 파일에 대한 검증을 수행하는 방법 및 서버
WO2014063455A1 (zh) 即时通信方法和系统
WO2014185594A1 (ko) Vdi 환경에서의 싱글 사인온 시스템 및 방법
WO2017071363A1 (zh) 密码的共享方法、密码的共享系统及终端设备
WO2020013381A1 (ko) 온라인 월렛 장치 및 이의 생성과 검증 방법
WO2018035929A1 (zh) 一种验证码的处理方法及装置
US10250596B2 (en) Monitoring encrypted communication sessions
WO2021072881A1 (zh) 基于对象存储的请求处理方法、装置、设备及存储介质
WO2016206530A1 (zh) 一种高级安全的移动支付方法、装置及系统
WO2018097521A1 (ko) 데이터베이스의 이중화를 위한 방법
WO2017116062A1 (ko) 파일에 대한 공증 및 검증을 수행하는 방법 및 서버
WO2017166884A1 (zh) 基于外接设备的文件处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19915173

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01/12/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19915173

Country of ref document: EP

Kind code of ref document: A1