WO2014044137A1 - 通信的加密和解密的方法、装置及系统 - Google Patents

通信的加密和解密的方法、装置及系统 Download PDF

Info

Publication number
WO2014044137A1
WO2014044137A1 PCT/CN2013/083291 CN2013083291W WO2014044137A1 WO 2014044137 A1 WO2014044137 A1 WO 2014044137A1 CN 2013083291 W CN2013083291 W CN 2013083291W WO 2014044137 A1 WO2014044137 A1 WO 2014044137A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
array
binary numbers
string
convert
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.)
Ceased
Application number
PCT/CN2013/083291
Other languages
English (en)
French (fr)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to US14/430,837 priority Critical patent/US20150244521A1/en
Publication of WO2014044137A1 publication Critical patent/WO2014044137A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0891Revocation or update of secret information, e.g. encryption key update or rekeying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • 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
    • H04L9/088Usage controlling of secret information, e.g. techniques for restricting cryptographic keys to pre-authorized uses, different access levels, validity of crypto-period, different key- or password length, or different strong and weak cryptographic algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/34Encoding or coding, e.g. Huffman coding or error correction

Definitions

  • the present invention relates to the field of information processing, and in particular, to a method, device and system for encrypting and decrypting communications. Background of the invention
  • the communication information between the client and the server used by the user must be fully encrypted to prevent user information from leaking.
  • Currently commonly used encryption algorithms are
  • a method of encrypting communications including:
  • a method for decrypting communications characterized in that it comprises:
  • a communication encryption device comprising:
  • An extracting unit configured to: extract a first character string to be encrypted from the information to be sent; and a converting unit, configured to convert the first character string obtained by the extracting unit into a first plurality of binary numbers for storage;
  • An encryption unit configured to encrypt the stored first plurality of binary numbers according to a preset encryption algorithm to generate a second plurality of binary numbers
  • the converting unit is further configured to convert the second plurality of binary numbers into a string to be sent;
  • a coding unit configured to transmit and encode a to-be-sent character string generated by the conversion unit
  • a sending unit configured to send the coding result generated by the coding unit
  • a device for decrypting communication characterized in that it comprises:
  • a receiving unit configured to receive to-be-processed information sent by the sending end
  • a decoding unit configured to perform transmission decoding on the to-be-processed information received by the receiving unit, to obtain a first character string
  • a converting unit configured to convert the first string into a first plurality of binary numbers for storage
  • a decrypting unit configured to decrypt the stored first plurality of binary numbers according to a preset decryption algorithm to generate a second plurality of binary numbers
  • the converting unit is further configured to convert the second plurality of binary numbers into a second character string.
  • a system for encrypting and decrypting communications including the encrypted device of the above communication and the decrypted device of the above communication.
  • Embodiments of the present invention provide a method, device, and system for encrypting and decrypting communications, by converting information to be transmitted into binary numbers for storage, and then encrypting or decrypting the stored information, and then deriving the encrypted result or the decrypted result. And converted to a string to use The process of implementing encryption and decryption.
  • FIG. 1 is a schematic diagram of a communication system according to an embodiment of the present invention
  • FIG. 2 is a structural diagram of a computing device according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for encrypting communications according to an embodiment of the present invention
  • FIG. 4 is a flowchart of another method for encrypting communications according to an embodiment of the present invention
  • FIG. FIG. 6 is a flowchart of a method for decrypting communication according to an embodiment of the present invention
  • FIG. 7 is a flowchart of another method for decrypting communication according to an embodiment of the present invention
  • 8 is a flowchart of a method for decrypting another communication according to an embodiment of the present invention
  • FIG. 9 is a block diagram of a device for encrypting communication according to an embodiment of the present invention
  • FIG. 10 is another schematic diagram of an embodiment of the present invention.
  • FIG. 11 is a block diagram of a device for encrypting another communication according to an embodiment of the present invention
  • FIG. 12 is a block diagram of a device for decrypting a communication according to an embodiment of the present invention
  • FIG. 13 is a block diagram of a device for decrypting another communication according to an embodiment of the present invention
  • FIG. 14 is a block diagram of another device for decrypting communication according to an embodiment of the present invention
  • Figure 15 is a block diagram of a system for encrypting and decrypting communications according to an embodiment of the present invention. Mode for carrying out the invention
  • the communication system includes a server device 10, a communication network 20, and a user terminal device.
  • the user terminal device may be a personal computer 30, a mobile phone 40, a tablet computer 50, or other various mobile internet terminals (MIDs), such as an e-reader, a palm game terminal, or the like that can connect to the Internet using various wireless communication technologies.
  • MIDs mobile internet terminals
  • Both the server device and the user terminal device can apply the encryption and decryption methods of the embodiment of the present invention.
  • the devices that implement the encryption and decryption methods are collectively referred to as computing devices or computers.
  • the computing device to which the encryption method is applied is a server
  • the computing device that decrypts the encrypted information of the server using the decryption method may be a user terminal, and vice versa.
  • FIG. 2 is a block diagram showing the structure of a computing device of an embodiment.
  • computer 200 may be a computing device capable of implementing the methods and software systems provided by embodiments of the present invention.
  • the computer 200 can be a personal computer or a portable device such as a laptop, tablet, cell phone or smartphone, and the like.
  • the computer 200 can also be a server connected to the above device via a network.
  • Computer 200 can have different capabilities and features. Various possible implementations are within the scope of this article.
  • computer 200 can include a keypad/keyboard 256, and can also include a display 254, such as a liquid crystal display (LCD), or a display with advanced features, such as a touch sensitive 2D or 3D display.
  • a web-enabled computer 200 can include one or more physical or virtual keyboards, as well as mass storage device 230.
  • the computer 200 may also include or allow various operating systems 241, such as a WindowsTM or LinuxTM operating system, or a mobile operating system, such as iOSTM, AndroidTM, or Windows MobileTM, etc.
  • Computer 200 can include or run various applications 242, such as communication encryption/decryption application 245.
  • Application 242 is capable of communicating encryptedly with other devices over a network.
  • computer 200 can include one or more processor readable non-volatile storage media 230 and one or more processors 222 in communication with storage medium 230.
  • the processor readable non-volatile storage medium 230 can be a RAM, a flash memory, a ROM, an EPROM, an EEPROM, a register, a hard disk, a removable hard disk, a CD-ROM, or other various forms of non-volatile storage media.
  • Storage medium 230 may store a series of instructions or units and/or modules containing instructions for performing the operations of various embodiments of the present invention.
  • the processor can execute the above instructions to perform the operations in the various embodiments.
  • the embodiment of the invention provides a method for encrypting communication, which can be applied to a computing device based on WEB communication, for example, a client device such as a mobile phone or a tablet computer, and a server device such as a server of an operator or a service provider.
  • a computing device based on WEB communication for example, a client device such as a mobile phone or a tablet computer, and a server device such as a server of an operator or a service provider.
  • the computing devices of the two communication parties need to respectively set at least one encryption module and at least one decryption module or communication encryption/decryption application.
  • the communication encryption/decryption application can be implemented using Javascript.
  • FIG. 3 is a schematic diagram of an encryption method for communication according to an embodiment of the present invention.
  • the method is a method of encrypting a module side, and may include the following steps.
  • the information to be sent is information that is sent by the client device to the server device, and may include user information for logging in services, such as a user name and a password, and may also include data information of a certain WEB service, and the information may be
  • the encrypted information may also be unencrypted information, which is not limited in this embodiment of the present invention.
  • the information to be sent can be stored in the form of JSON (JavaScript Object Notation), for example, [object Object] : ⁇ "nick”: "Preference Share” ⁇ . Therefore The first string ⁇ "nick”: "self-selected stock” ⁇ can be directly extracted from the information to be sent.
  • JSON JavaScript Object Notation
  • a specific implementation method for converting the first character string into a first plurality of binary numbers for storage may be as shown in FIG. 4.
  • the method can include the following steps.
  • each character in the second string corresponds to one byte.
  • information is stored as a string, which may contain information such as English letters, English symbols, Chinese characters, Chinese characters, etc., and single Chinese characters are mostly multi-byte characters.
  • the encoded value corresponding to a single Chinese character requires more than one byte of storage space.
  • step 3021 The purpose of the conversion of step 3021 is to convert the characters whose corresponding encoded values need to occupy more than one byte of storage space into a plurality of characters whose corresponding encoded values occupy only one byte of storage space for subsequent encryption processing.
  • the first string can be stored in Unicode encoding, and the first string can be converted to a second string using UTF-8 encoding.
  • the first string is "nick”: "Preference Share”
  • the corresponding second string is ' ' ⁇ ": “ :]: €%. , ⁇ ".
  • the above coding method is only an example, and other embodiments may adopt other feasible coding methods, which are not limited herein.
  • the one element in the first character array corresponds to a single-byte encoded value of one character in the second character string.
  • step 302 since step 302 is performed before step 303, in step 303, the code value corresponding to each character is directly determined.
  • converting the second string into the first character array may follow an ACSII code table, for example, the second string is " ⁇ ": " :1: €%. , ⁇ " , the corresponding first character array For [123, 34, 110, 105, 99, 107, 34, 58, 34, 232, 135, 170, 233, 128, 137, 232, 130, 161, 34, 125].
  • each array block includes a preset number of elements.
  • the preset value is a natural number, which can be set according to actual needs. All the elements in the character array can be divided into blocks according to a preset number, and each array block has a preset number of elements.
  • the dividing the elements in the character array into a plurality of array blocks may include: dividing the adjacent four elements in turn according to the order of the elements in the first character array. As an array block.
  • converting the elements in each array block into 8-bit binary numbers, and storing multiple 8-bit binary numbers corresponding to each array block may include: The four elements are converted into 8-bit binary numbers, and the four 8-bit binary numbers corresponding to each array block are combined into one 32-bit binary number. A 32-bit binary number corresponding to each of the array blocks is stored.
  • the preset encryption algorithm may include an encryption algorithm commonly used in current WEB services such as TEA and MD5.
  • the encryption algorithms for the use of different service types to be transmitted may also differ.
  • FIG. 5 is a diagram of the method of converting the second plurality of binary numbers into a string to be sent. The method can include the following steps.
  • the corresponding second character array is obtained by step 3041 as [234, 109, 33, 119, 105, 146, 35, 0, 147, 240, 52, 189, 187 , 172, 109, 20, 182, 48, 131, 71, 255, 98, 83, 140, 113, 228, 59, 246, 232, 150, 55, 180 ].
  • the one element in the second character array corresponds to a single-byte encoded value of one character in the string to be sent.
  • the one element in the second character array corresponds to a single-byte encoded value of one character in the string to be sent.
  • the converting the second character array into a string to be sent may follow the ACSII code table.
  • the second character array is [234, 109, 33, 119, 105, 146, 35, 0, 147, 240, 52, 189, 187, 172, 109, 20, 182, 48, 131, 71, 255, 98, 83, 140, 113, 228, 59, 246, 232, 150, 55, 180].
  • the character string to be transmitted is transmitted and encoded in step 305 in this embodiment.
  • FIG. 6 is a schematic diagram of a method for decrypting communications according to an embodiment of the present invention.
  • the method is a decryption module
  • the side method can include the following steps.
  • the information to be processed is the encrypted information sent by the encryption module.
  • the information to be processed is transmitted and decoded, and the first character string needs to follow the transmission coding mode used by the encryption module.
  • the encryption and decryption algorithms and the codec mode used between the two sides of the encryption module and the decryption module may be matched originally, and may also be communicated in time. This embodiment of the present invention does not limit this.
  • the corresponding first string is " ⁇ m!wi, #".
  • FIG. 7 is a schematic diagram of the method for converting the first character string into a first plurality of binary numbers for storage.
  • the method can include the following steps.
  • the one element in the first character array corresponds to a single-byte encoded value of one character in the third character string.
  • converting the first character string into the first character array may follow the ACSII code table. If the first character string is " ⁇ m!wi, # ", the corresponding second character array is [234, 109, 33 , 119. 105, 146, 35, 0, 147, 240, 52, 189, 187, 172, 109, 20, 182, 48, 131, 71, 255, 98, 83, 140, 113, 228, 59, 246 , 232, 150, 55, 180].
  • each array block includes a predetermined number of elements.
  • the preset number can be the same as the setting of the encryption module.
  • the elements in the character array are divided into several numbers.
  • the chunking may include: dividing the adjacent four elements into one array block in turn according to the order of the elements in the first character array.
  • each element in the array block into an 8-bit binary number, and store multiple 8-bit binary numbers corresponding to each array block.
  • the elements in each array block are respectively converted into 8-bit binary numbers, and storing the corresponding 8-bit binary numbers of each array block may include: The four elements are converted into 8-bit binary numbers, and the four 8-bit binary numbers corresponding to each array block are combined into one 32-bit binary number. A 32-bit binary number corresponding to each of the array blocks is stored.
  • the preset decryption algorithm should correspond to the encryption algorithm set on the encryption module side.
  • Figure 8 is a method of converting the second plurality of binary numbers into a second character string. The method can include the following steps.
  • the first character array in step 3031 is [234, 109, 33, 119, 105, 146 35, 0, 147, 240, 52, 189, 187, 172, 109, 20, 182, 48, 131 , 71, 255, 98, 83, 140, 113, 228, 59, 246, 232, 150, 55, 180 ], then after step 6051, the corresponding second character array is [123, 34, 110, 105, 99, 107, 34, 58, 34, 232, 135, 170, 233. 128, 137, 232, 130, 161, 34, 125].
  • the one element in the second character array corresponds to a single-byte encoded value of one character in the second character string.
  • converting the second character array into a second string can follow
  • ACSII code table for example, if the second character array is [123, 34, 110, 105, 99, 107, 34, 58, 34, 232, 135, 170, 233, 128, 137, 232, 130, 161, 34, 125], then the second string is ''nick'':'' :j: €%. , .
  • a second string of one character per character can be converted to a Unicode encoding for storage.
  • the conversion method of step 606 can follow UTF-8 encoding. For example, if the second string is ' ' ⁇ ':" :]: €%. , ⁇ " , the corresponding source information corresponding to the to-be-processed information is "nick": "self-selected stock", and "nick”: "self-selected stock” can be stored in JSON form.
  • the character encoding method used in the above encryption and decryption methods may be any suitable encoding method, and the encoding method used in the above example is merely an example, and may be replaced with other encoding methods.
  • Embodiments of the present invention provide a method for encrypting and decrypting communications, by converting information to be transmitted into a binary number for storage, and then encrypting or decrypting the stored information, and then exporting and converting the encrypted result or the decrypted result into characters.
  • the string is used to implement the process of encryption and decryption.
  • the embodiment of the present invention stores the information to be transmitted into a binary number, and provides information in a binary format for the encryption algorithm, so that various encryption algorithms can also be used in the Javascript language environment. According to the specific needs of the WEB service, different encryption algorithms are used to ensure the security of user information in the javascript environment.
  • FIG. 9 is a device 90 for encrypting communications according to an embodiment of the present invention.
  • the apparatus may include: an extracting unit 91, a converting unit 92, an encrypting unit 93, an encoding unit 94, and a transmitting unit 95.
  • the extracting unit 91 is configured to extract, from the information to be sent, the first character string to be encrypted.
  • the converting unit 92 is configured to convert the first string obtained by the extracting unit 91 into a first A plurality of binary numbers are stored.
  • the encryption unit 93 is configured to encrypt the stored first plurality of binary numbers according to a preset encryption algorithm to generate a second plurality of binary numbers.
  • the converting unit 92 is further configured to convert the second plurality of binary numbers into a word to be sent.
  • the encoding unit 94 is configured to transmit and encode the character string to be sent generated by the converting unit 92.
  • the sending unit 95 is configured to send the encoding result generated by the encoding unit.
  • the converting unit 92 may include: a first converting module 921, a second converting module 922, a dividing module 923, a third converting module 924, and a storage module 925.
  • the first conversion module 921 is configured to convert the first character string to be encrypted into a second character string; wherein each character in the second character string corresponds to one byte.
  • a second conversion module 922 configured to convert the second character string obtained by the first conversion module 921 into a first character array; wherein, one element in the first character array corresponds to one character in the second character string Single-byte encoded value.
  • the segmentation module 923 is configured to divide the elements in the character array obtained by the second conversion module 922 into a plurality of array blocks; wherein each array block includes a preset number of elements.
  • the third conversion module 924 is configured to convert the elements in the array block 923 into each of the array blocks into 8-bit binary numbers.
  • the storage module 925 is configured to store a plurality of 8-bit binary numbers corresponding to each array block obtained by the third conversion module 923.
  • the dividing module 92 may sequentially divide the adjacent 4 elements into one array block according to the order of the elements in the first character array.
  • the third conversion module 794 is configured to separately convert 4 elements in each array block It is an 8-bit binary number and combines the four 8-bit binary numbers corresponding to each array block into one 32-bit binary number.
  • the storage module 925 is configured to store a 32-bit binary number corresponding to each of the array blocks.
  • the conversion unit 92 includes: a fourth conversion module 926 and a fifth conversion module 927.
  • the fourth conversion module 926 is configured to convert every 8 adjacent binary numbers of the second plurality of binary numbers into a single-byte encoded value to generate a second character array.
  • a fifth conversion module 927 configured to convert the second character array obtained by the fourth conversion module 926 into a character string to be sent; wherein, one element in the second character array corresponds to one character in the string to be sent Single-byte encoded value.
  • FIG. 12 is a schematic diagram of a device 120 for decrypting communications according to an embodiment of the present invention.
  • the device 120 can include:
  • the receiving unit 1201 is configured to receive the to-be-processed information sent by the sending end.
  • the decoding unit 1202 is configured to perform transmission decoding on the to-be-processed information received by the receiving unit 1201 to obtain a first character string.
  • the converting unit 1203 is configured to convert the first string into a first plurality of binary numbers for storage
  • the decrypting unit 1204 is configured to decrypt the stored first plurality of binary numbers according to a preset decryption algorithm to generate a second plurality of binary numbers;
  • the converting unit 1203 is further configured to convert the second plurality of binary numbers into a second word payment.
  • the converting unit 1203 may include: a first conversion module 1231, configured to convert the first character string to be decrypted into a first character array; wherein, the first An element in the character array corresponds to one of the third strings The single-byte encoded value of the characters.
  • the segmentation module 1232 is configured to divide the elements in the character array obtained by the first conversion module into a plurality of array blocks according to a preset value; wherein each array block includes a predetermined number of elements.
  • the second conversion module 1233 is configured to convert the elements in each array block into 8-bit binary numbers.
  • the storage module 1234 is configured to store a plurality of 8-bit binary numbers corresponding to each array block.
  • the segmentation module 1232 is configured to sequentially divide the adjacent four elements into one array block according to the arrangement of the elements in the first character array.
  • the second conversion module 1233 is configured to convert 4 elements in each array block into 8-bit binary numbers, and combine 4 8-bit binary numbers corresponding to each array block into one 32-bit binary number. .
  • the storage module 1234 is configured to store a 32-bit binary number corresponding to each array block.
  • the converting unit 1203 includes: a third converting module 1235 and a fourth converting module 1236.
  • the third conversion module 1235 is configured to convert every 8 adjacent binary numbers of the second plurality of binary numbers into a single-byte encoded value to generate a second character array.
  • a fourth conversion module 1236 configured to convert the second character array obtained by the third conversion module 1235 into a second character string; wherein, one element in the second character array corresponds to the second character string A single-byte encoded value of one character.
  • FIG. 14 is a system for encrypting and decrypting communications according to an embodiment of the present invention.
  • the system may include an encrypted device 90 for communication as described above and a decrypted device 120 for communication.
  • Embodiments of the present invention provide a device and system for encrypting and decrypting communications,
  • the information to be sent is converted into a binary number for storage, and then the stored information is encrypted or decrypted, and the encrypted result or the decrypted result is exported and converted into a string for use, thereby implementing a process of encryption and decryption.
  • the embodiment of the present invention stores the information to be transmitted into a binary number, and provides information in a binary format for the encryption algorithm, so that various encryption algorithms can be used in the Javascript language environment to ensure the security of the user information in the javascript environment. .
  • the hardware modules in the various embodiments may be implemented mechanically or electronically.
  • a device such as an FPGA or an ASIC, is used to perform a specific operation.
  • the hardware modules may also include programmable logic devices or circuits (e.g., including general purpose processors or other programmable processors) that are temporarily configured by software for performing particular operations.
  • Hardware-specific implementations either with dedicated permanent circuits or with temporarily configured circuits (as configured by software), can be implemented based on cost and time considerations.
  • the present invention also provides a machine readable storage medium storing instructions for causing a machine (which may be a personal computer, server, or network device, etc.) to perform a method as described herein.
  • a machine which may be a personal computer, server, or network device, etc.
  • a system or apparatus equipped with a storage medium on which software program code for realizing the functions of any of the above-described embodiments is stored may be provided, and the system is The computer (or CPU or MPU) of the device or device reads and executes the program code stored in the storage medium.
  • some or all of the actual operations may be performed by an operating system or the like operating on a computer based on instructions of the program code.
  • Storage medium embodiments for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), Tape, non-volatile memory card and ROM.
  • the program code can be downloaded from the server computer by the communication network.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)
  • Document Processing Apparatus (AREA)
  • Information Transfer Between Computers (AREA)

Description

通信的加密和解密的方法、 装置及系统 技术领域
本发明涉及信息处理领域,尤其涉及一种通信的加密和解密的方法、 装置及系统。 发明背景
为了用户信息的安全, 必须要对用户使用的客户端与服务端之间的 通信信息进行全程加密, 以防止用户信息泄漏。 目前常用的加密算法有
TEA, BASE64、 MD5等。 发明内容
一种通信的加密的方法, 包括:
从待发送信息中提取待加密的第一字符串;
将所述第一字符串转化为第一多个二进制数进行存储;
按照预设加密算法对已存储的第一多个二进制数进行加密, 生成第 二多个二进制数;
将所述第二多个二进制数转化为待发送字符串;
将所述待发送字符串进行传输编码并发送编码结果。
一种通信的解密的方法, 其特征在于, 包括:
接收发送端发送的待处理信息;
将所述待处理信息进行传输解码, 得到第一字符串;
将所述第一字符串转化为第一多个二进制数进行存储;
按照预设解密算法对已存储的第一多个二进制数进行解密, 生成第 将所述第二多个二进制数转化为第二字符串。
一种通信的加密的装置, 其特征在于, 包括:
提取单元, 用于从待发送信息中提取待加密的第一字符串; 转化单元, 用于将所述提取单元得到的第一字符串转化为第一多个 二进制数进行存储;
加密单元, 用于按照预设加密算法对已存储的第一多个二进制数进 行加密, 生成第二多个二进制数;
所述转化单元, 还用于将所述第二多个二进制数转化为待发送字符 串;
编码单元,用于将所述转化单元生成的待发送字符串进行传输编码; 发送单元, 用于发送所述编码单元生成的编码结果。
一种通信的解密的装置, 其特征在于, 包括:
接收单元, 用于接收发送端发送的待处理信息;
解码单元, 用于将所述接收单元接收的待处理信息进行传输解码, 得到第一字符串;
转化单元, 用于将所述第一字符串转化为第一多个二进制数进行存 储;
解密单元, 用于按照预设解密算法对已存储的第一多个二进制数进 行解密, 生成第二多个二进制数;
所述转化单元,还用于将所述第二多个二进制数转化为第二字符串。 一种通信的加密和解密的系统, 包括上述通信的加密的装置和上述 通信的解密的装置。
本发明实施例提供了一种通信的加密和解密的方法、 装置及系统, 通过将待发送信息转化为二进制数进行存储, 然后对存储信息进行加密 或解密处理, 再将加密结果或解密结果导出并转化为字符串使用, 从而 实现加密和解密的流程。 附图简要说明
图 1为本发明实施例提供的一种通信系统示意图;
图 2为本发明实施例提供的一种计算设备结构图;
图 3为本发明实施例提供的一种通信的加密的方法流程图; 图 4为本发明实施例提供的另一种通信的加密的方法流程图; 图 5为本发明实施例提供的另一种通信的加密的系统的组成框图; 图 6为本发明实施例提供的一种通信的解密的方法流程图; 图 7为本发明实施例提供的另一种通信的解密的方法流程图; 图 8为本发明实施例提供的另一种通信的解密的方法流程图; 图 9为本发明实施例提供的一种通信的加密的装置的组成框图; 图 10为本发明实施例提供的另一种通信的加密的装置的组成框图; 图 11为本发明实施例提供的另一种通信的加密的装置的组成框图; 图 12为本发明实施例提供的一种通信的解密的装置的组成框图; 图 13为本发明实施例提供的另一种通信的解密的装置的组成框图; 图 14为本发明实施例提供的另一种通信的解密的装置的组成框图; 图 15 为本发明实施例提供的一种通信的加密和解密的系统的组成 框图。 实施本发明的方式
为了描述上的筒洁和直观, 下文通过描述若干代表性的实施例来对 本发明的方案进行阐述。 实施例中大量的细节仅用于帮助理解本发明的 方案。 但是很明显, 本发明的技术方案实现时可以不局限于这些细节。 为了避免不必要地模糊了本发明的方案, 一些实施方式没有进行细致地 描述, 而是仅给出了框架。 下文中, "包括 "是指 "包括但不限于", "根 据…… " 是指 "至少根据……, 但不限于仅根据…… "。 由于汉语的语 言习惯, 下文中没有特别指出一个成分的数量时, 意味着该成分可以是 一个也可以是多个, 或可理解为至少一个。
图 1为一个实施例的通信系统的示意图。 如图 1所示, 通信系统包 括服务器设备 10, 通信网络 20和用户终端设备。 用户终端设备可以是 个人电脑 30、 手机 40、 平板电脑 50, 还可以是其它各种移动互联网终 端 (MID ), 如可以利用各种无线通信技术连接到互联网的电子阅读器、 掌上游戏终端等。 上述服务器设备和用户终端设备均可以应用本发明实 施例的加密、 解密方法。 后文将实现加密、 解密方法的装置统称为计算 设备或计算机。 当应用加密方法的计算设备是服务器时, 应用解密方法 对服务器的加密信息进行解密的计算设备可以是用户终端, 反之亦然。
图 2是一个实施例的计算设备的结构示意图。 如图 2所示, 计算机 200可以是能够实现本发明实施例提供的方法和软件系统的计算设备。 例如, 计算机 200可以是个人电脑或便携设备, 例如笔记本电脑、 平板 电脑、 手机或智能手机, 等。 计算机 200还可以是与上述设备通过网络 相连的服务器。
计算机 200可以具有不同的性能和特征。 各种可能的实现方式都在 本文的保护范围内。 例如, 计算机 200可以包括按键区 /键盘 256, 还可 以包括一个显示器 254, 如液晶显示器(LCD ), 或者具有高级功能的显 示器, 例如触摸感应 2D或 3D显示器。 一个例子中, 一个具有 web功 能的计算机 200可以包括一个或多个物理键盘或虚拟键盘, 以及大容量 存储装置 230。
计算机 200也可以包括或允许各种操作系统 241 , 例如 WindowsTM 或 LinuxTM操作系统, 或移动操作系统, 如 iOSTM, AndroidTM, 或 Windows MobileTM等。 计算机 200可以包括或运行各种应用程序 242 , 例如通信加 /解密应用 245。 应用程序 242能够通过网络与其它设备进行 加密通信。
此外, 计算机 200可以包括一个或多个处理器可读的非易失性存储 介质 230和一个或多个与存储介质 230通信的处理器 222。 例如, 处理 器可读的非易失性存储介质 230可以是 RAM、 闪存、 ROM、 EPROM、 EEPROM、 寄存器、 硬盘、 移动硬盘、 CD-ROM, 或其它各种形式的非 易失性存储介质。 存储介质 230可以存储一系列指令或包含指令的单元 和 /或模块, 用于完成本发明各种实施例的操作。 处理器可以执行上述指 令, 完成各种实施例中的操作。
本发明实施例提供了一种通信的加密的方法,可以应用于基于 WEB 通信的计算设备, 例如, 手机、 平板电脑等客户端设备, 和运营商或业 务提供商的服务器等服务端设备。
在本发明实施例中, 通信双方的计算设备, 如客户端设备和服务端 设备,需要分别设置至少一加密模块和至少一解密模块或通信加 /解密应 用程序。 通信加 /解密应用程序可以利用 Javascript实现。
图 3为本发明实施例提供的一种通信的加密方法。 该方法为加密模 块侧的方法, 可以包括以下步骤。
301、 从待发送信息中提取待加密的第一字符串。
其中, 所述待发送信息为由客户端设备发送至服务端设备的信息, 可以包括如用户名和密码等用于登录业务的用户信息, 也可以包括某项 WEB 业务的数据信息, 这些信息可以是加密过的信息, 也可以是未加 密的信息, 本发明实施例对此不进行限制。
在 WEB 服务中, 待发送信息可以以 JSON ( JavaScript Object Notation )形式进行存放, 例如, [object Object] : {"nick":"自选股 " }。 故 从待发送信息中可直接提取第一字符串 { "nick":"自选股 " } 。
302、 将所述第一字符串转化为第一多个二进制数进行存储。
一个实施例中, 将所述第一字符串转化为第一多个二进制数进行存 储的具体实现方法可以如图 4所示。 该方法可以包括以下步骤。
3021、 将所述待加密的第一字符串转化为第二字符串。
一个实施例中, 所述第二字符串中的每个字符对应一个字节。
在 WEB服务中, 信息以字符串形式进行存放, 可能会包含英文字 母、 英文符号、 中文汉字、 中文符号等信息, 而单个中文字符大多为多 字节字符。 例如, 单个中文字符对应的编码数值需要占用超过一个字节 的存储空间。
步骤 3021 的转化目的在于将对应的编码数值需要占用超过一个字 节的存储空间的字符转化为若干个对应的编码数值只占用一个字节的 存储空间的字符, 以便后续加密处理。
例如, 在 Javascript中, 第一字符串可以以 Unicode编码存放, 可使 用 UTF-8编码方式将第一字符串转化为第二字符串。 例如, 第一字符串 为" nick":"自选股", 则对应的第二字符串为' 'ηΰ ":" :]: €%。 , ί "。 上述编 码方式仅仅是例子, 其它实施例可以采用其它可行的编码方式, 这里不 做限定。
3022、 将所述第二字符串转化为第一字符数组。
其中, 所述第一字符数组中的一个元素对应第二字符串中的一个字 符的单字节编码数值。
在本实施例中, 由于在步骤 303之前执行了步骤 302, 在步骤 303 中, 直接确定每个字符对应的编码数值即可。
例如,将所述第二字符串转化为第一字符数组可以遵循 ACSII码表, 例如, 第二字符串为 "ηΰ ":" :1: €%。 , ί" , 则对应的第一字符数组为 [123, 34, 110, 105, 99, 107, 34, 58, 34, 232, 135, 170, 233, 128, 137, 232, 130, 161, 34, 125]。
3023、 按照预设值, 将所述第一字符数组内的元素分割成若干个数 组块。
其中, 每个数组块包括预设数量个元素。
其中, 预设值为自然数, 可根据实际需要进行设定, 可以将字符数 组内的所有元素按照预设数量进行分块处理, 每个数组块具有预设数量 个元素。
以预设数量为 4为例, 则将所述字符数组内的元素分割成若干个数 组块具体可以包括: 按照所述第一字符数组内的元素排列顺序, 依次将 相邻的 4个元素划分为一个数组块。
3024、 将每个数组块中的元素分别转化成 8位二进制数, 并将每个 数组块对应的多个 8位二进制数进行存储。
以预设数量为 4为例, 将每个数组块中的元素分别转化成 8位二进 制数, 并将每个数组块对应的多个 8位二进制数进行存储可以包括: 将每个数组块内的 4个元素分别转化为 8位二进制数, 并将每个数 组块对应的 4个 8位二进制数合并为 1个 32位二进制数。 将所述每个 数组块对应的一个 32位二进制数进行存储。
303、 按照预设的加密算法对已存储的第一多个二进制数进行加密, 生成第二多个二进制数。
其中, 预设加密算法可以包括 TEA、 MD5等目前 WEB服务中常用 的加密算法。 在各实施例中, 不同业务类型待发送信息的使用的加密算 法也可以不同。
304、 将所述第二多个二进制数转化为待发送字符串。
图 5为所述将所述第二多个二进制数转化为待发送字符串的方法。 该方法可以包括以下步骤。
3041、 将第二多个二进制数的每 8个相邻的二进制数转化为一个单 字节编码数值, 生成第二字符数组。
例如, 在本实施例中, 若在步骤 3021中的第一字符数组为 [123, 34, 110, 105, 99, 107, 34, 58, 34, 232, 135, 170, 233, 128, 137, 232, 130, 161, 34, 125] , 则经过步骤 3041可得到对应的第二字符数组为 [234, 109, 33, 119, 105, 146, 35, 0, 147, 240, 52, 189, 187, 172, 109, 20, 182, 48, 131, 71, 255, 98, 83, 140, 113, 228, 59, 246, 232, 150, 55, 180 ]。
3042、 将第二字符数组转化为待发送字符串。
其中, 所述第二字符数组中的一个元素对应待发送字符串中的一个 字符的单字节编码数值。
其中, 所述第二字符数组中的一个元素对应待发送字符串中的一个 字符的单字节编码数值。
其中, 所述将第二字符数组转化为待发送字符串可以遵循 ACSII码 表。
例如,在本实施例中,若第二字符数组为 [234, 109, 33, 119, 105, 146, 35,0,147,240,52,189,187,172,109,20,182,48,131,71,255,98,83,140,113,228, 59,246,232,150,55,180] , 则其对应的待发送字符串为 " e m!wi' #"。
305、 将所述待发送字符串进行传输编码并发送编码结果。
为方便 HTTP或 HTTPs的传输方式,在本实施例中通过步骤 305将 所述待发送字符串进行传输编码。
在本实施例中, 将所述待发送字符串进行传输编码可遵循 BASE64 编码方式, 例如, 若待发送三字符串为 " § m!wi, #" , 则对应的编码结 果为 6m0hd2mSIwCT8DS9u6xtFLYwg0f/YlOMceQ79uiWN7Q=。
图 6为本发明实施例的一种通信的解密的方法。 该方法为解密模块 侧的方法, 可以包括以下步骤。
601、 接收发送端发送的待处理信息。
其中, 所述待处理信息即为加密模块发送过来的加密信息。
602、 将所述待处理信息进行传输解码, 得到第一字符串。
将所述待处理信息进行传输解码, 得到第一字符串需要遵循加密模 块使用的传输编码方式。 加密模块和解密模块这两侧之间使用的各类加 解密算法和编解码方式可以原先匹配好, 也可以及时通信告知, 本发明 实施例对此不进行限制。
以 BASE63 编码方 式 为 例 , 若所述待处理信 息 为 6m0hd2mSIwCT8DS9u6xtFLYwg0fmOMceQ79uiWN7Q= , 则对应的第 一字符串为 " § m!wi, #"。
603、 将所述第一字符串转化为第一多个二进制数进行存储。
图 7为所述将所述第一字符串转化为第一多个二进制数进行存储的 实现方法。 该方法可以包括以下步骤。
6031、 将所述待解密的第一字符串转化为第一字符数组。
其中, 所述第一字符数组中的一个元素对应第三字符串中的一个字 符的单字节编码数值。
例如, 将所述第一字符串转化为第一字符数组可遵循 ACSII码表, 若第一字符串为 " § m!wi, # ",则对应的第二字符数组为 [234, 109, 33, 119. 105, 146, 35, 0, 147, 240, 52, 189, 187, 172, 109, 20, 182, 48, 131, 71, 255, 98, 83, 140, 113, 228, 59, 246, 232, 150, 55, 180]。
6032、按照预设值,将所述字符数组内的元素分割成若干个数组块。 一个实施例中, 每个数组块包括预设数量的元素。
预设数量可以与加密模块的设置相同。
例如, 预设数量为 4时, 将所述字符数组内的元素分割成若干个数 组块具体可以包括: 按照所述第一字符数组内的元素排列顺序, 依次将 相邻的 4个元素划分为一个数组块。
6033、 将每个数组块中的元素分别转化成 8位二进制数, 并将每个 数组块对应的多个 8位二进制数进行存储。
例如, 预设数量为 4, 则将每个数组块中的元素分别转化成 8位二 进制数, 并将每个数组块对应的多个 8位二进制数进行存储可以包括: 将每个数组块内的 4个元素分别转化为 8位二进制数, 并将每个数 组块对应的 4个 8位二进制数合并为 1个 32位二进制数。 将所述每个 数组块对应的一个 32位二进制数进行存储。
604、按照预设解密算法对已存储的第一多个二进制数进行解密, 生 成第二多个二进制数。
其中, 预设解密算法应与加密模块侧设置的加密算法相对应。
605、 将所述第二多个二进制数转化为第二字符串。
图 8为将所述第二多个二进制数转化为第二字符串的方法。 该方法 可以包括以下步骤。
6051、 将第二多个二进制数的每 8个相邻的二进制数转化为一个单 字节编码数值, 生成第二字符数组。
例如,若在步骤 3031中的第一字符数组为 [234, 109, 33, 119, 105, 146 35, 0, 147, 240, 52, 189, 187, 172, 109, 20, 182, 48, 131, 71, 255, 98, 83, 140, 113, 228, 59, 246, 232, 150, 55, 180 ] , 则经过步骤 6051可得到对应 的第二字符数组为 [123, 34, 110, 105,99,107, 34, 58, 34, 232, 135, 170, 233. 128, 137,232,130,161,34,125]。
6052、 将第二字符数组转化为第二字符串。
其中, 所述第二字符数组中的一个元素对应所述第二字符串中的一 个字符的单字节编码数值。 一个实施例中, 将所述第二字符数组转化为第二字符串可以遵循
ACSII码表, 例如, 若第二字符数组为 [123, 34, 110, 105, 99, 107, 34, 58, 34, 232, 135, 170, 233, 128,137,232,130,161,34,125] , 则第二字符串为 ''nick'':'' :j: €%。 , 。
606、 将所述第二字符串转化为所述待处理信息的源信息。
一个实施例中, 可以将每个字符对应一个字节的第二字符串转化为 Unicode编码进行存放。 步骤 606的转化方法可以遵循 UTF-8编码。 例 如, 若第二字符串为' 'ηΰ ":" :]: €%。 , ί" , 则对应的所述待处理信息对应 的源信息为" nick":"自选股", 并可以将" nick":"自选股 "以 JSON形式存储 起来。
以上加密和解密方法中所使用的字符编码方式可以是任意合适的编 码方法, 上面例子中使用的编码方式仅是示例, 可以替换为其它编码方 式。
本发明实施例提供了一种通信的加密和解密的方法, 通过将待发送 信息转化为二进制数进行存储, 然后对存储信息进行加密或解密处理, 再将加密结果或解密结果导出并转化为字符串使用, 从而实现加密和解 密的流程。 本发明实施例通过对将待发送信息转化为二进制数进行存 储, 为加密算法提供了二进制格式的信息, 使得各种加密算法也可以使 用在 Javascript语言环境中。 根据 WEB服务的具体需要, 使用不同的加 密算法, 保证了在 javascript环境下用户信息的安全。
图 9为本发明实施例提供的一种通信的加密的装置 90。 该装置可以 包括: 提取单元 91、 转化单元 92、 加密单元 93、 编码单元 94、 发送单 元 95。
提取单元 91 , 用于从待发送信息中提取待加密的第一字符串。
转化单元 92, 用于将所述提取单元 91得到的第一字符串转化为第 一多个二进制数进行存储。
加密单元 93 , 用于按照预设加密算法对已存储的第一多个二进制数 进行加密, 生成第二多个二进制数。
所述转化单元 92, 还用于将所述第二多个二进制数转化为待发送字 付 。
编码单元 94, 用于将所述转化单元 92生成的待发送字符串进行传 输编码。
发送单元 95 , 用于发送所述编码单元生成的编码结果。
一个实施例中, 如图 10所示, 所述转化单元 92可以包括: 第一转 化模块 921、 第二转化模块 922、 分割模块 923、 第三转化模块 924、 存 储模块 925。
第一转化模块 921 , 用于将所述待加密第一字符串转化为第二字符 串; 其中, 所述第二字符串中的每个字符对应一个字节。
第二转化模块 922, 用于将所述第一转化模块 921得到的第二字符 串转化为第一字符数组; 其中, 所述第一字符数组中的一个元素对应第 二字符串中的一个字符的单字节编码数值。
分割模块 923 , 用于将所述第二转化模块 922得到的字符数组内的 元素分割成若干个数组块; 其中, 每个数组块包括预设数量的元素。
第三转化模块 924, 用于将分割模块 923得到每个数组块中的元素 分别转化成 8位二进制数。
存储模块 925 , 用于将第三转化模块 923得到的每个数组块对应的 多个 8位二进制数进行存储。
例如,预设数量为 4时, 所述分割模块 92可以按照所述第一字符数 组内的元素排列顺序, 依次将相邻的 4个元素划分为一个数组块。
所述第三转化模块 794, 用于将每个数组块内的 4个元素分别转化 为 8位二进制数, 并将每个数组块对应的 4个 8位二进制数合并为 1个 32位二进制数。
所述存储模块 925 , 用于将所述每个数组块对应的一个 32位二进制 数进行存储。
一个实施例中, 如图 11所示, 所述转化单元 92包括: 第四转化模 块 926、 第五转化模块 927。
第四转化模块 926, 用于将第二多个二进制数的每 8个相邻的二进 制数转化为一个单字节编码数值, 生成第二字符数组。
第五转化模块 927, 用于将所述第四转化模块 926得到的第二字符 数组转化为待发送字符串; 其中, 所述第二字符数组中的一个元素对应 待发送字符串中的一个字符的单字节编码数值。
图 12为本发明实施例提供的一种通信的解密的装置 120。该装置 120 可以包括:
接收单元 1201 , 用于接收发送端发送的待处理信息;
解码单元 1202, 用于将所述接收单元 1201接收的待处理信息进行 传输解码, 得到第一字符串;
转化单元 1203 , 用于将所述第一字符串转化为第一多个二进制数进 行存储;
解密单元 1204, 用于按照预设解密算法对已存储的第一多个二进制 数进行解密, 生成第二多个二进制数;
所述转化单元 1203 , 还用于将所述第二多个二进制数转化为第二字 付 。
一个实施例中, 如图 13所示, 所述转化单元 1203可以包括: 第一转化模块 1231 , 用于将所述待解密的第一字符串转化为第一字 符数组; 其中, 所述第一字符数组中的一个元素对应第三字符串中的一 个字符的单字节编码数值。
分割模块 1232, 用于按照预设值, 将所述第一转化模块得到的字符 数组内的元素分割成若干个数组块; 其中, 每个数组块包括预设值数量 的元素。
第二转化模块 1233 , 用于将每个数组块中的元素分别转化成 8位二 进制数。
存储模块 1234, 用于将每个数组块对应的多个 8位二进制数进行存 储。
一个实施例中,所述分割模块 1232用于按照所述第一字符数组内的 元素排列情况, 依次将相邻的 4个元素划分为一个数组块。
所述第二转化模块 1233 , 用于将每个数组块内的 4个元素分别转化 为 8位二进制数, 并将每个数组块对应的 4个 8位二进制数合并为 1个 32位二进制数。
所述存储模块 1234, 用于将所述每个数组块对应的一个 32位二进 制数进行存储。
一个实施例中, 如图 16所示, 所述转化单元 1203包括: 第三转化 模块 1235、 第四转化模块 1236。
第三转化模块 1235 , 用于将第二多个二进制数的每 8个相邻的二进 制数转化为一个单字节编码数值, 生成第二字符数组。
第四转化模块 1236, 用于将所述第三转化模块 1235得到的第二字 符数组转化为第二字符串; 其中, 所述第二字符数组中的一个元素对应 所述第二字符串中的一个字符的单字节编码数值。
图 14为本发明实施例提供的一种通信的加密和解密的系统。该系统 可以包括上述通信的加密的装置 90和通信的解密的装置 120。
本发明实施例提供了一种通信的加密和解密的装置及系统, 通过将 待发送信息转化为二进制数进行存储, 然后对存储信息进行加密或解密 处理, 再将加密结果或解密结果导出并转化为字符串使用, 从而实现加 密和解密的流程。 本发明实施例通过对将待发送信息转化为二进制数进 行存储, 为加密算法提供了二进制格式的信息, 使得各种加密算法可以 使用在 Javascript语言环境中, 保证了在 javascript环境下用户信息的安 全。
需要说明的是, 上述各流程和各结构图中不是所有的步骤和模块都 是必须的, 可以根据实际的需要忽略某些步骤或模块。 各步骤的执行顺 序不是固定的, 可以根据需要进行调整。 各模块的划分仅仅是为了便于 描述采用的功能上的划分, 实际实现时, 一个模块可以分由多个模块实 现, 多个模块的功能也可以由同一个模块实现, 这些模块可以位于同一 个设备中, 也可以位于不同的设备中。 另外, 上面描述中采用 "第一"、 "第二" 仅仅为了方便区分具有同一含义的两个对象, 并不表示其有实 质的区别。
各实施例中的硬件模块可以以机械方式或电子方式实现。 例如, 一 器, 如 FPGA或 ASIC )用于完成特定的操作。 硬件模块也可以包括由 软件临时配置的可编程逻辑器件或电路(如包括通用处理器或其它可编 程处理器)用于执行特定操作。 至于具体采用机械方式, 或是采用专用 的永久性电路, 或是采用临时配置的电路(如由软件进行配置)来实现 硬件模块, 可以根据成本和时间上的考虑来决定。
本发明还提供了一种机器可读的存储介质, 存储用于使一机器(可 以是个人计算机, 服务器, 或者网络设备等)执行如本文所述方法的指 令。 具体地, 可以提供配有存储介质的系统或者装置, 在该存储介质上 存储着实现上述实施例中任一实施例的功能的软件程序代码, 且使该系 统或者装置的计算机(或 CPU或 MPU )读出并执行存储在存储介质中 的程序代码。 此外, 还可以通过基于程序代码的指令使计算机上操作的 操作系统等来完成部分或者全部的实际操作。 还可以将从存储介质读出 的程序代码写到插入计算机内的扩展板中所设置的存储器中或者写到 与计算机相连接的扩展单元中设置的存储器中, 随后基于程序代码的指 令使安装在扩展板或者扩展单元上的 CPU等来执行部分和全部实际操 作, 从而实现上述实施例中任一实施例的功能。
用于提供程序代码的存储介质实施例包括软盘、 硬盘、 磁光盘、 光 盘(如 CD-ROM、 CD-R, CD-RW、 DVD-ROM、 DVD-RAM、 DVD-RW, DVD+RW ), 磁带、 非易失性存储卡和 ROM。 可选择地, 可以由通信网 络从服务器计算机上下载程序代码。
综上所述, 权利要求的范围不应局限于以上描述的例子中的实施方 式, 而应当将说明书作为一个整体并给予最宽泛的解释。

Claims

权利要求书
1、 一种通信的加密的方法, 其特征在于, 包括:
从待发送信息中提取待加密的第一字符串;
将所述第一字符串转化为第一多个二进制数进行存储;
按照预设加密算法对已存储的第一多个二进制数进行加密, 生成第 二多个二进制数;
将所述第二多个二进制数转化为待发送字符串;
将所述待发送字符串进行传输编码并发送编码结果。
2、根据权利要求 1所述的方法, 其特征在于, 所述将所述待加密字 符串转化为第一多个二进制数进行存储包括:
将所述待加密第一字符串转化为第二字符串; 其中, 所述第二字符 串中的每个字符对应一个字节;
将所述第二字符串转化为第一字符数组; 其中, 所述第一字符数组 中的一个元素对应第二字符串中的一个字符的单字节编码数值;
按照预设值,将所述字符数组内的元素分割成若干个数组块; 其中, 每个数组块包括预设值数量的元素;
将每个数组块中的元素分别转化成 8位二进制数, 并将每个数组块 对应的多个 8位二进制数进行存储。
3、 根据权利要求 2 所述的方法, 其特征在于, 当所述预设值为 4 时, 所述按照预设值, 将所述第一字符数组内的元素各自对应的单字节 编码数值分割成若干个数组块包括:
按照所述第一字符数组内的元素排列情况, 依次将相邻的 4个元素 划分为一个数组块;
则将每个数组块中的元素分别转化成 8位二进制数, 并将每个数组 块对应的多个 8位二进制数进行存储包括:
将每个数组块内的 4个元素分别转化为 8位二进制数, 并将每个数 组块对应的 4个 8位二进制数合并为 1个 32位二进制数;
将所述每个数组块对应的一个 32位二进制数进行存储。
4、根据权利要求 1所述的方法, 其特征在于, 所述将所述第二多个 二进制数转化为待发送字符串包括:
将第二多个二进制数的每 8个相邻的二进制数转化为一个单字节编 码数值, 生成第二字符数组;
将第二字符数组转化为待发送字符串; 其中, 所述第二字符数组中 的一个元素对应待发送字符串中的一个字符的单字节编码数值。
5、 一种通信的解密的方法, 其特征在于, 包括:
接收发送端发送的待处理信息;
将所述待处理信息进行传输解码, 得到第一字符串;
将所述第一字符串转化为第一多个二进制数进行存储;
按照预设解密算法对已存储的第一多个二进制数进行解密, 生成第 二多个二进制数;
将所述第二多个二进制数转化为第二字符串。
6、根据权利要求 5所述的方法, 其特征在于, 所述将所述第一字符 串转化为第一多个二进制数进行存储包括:
将所述待解密的第一字符串转化为第一字符数组; 其中, 所述第一 字符数组中的一个元素对应第三字符串中的一个字符的单字节编码数 值;
按照预设值,将所述字符数组内的元素分割成若干个数组块; 其中, 每个数组块包括预设值数量的元素;
将每个数组块中的元素分别转化成 8位二进制数, 并将每个数组块 对应的多个 8位二进制数进行存储。
7、 根据权利要求 6 所述的方法, 其特征在于, 当所述预设值为 4 时, 所述按照预设值, 将所述第一字符数组内的元素分割成若干个数组 块包括:
按照所述第一字符数组内的元素排列情况, 依次将相邻的 4个元素 划分为一个数组块;
则将每个数组块中的元素分别转化成 8位二进制数, 并将每个数组 块对应的多个 8位二进制数进行存储包括:
将每个数组块内的 4个元素分别转化为 8位二进制数, 并将每个数 组块对应的 4个 8位二进制数合并为 1个 32位二进制数;
将所述每个数组块对应的一个 32位二进制数进行存储。
8、根据权利要求 6所述的方法, 其特征在于, 所述将所述第二多个 二进制数转化为第二字符串包括:
将第二多个二进制数的每 8个相邻的二进制数转化为一个单字节编 码数值, 生成第二字符数组。
将第二字符数组转化为第二字符串; 其中, 所述第二字符数组中的 一个元素对应所述第二字符串中的一个字符的单字节编码数值。
9、 一种通信的加密的装置, 其特征在于, 包括:
提取单元, 用于从待发送信息中提取待加密的第一字符串; 转化单元, 用于将所述提取单元得到的第一字符串转化为第一多个 二进制数进行存储;
加密单元, 用于按照预设加密算法对已存储的第一多个二进制数进 行加密, 生成第二多个二进制数;
所述转化单元, 还用于将所述第二多个二进制数转化为待发送字符 串; 编码单元,用于将所述转化单元生成的待发送字符串进行传输编码; 发送单元, 用于发送所述编码单元生成的编码结果。
10、根据权利要求 9所述的装置, 其特征在于, 所述转化单元包括: 第一转化模块, 用于将所述待加密第一字符串转化为第二字符串; 其中, 所述第二字符串中的每个字符对应一个字节;
第二转化模块, 用于将所述第一转化模块得到的第二字符串转化为 第一字符数组; 其中, 所述第一字符数组中的一个元素对应第二字符串 中的一个字符的单字节编码数值;
分割模块, 用于按照预设值, 将所述第二转化模块得到的字符数组 内的元素分割成若干个数组块; 其中, 每个数组块包括预设值数量的元 素;
第三转化模块, 用于将分割模块得到每个数组块中的元素分别转化 成 8位二进制数;
存储模块, 用于将第三转化模块得到的每个数组块对应的多个 8位 二进制数进行存储。
11、根据权利要求 10所述的方法, 其特征在于, 所述分割模块用于 在所述预设值为 4时, 按照所述第一字符数组内的元素排列情况, 依次 将相邻的 4个元素划分为一个数组块;
所述第三转化模块, 用于将每个数组块内的 4个元素分别转化为 8 位二进制数, 并将每个数组块对应的 4个 8位二进制数合并为 1个 32 位二进制数;
所述存储模块,用于将所述每个数组块对应的一个 32位二进制数进 行存储。
12、根据权利要求 9所述的装置, 其特征在于, 所述转化单元包括: 第四转化模块, 用于将第二多个二进制数的每 8个相邻的二进制数 转化为一个单字节编码数值, 生成第二字符数组;
第五转化模块, 用于将所述第四转化模块得到的第二字符数组转化 为待发送字符串; 其中, 所述第二字符数组中的一个元素对应待发送字 符串中的一个字符的单字节编码数值。
13、 一种通信的解密的装置, 其特征在于, 包括:
接收单元, 用于接收发送端发送的待处理信息;
解码单元, 用于将所述接收单元接收的待处理信息进行传输解码, 得到第一字符串;
转化单元, 用于将所述第一字符串转化为第一多个二进制数进行存 储;
解密单元, 用于按照预设解密算法对已存储的第一多个二进制数进 行解密, 生成第二多个二进制数;
所述转化单元,还用于将所述第二多个二进制数转化为第二字符串。
14、 根据权利要求 13的装置, 其特征在于, 所述转化单元包括: 第一转化模块, 用于将所述待解密的第一字符串转化为第一字符数 组; 其中, 所述第一字符数组中的一个元素对应第三字符串中的一个字 符的单字节编码数值;
分割模块, 用于按照预设值, 将所述第一转化模块得到的字符数组 内的元素分割成若干个数组块; 其中, 每个数组块包括预设值数量的元 素;
第二转化模块, 用于将每个数组块中的元素分别转化成 8位二进制 数;
存储模块, 用于将每个数组块对应的多个 8位二进制数进行存储。
15、根据权利要求 14所述的装置, 其特征在于, 所述分割模块用于 按照所述第一字符数组内的元素排列情况, 依次将相邻的 4个元素划分 为一个数组块;
所述第二转化模块, 用于将每个数组块内的 4个元素分别转化为 8 位二进制数, 并将每个数组块对应的 4个 8位二进制数合并为 1个 32 位二进制数;
所述存储模块,用于将所述每个数组块对应的一个 32位二进制数进 行存储。
16、根据权利要求 13所述的装置,其特征在于,所述转化单元包括: 第三转化模块, 用于将第二多个二进制数的每 8个相邻的二进制数 转化为一个单字节编码数值, 生成第二字符数组。
第四转化模块, 用于将所述第三转化模块得到的第二字符数组转化 为第二字符串; 其中, 所述第二字符数组中的一个元素对应所述第二字 符串中的一个字符的单字节编码数值。
17、 一种通信的加密和解密的系统, 其特征在于, 包括如权利要求 9-12任意一项所述的通信的加密装置和如权利要求 13-16任意一项所述 的通信的解密的装置。
PCT/CN2013/083291 2012-09-24 2013-09-11 通信的加密和解密的方法、装置及系统 Ceased WO2014044137A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/430,837 US20150244521A1 (en) 2012-09-24 2013-09-11 Communication encryption and decryption method, device and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210358087.0A CN103684760B (zh) 2012-09-24 2012-09-24 通信的加密和解密的方法、装置及系统
CN201210358087.0 2012-09-24

Publications (1)

Publication Number Publication Date
WO2014044137A1 true WO2014044137A1 (zh) 2014-03-27

Family

ID=50321158

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/083291 Ceased WO2014044137A1 (zh) 2012-09-24 2013-09-11 通信的加密和解密的方法、装置及系统

Country Status (3)

Country Link
US (1) US20150244521A1 (zh)
CN (1) CN103684760B (zh)
WO (1) WO2014044137A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3337200A4 (en) * 2015-08-13 2019-01-23 Alibaba Group Holding Limited BRIEF MESSAGE TRANSMISSION AND RECEIVING METHOD AND APPARATUS
CN111931205A (zh) * 2020-07-24 2020-11-13 北京沃东天骏信息技术有限公司 一种加密着色器文件的方法和装置
CN112910568A (zh) * 2021-01-18 2021-06-04 猫岐智能科技(上海)有限公司 一种数据通信方法、数据发送方法及数据接收方法
CN116366249A (zh) * 2023-06-01 2023-06-30 广东维信智联科技有限公司 一种基于数字信息的交互通信系统
CN118349692A (zh) * 2024-04-10 2024-07-16 重庆师范大学 一种海量视觉大数据图像处理方法

Families Citing this family (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105099652B (zh) * 2014-05-04 2018-01-16 博雅网络游戏开发(深圳)有限公司 数据加密、解密方法和装置
CN105468987A (zh) * 2014-08-15 2016-04-06 中兴通讯股份有限公司 一种数据处理方法及装置
CN106160877B (zh) * 2016-06-17 2018-10-16 深圳大学 光纤传输系统的跨层加密方法及系统
CN106130717B (zh) * 2016-06-23 2019-05-28 浪潮(北京)电子信息产业有限公司 一种文件存储解密方法及装置
CN106375083B (zh) * 2016-09-30 2019-10-01 广东网金控股股份有限公司 一种基于Base64的加解密方法及其装置
CN107066116B (zh) * 2017-04-13 2021-07-30 海信视像科技股份有限公司 字符串生成方法、字符解析方法及装置
CN108494742B (zh) * 2018-03-05 2023-10-27 杭州泰酷科技有限公司 一种应用于浏览器的web数据加密传输方式
CN110634202A (zh) * 2018-06-21 2019-12-31 云泊科技(广州)有限公司 一种车位共享装置及车位共享方法
CN109146712A (zh) * 2018-08-10 2019-01-04 四川广聚其力电子科技有限公司 一种建设工程混凝土标养同养试块智能管理方法及系统
CN111064560B (zh) * 2018-10-17 2023-07-18 千寻位置网络有限公司 数据加密传输方法及装置、终端、数据加密传输系统
CN109361399A (zh) * 2018-10-19 2019-02-19 上海达梦数据库有限公司 一种获取字节序列的方法、装置、设备及存储介质
CN110149631B (zh) * 2019-05-29 2023-06-13 飞天诚信科技股份有限公司 一种适用于云音箱建立连接的方法及系统
CN112286674B (zh) * 2019-07-24 2023-12-19 广东知业科技有限公司 一种基于边缘计算的行转列方法及系统
CN112399027B (zh) * 2019-08-14 2023-12-05 北京京东振世信息技术有限公司 图片加解密方法及装置、存储介质及电子设备
CN110569487B (zh) * 2019-08-19 2023-07-18 积成电子股份有限公司 一种基于高频率字符替代算法的Base64扩展编码方法及系统
CN110768785B (zh) * 2019-10-22 2023-05-02 宜人恒业科技发展(北京)有限公司 一种编、解码方法、相关装置及计算机设备
CN111832067B (zh) * 2020-05-26 2021-12-17 华控清交信息科技(北京)有限公司 一种数据处理方法、装置和用于数据处理的装置
CN114244563A (zh) * 2021-11-15 2022-03-25 珠海许继芝电网自动化有限公司 基于aes加密的前后端跨语言通讯方法及系统
CN115396092B (zh) * 2022-08-26 2023-09-12 河南天一智能信息有限公司 一种智能心功能治疗系统的数据管理方法
CN115766702A (zh) * 2022-10-18 2023-03-07 中国人民解放军陆军军医大学 基于二维码的文件传输方法及传输系统
CN116244720A (zh) * 2023-01-05 2023-06-09 浙江诺诺网络科技有限公司 一种信息数据处理方法、装置、设备及存储介质
CN116455599B (zh) * 2023-03-02 2025-12-23 广州正虹环境科技有限公司 一种应用于餐饮设备的数据传输方法、系统及电子设备
CN118674131B (zh) * 2024-08-26 2024-12-24 山东航宇游艇发展有限公司 基于数字孪生的智慧船舶信息优化管理方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560823A (zh) * 2004-02-19 2005-01-05 李春林 基于动态变长码的数据加密与解密系统
CN1878059A (zh) * 2006-07-07 2006-12-13 北京财富投资有限公司 一种分组加密及解密算法
CN101360101A (zh) * 2008-09-09 2009-02-04 宁波三星电气股份有限公司 远程抄表系统的数据传输方法
JP2010164897A (ja) * 2009-01-19 2010-07-29 Nippon Telegr & Teleph Corp <Ntt> 暗号化数値二進変換システム、暗号化数値二進変換方法、暗号化数値二進変換プログラム

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5515451A (en) * 1992-01-08 1996-05-07 Fuji Xerox Co., Ltd. Image processing system for selectively reproducing documents
US6490684B1 (en) * 1998-03-31 2002-12-03 Acuson Corporation Ultrasound method and system for enabling an ultrasound device feature
US8290160B1 (en) * 2001-10-17 2012-10-16 Appalachian Technologies Corporation of Pennsylvania Method and apparatus for secured facsimile transmission
US20030152145A1 (en) * 2001-11-15 2003-08-14 Kevin Kawakita Crash prevention recorder (CPR)/video-flight data recorder (V-FDR)/cockpit-cabin voice recorder for light aircraft with an add-on option for large commercial jets
US7590837B2 (en) * 2003-08-23 2009-09-15 Softex Incorporated Electronic device security and tracking system and method
US7441185B2 (en) * 2005-01-25 2008-10-21 Microsoft Corporation Method and system for binary serialization of documents
CN1988441A (zh) * 2005-12-21 2007-06-27 中国银联股份有限公司 数据安全传输的方法
WO2008155779A2 (en) * 2007-06-20 2008-12-24 Sanjeev Krishnan A method and apparatus for software simulation
CN102170479B (zh) * 2011-05-21 2013-12-18 华为数字技术(成都)有限公司 Web缓存的更新方法及Web缓存的更新装置
CN102685108B (zh) * 2012-03-31 2015-11-11 北京奇虎科技有限公司 网页加密数据的添加、解密方法及装置
ES2606602T3 (es) * 2012-08-02 2017-03-24 Banco Bilbao Vizcaya Argentaria, S.A. Método para la generación de un código, método y sistema de autorización de una operación
US9237014B2 (en) * 2013-05-28 2016-01-12 Hong Kong Applied Science & Technology Research Institute Company, Limited Partial CipherText updates using variable-length segments delineated by pattern matching and encrypted by fixed-length blocks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560823A (zh) * 2004-02-19 2005-01-05 李春林 基于动态变长码的数据加密与解密系统
CN1878059A (zh) * 2006-07-07 2006-12-13 北京财富投资有限公司 一种分组加密及解密算法
CN101360101A (zh) * 2008-09-09 2009-02-04 宁波三星电气股份有限公司 远程抄表系统的数据传输方法
JP2010164897A (ja) * 2009-01-19 2010-07-29 Nippon Telegr & Teleph Corp <Ntt> 暗号化数値二進変換システム、暗号化数値二進変換方法、暗号化数値二進変換プログラム

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3337200A4 (en) * 2015-08-13 2019-01-23 Alibaba Group Holding Limited BRIEF MESSAGE TRANSMISSION AND RECEIVING METHOD AND APPARATUS
CN111931205A (zh) * 2020-07-24 2020-11-13 北京沃东天骏信息技术有限公司 一种加密着色器文件的方法和装置
CN112910568A (zh) * 2021-01-18 2021-06-04 猫岐智能科技(上海)有限公司 一种数据通信方法、数据发送方法及数据接收方法
CN116366249A (zh) * 2023-06-01 2023-06-30 广东维信智联科技有限公司 一种基于数字信息的交互通信系统
CN116366249B (zh) * 2023-06-01 2023-11-03 广东维信智联科技有限公司 一种基于数字信息的交互通信系统
CN118349692A (zh) * 2024-04-10 2024-07-16 重庆师范大学 一种海量视觉大数据图像处理方法

Also Published As

Publication number Publication date
CN103684760A (zh) 2014-03-26
US20150244521A1 (en) 2015-08-27
CN103684760B (zh) 2018-12-07

Similar Documents

Publication Publication Date Title
WO2014044137A1 (zh) 通信的加密和解密的方法、装置及系统
EP3553995B1 (en) Terminal device for performing homomorphic encryption, server device for processing cipher text thereof, and methods therefor
CN109150499B (zh) 动态加密数据的方法、装置、计算机设备和存储介质
US8909933B2 (en) Decoupled cryptographic schemes using a visual channel
US10250573B2 (en) Leveraging transport-layer cryptographic material
CN101349968B (zh) 加速伽罗瓦计数器模式(gcm)计算
US11405371B2 (en) Methods and systems for biological sequence compression transfer and encryption
US10055591B1 (en) Secure protocol attack mitigation
CN111832056B (zh) 用于生成二维码的方法和系统
CN103795525A (zh) 数据加密的方法
CN112055004A (zh) 一种基于小程序的数据处理方法和系统
JP6974461B2 (ja) 幾何代数を用いた高度データ中心型暗号化システムのための方法およびシステム
US10142301B1 (en) Encrypted data delivery without intervening decryption
CN113259438B (zh) 模型文件的发送方法和装置及模型文件的接收方法和装置
CN110912682A (zh) 数据处理方法、装置及系统
CN113422832B (zh) 文件传输方法、装置、设备和存储介质
CN103281193A (zh) 身份认证方法、系统及基于其的数据传输方法、装置
KR20220121221A (ko) 동형 암호문의 변환 장치 및 방법
CN100589390C (zh) 一种认证方法和认证系统
CN104394144A (zh) 一种云存储医疗数据的安全传输方法
US12200105B1 (en) Asymmetric computer-implemented storage cryptography
CN113890759B (zh) 文件传输方法、装置、电子设备和存储介质
US11108552B1 (en) Data encryption method and system
CN117951720A (zh) 前端加密方法、装置、电子设备及存储介质
CN108270546A (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: 13839536

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 14430837

Country of ref document: US

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 17.08.2015)

122 Ep: pct application non-entry in european phase

Ref document number: 13839536

Country of ref document: EP

Kind code of ref document: A1