WO2015127737A1 - 一种数据加密解密方法、装置以及终端 - Google Patents

一种数据加密解密方法、装置以及终端 Download PDF

Info

Publication number
WO2015127737A1
WO2015127737A1 PCT/CN2014/080999 CN2014080999W WO2015127737A1 WO 2015127737 A1 WO2015127737 A1 WO 2015127737A1 CN 2014080999 W CN2014080999 W CN 2014080999W WO 2015127737 A1 WO2015127737 A1 WO 2015127737A1
Authority
WO
WIPO (PCT)
Prior art keywords
key
user
data
password
symmetric
Prior art date
Application number
PCT/CN2014/080999
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 WO2015127737A1 publication Critical patent/WO2015127737A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/045Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply hybrid encryption, i.e. combination of symmetric and asymmetric encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/062Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00 applying encryption of the keys

Definitions

  • the present invention relates to the field of information security, and in particular, to a data encryption and decryption method, apparatus, and terminal. Background technique
  • the process is: according to the user preset password, encrypt the data that needs to be encrypted, when the user wants to view the encrypted data, enter the password, and the mobile terminal verifies the password input by the user, when the verification is passed After that, the encrypted data is displayed for the user to view.
  • the process is as follows: The user receives the short message, and the privacy space application judges that the short message is sent by the privacy contact, and the encrypted message is stored in the database, and the short message is deleted from the system database.
  • the privacy space verifies the password entered by the user.
  • the encrypted data is displayed for the user to view.
  • a disadvantage of the prior art is that the mobile terminal must save the key used to encrypt the data locally. This is because when a private contact calls and comes to a text message, the mobile terminal must "automatically" (do not ask the user for a password) using a stored key locally through a symmetric encryption algorithm for privacy. Call history and privacy messages are encrypted and saved. However, since the key used for encryption is stored locally, it is easy for an illegal user to obtain a key by using a decompilation method, thereby obtaining the user's private data, so the user's private data, especially the privacy call record and the privacy message are unsafe. Summary of the invention
  • the present invention provides a data encryption and decryption method, apparatus, and terminal.
  • an embodiment of the present invention provides a data encryption method, which is used in a terminal, where the method includes:
  • the randomly generating the asymmetric key when setting the privacy password of the user includes: encrypting the private key in the asymmetric key by using a symmetric encryption algorithm of the user as a key to obtain a second ciphertext;
  • the obtaining, by the first irreversible algorithm, the first character string from the user's privacy password further includes:
  • an embodiment of the present invention provides a data decryption method, which is used in a terminal, where the method includes:
  • the pre-stored second ciphertext is decrypted by using the privacy password to obtain a private key of the asymmetric key;
  • the pre-stored first ciphertext is decrypted by using the decrypted private key to obtain a symmetric key; and the plaintext of the encrypted data is obtained according to the decrypted symmetric key.
  • the verifying the password entered by the user includes:
  • Extracting a second character string from the input privacy password by a first irreversible algorithm comparing the second character string with a pre-stored first one extracted from the initially set user privacy password by a first irreversible algorithm If the character string is consistent, a judgment result is obtained; if the judgment result indicates that the second character string is consistent with the first character string, it indicates that the privacy password input by the user passes the verification.
  • the method further includes:
  • the CRC32 check code string and the Adler32 check code string are concatenated to obtain a second character string.
  • an embodiment of the present invention provides a data encryption apparatus, which is used in a terminal, where the apparatus includes:
  • the first processing module is configured to randomly generate an asymmetric key when setting a privacy password of the user; and the acquiring module is configured to obtain a symmetric key randomly generated when the data to be encrypted is obtained;
  • An encryption module configured to use a symmetrically generated symmetric key to treat the addition using a symmetric encryption algorithm
  • the encrypted data is encrypted and calculated to obtain encrypted data
  • a second processing module configured to use an asymmetric key to encrypt the symmetric key by using an asymmetric encryption algorithm to obtain a first ciphertext corresponding to the symmetric key; and the storage module is configured to Recording the first ciphertext and the encrypted data.
  • the first processing module is further configured to:
  • the private key in the asymmetric key is encrypted by the symmetric encryption algorithm using the user's private password as a key to obtain a second ciphertext;
  • the first processing module, the obtaining module, the cryptographic module, the second processing module, and the storage module may use a central processing unit (CPU) and digital signal processing when performing processing.
  • CPU central processing unit
  • DSP Digital Singnal Processor
  • FPGA Programmable Array
  • an embodiment of the present invention provides a data decryption apparatus, which is used in a terminal, where the apparatus includes:
  • a verification unit configured to verify a privacy password entered by the user
  • a first processing unit configured to decrypt the pre-stored second ciphertext by using the privacy password to obtain a private key of the asymmetric key
  • a second processing unit configured to decrypt the pre-stored first ciphertext by using the decrypted private key to obtain a symmetric key
  • the decryption unit is configured to obtain the plaintext of the encrypted data according to the decrypted symmetric key.
  • the verification unit is further configured to:
  • Extracting a second character string from the input privacy password by a first irreversible algorithm comparing the second character string with a pre-stored first through the first irreversible algorithm from the initial Whether the first character string extracted in the set user privacy password is consistent, and a judgment result is obtained; if the judgment result indicates that the second character string is consistent with the first character string, it indicates that the user input password is passed. verification.
  • the verification unit, the first processing unit, the second processing unit, and the decryption unit may use a central processing unit (CPU), a digital signal processor (DSP, Digital) when performing processing. Singnal Processor) or Field-Programmable Gate Array (FPGA).
  • CPU central processing unit
  • DSP digital signal processor
  • FPGA Field-Programmable Gate Array
  • a fifth aspect, the embodiment of the present invention provides a terminal, where the terminal is configured as:
  • An asymmetric key is randomly generated when the user's privacy password is set, the public key of the asymmetric encryption key is stored, and the private key in the asymmetric key is encrypted by a symmetric encryption algorithm using the user's private password as a key. Obtaining a ciphertext corresponding to the private key;
  • a symmetric key is randomly generated, and the symmetric data is used to encrypt the data to be encrypted, and the encrypted data is obtained by using a symmetric encryption algorithm;
  • the terminal is further configured to:
  • the pre-stored private key corresponding ciphertext is decrypted by using the private password to obtain a private key of the asymmetric key; and the pre-stored symmetric key corresponding ciphertext is performed by using the decrypted private key.
  • Decrypting obtaining a symmetric key; obtaining a plaintext of the encrypted data according to the decrypted symmetric key.
  • the data encryption and decryption method, device and terminal provided by the embodiments of the present invention solve the problem that the prior art stores the user's privacy key locally in the mobile phone and causes a security vulnerability.
  • the user key used for decryption Only exists in the user's mind, which ensures the security of the key.
  • the security of the privacy data is greatly improved.
  • the combination of the symmetric encryption and decryption algorithm and the asymmetric encryption and decryption algorithm improves the security of the encrypted data, and improves the encryption and decryption than the single asymmetric encryption and decryption algorithm. The speed of the calculation. DRAWINGS
  • 1 is a flow chart of an embodiment of a data encryption method
  • FIG. 2 is a flow chart of an embodiment of a data decryption method
  • FIG. 3 is a flow chart of generating a key in still another embodiment of a data encryption and decryption method
  • FIG. 4 is a flow chart of encryption in still another embodiment of a data encryption and decryption method
  • FIG. 5 is a flowchart of decryption in still another embodiment of a data encryption and decryption method
  • FIG. 6 is a schematic diagram of an embodiment of a data encryption device
  • FIG. 7 is a schematic diagram of an embodiment of a data decryption apparatus.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • the flow of the data encryption method is as shown in FIG. 1 , and is used in a terminal.
  • the method includes: Step 100: randomly generating an asymmetric key when setting a privacy password of the user;
  • Step 101 A symmetric key randomly generated when the data to be encrypted is obtained
  • Step 102 Encrypt the data to be encrypted by using the symmetric key, and obtain the encrypted data by using a symmetric encryption algorithm.
  • Step 103 Encrypt the symmetric key by using a public key of an asymmetric key to obtain a first ciphertext corresponding to the symmetric key;
  • Step 104 Record the encrypted data and the first ciphertext.
  • the symmetric encryption algorithm includes but not limited to: DES, AES, and triple DES; asymmetric encryption algorithms include but are not limited to: RSA and Elg; 1 terminals include but are not limited to: mobile terminals and desktop terminals.
  • the user key used for decryption only exists in the user's brain, thus ensuring the security of the key, thereby greatly improving the security of the private data; combining the symmetric encryption and decryption algorithm with the asymmetric encryption and decryption algorithm
  • the use of, while improving the security of the encrypted data, increases the speed of encryption and decryption calculations.
  • the step 102 specifically includes:
  • the data to be encrypted is encrypted by a symmetric encryption algorithm using the symmetric key to obtain encrypted data.
  • the step 103 specifically includes:
  • the symmetric key is encrypted and calculated by the asymmetric encryption algorithm by using the public key, and the first ciphertext corresponding to the symmetric key is obtained.
  • the existing terminal stores the password input by the user, and does not need to input a password in the process of encrypting the data, indicating that the password is stored in the mobile terminal, and some illegal users use the method of decompilation, which can be found.
  • the password itself, so as to peek into the user's encrypted data, causes the user's privacy to leak, and even brings unnecessary losses to the user. So the current way of encrypting data is not safe.
  • the step 100 specifically includes:
  • the private key in the asymmetric key is encrypted by a symmetric encryption algorithm to obtain a second ciphertext;
  • the password is only stored in the user's brain.
  • the terminal only performs irreversible calculation on the specific character string entered by the user and stores it, even if the illegal user obtains the specific character string, it cannot be decompiled.
  • the means obtains the password input by the user, avoids the leakage of the user's privacy caused by the illegal user peeping the encrypted data of the user, and greatly improves the security of the encrypted data of the user.
  • the MD5 algorithm is generally used for irreversible calculation, but the MD5 algorithm is more complicated, and each string calculation takes a long time, which increases the complexity and calculation time of the encryption calculation.
  • the CRC32 check code string and the Adler32 check code string are concatenated to obtain a first character string.
  • the first string may be a signature or a string obtained by other irreversible algorithms.
  • the embodiment further provides a data decryption method, and the flowchart of the data decryption method is as shown in FIG. 2, and the data decryption method is used for a terminal,
  • the methods include:
  • Step 200 Verify the privacy password entered by the user
  • Step 201 After the verification is passed, decrypting the pre-stored second ciphertext by using the privacy password to obtain a private key of the asymmetric key;
  • Step 202 Decrypt the pre-stored first ciphertext by using the decrypted private key to obtain a symmetric key.
  • Step 203 Obtain a plaintext of the encrypted data according to the decrypted symmetric key.
  • the step 200 specifically includes:
  • Extracting a second character string from the input privacy password by a first irreversible algorithm comparing the second character string with a pre-stored first one extracted from the initially set user privacy password by a first irreversible algorithm If the character string is consistent, a judgment result is obtained; if the judgment result indicates that the second character string is consistent with the first character string, it indicates that the privacy password input by the user passes the verification.
  • the CRC32 check code string and the Adler32 check code string are concatenated to obtain a second character string.
  • 101 is a privacy space password Key set by a user
  • 102 is a randomly generated pair of RSA asymmetric keys, the public key is PubKey, and the private key is PriKey
  • It is a local database of the mobile phone application
  • 104 is a ciphertext T obtained by encrypting the PriKey by AES symmetric encryption using Key as a key
  • 105 is a string S obtained by signing the Key.
  • 102 in PubKey, 102, and S in 105 are stored in 103.
  • the encryption process is shown in Figure 4: 201 is a randomly generated AES key KA, and each time the encryption is randomly generated by a KA; 202 is a ciphertext TM obtained by encrypting the plaintext with AES symmetric encryption using KA as the key; The mobile phone applies the local database, and reads the PubKey to the 204 for use; 204 is the ciphertext TA obtained by using the PubKey as the public key and the asymmetric encryption of the RS by the RSA; 205 is the data pair composed of the TA and the TM corresponding to the encryption process ( ⁇ , ⁇ ); Finally, 205 is stored as a piece of data in 103.
  • the following is an example of an embodiment of the encryption and decryption method used by the privacy space module of ZTE's palm butler application.
  • the module can store users' private contacts, privacy messages, private call records, privacy pictures, privacy videos, privacy files, and various passwords.
  • privacy messages are just examples of privacy messages:
  • the table structure of the mobile application local database uses the SQL statement "CREATE TABLE publicinfo (ID INTEGER PRIMARY KEY, sms INTEGER, calllog INTEGER, publicKey TEXT, privateKey TEXT, ac TEXT, androidlD TEXT, old- version INTEGER NOT NULL, key-type INTEGER) "Create a table, where publicKey is used to store the plaintext's PubKey, privateKey is used for the aforementioned T, and ac is used to store the aforementioned S.
  • the palm manager When the user enters the privacy space of the palm manager for the first time, the palm manager will prompt him to choose to set the text password or set the graphic password. The palm manager will convert the user input into a string, and use this string as the user password set by the user. Key.
  • the palm manager will randomly generate a 1024-bit RSA key pair and jump out of the waiting dialog box to prompt the user. "Because it is the first time to use the privacy space, we are initializing the privacy space" (this is because the generation of the 1024-bit RSA key pair costs 2-5 seconds, so let the user see the wait dialog).
  • the application stores the PubKey in the publicKey item of the data table ublicinfo, encrypts the PriKey with the 128-bit AES symmetric encryption algorithm using the Key as the key, and stores the file in the private key of the data table ublicinfo.
  • the signature of the Key is obtained to obtain the string S, and the S is stored in the ac item of the publicinfo of the data table.
  • the algorithm for calculating the signature S is a private algorithm of the palm manager.
  • the CRC32 check code string of the input string is connected with the Adler32 check code string to obtain a new string as a signature, which is faster than Md5.
  • the algorithm is irreversible, so the Key cannot be pushed back according to S.
  • the string obtained by the algorithm does not have SQL reserved characters and can be directly stored in the database.
  • PubKey and T are stored in the database without SQL reserved characters, they are encoded by the Base64 algorithm before being stored, and the data table is encoded. Base64 string, but because Base64 is reversible, after reading it from the data table, it can be decoded once with Base64 to get the real PubKey and T.
  • the palm manager When the palm manager detects that the user has received a text message from the privacy contact, or detects that the user sends a text message to the privacy contact, the message needs to be encrypted and stored in the local database of the palm-handler application, and the SMS database from the system. Delete the message in the middle.
  • a 128-bit AES key is randomly generated, AES encryption is performed on the short message content, and the ciphertext is obtained. Then, the cryptographic TA is obtained by using the PubKey to perform 1024-bit RSA encryption on the KA, and the TA and the TM are stored in the privacysms table. The same private message is recorded in the cl and body entries. Similarly, TA and TM are read and written in the database using Base64, which will not be described below.
  • the PriKey is used to perform 1024-bit RSA decryption on the cl to obtain the KA, and then the KA is used to perform 128-bit AES decryption on the body to obtain the plaintext of the short message content.
  • the data encryption and decryption method provided by the embodiment of the present invention solves the problem that the prior art stores the user's privacy key locally in the mobile phone and causes a security vulnerability.
  • the decryption method is used.
  • the user key exists only in the user's mind, thus ensuring the security of the key, thereby greatly improving the security of the private data.
  • the combination of the symmetric encryption and decryption algorithm and the asymmetric encryption and decryption algorithm is improved.
  • the speed of encryption and decryption calculation is improved compared with the single use of asymmetric encryption and decryption algorithms.
  • a data encryption device is configured as shown in FIG. 6 and is used for a terminal.
  • the device includes: a first processing module configured to randomly generate an asymmetric key when setting a user's privacy password.
  • the obtaining module 20 configured to obtain the symmetric key randomly generated when the data to be encrypted is obtained; configured to perform the encryption calculation on the encrypted data by using the symmetrically generated symmetric key using a symmetric encryption algorithm to obtain the encrypted data 30;
  • the public key configured to use the asymmetric key is encrypted and calculated by an asymmetric encryption algorithm to obtain a second processing module 40 of the first ciphertext corresponding to the symmetric key;
  • a storage module 50 configured to record the first ciphertext and the encrypted data.
  • the first processing module 10 is specifically configured to:
  • the private key in the asymmetric key is encrypted by the symmetric encryption algorithm using the user's private password as a key to obtain a second ciphertext;
  • a data decryption device is configured as shown in FIG. 7, for a terminal, the device comprising: a verification unit 60 configured to verify a user-entered privacy password;
  • the second ciphertext stored in the pre-stored secret cipher is decrypted to obtain the private key of the asymmetric key.
  • the second processing unit 80 configured to decrypt the pre-stored first ciphertext by using the decrypted private key to obtain a symmetric key
  • the decryption unit 90 is configured to obtain the plaintext of the encrypted data based on the decrypted symmetric key.
  • the verification unit 60 is specifically configured to:
  • Extracting a second character string from the input privacy password by a first irreversible algorithm comparing the second character string with a pre-stored first one extracted from the initially set user privacy password by a first irreversible algorithm If the character string is consistent, a judgment result is obtained; if the judgment result indicates that the second character string is consistent with the first character string, it indicates that the privacy password input by the user passes the verification.
  • An embodiment of the present invention provides a terminal, including:
  • It is configured to randomly generate an asymmetric key when setting a user's privacy password, store the public key of the asymmetric encryption key, and use the user's private password as a key to pass the symmetric encryption algorithm to the private key in the asymmetric key. Encrypting to obtain a device corresponding to the private key;
  • the terminal further includes:
  • a device configured to verify a privacy password entered by a user
  • the pre-stored private key corresponding ciphertext is decrypted by using the private password to obtain a private key of the asymmetric key; and the pre-stored symmetric key corresponding ciphertext is performed by using the decrypted private key.
  • Decrypting obtaining a symmetric key; obtaining a plaintext of the encrypted data according to the decrypted symmetric key.
  • the data encryption and decryption apparatus and the terminal provided by the embodiments of the present invention solve the problem that the prior art stores the user's privacy key locally in the mobile phone and causes a security vulnerability.
  • the decrypted user key exists only in the user's brain, thus ensuring the security of the key, thereby greatly improving the security of the private data.
  • the combination of the symmetric encryption and decryption algorithm and the asymmetric encryption and decryption algorithm is improved. While the data is encrypted, the speed of encryption and decryption calculation is improved compared to the single asymmetric encryption and decryption algorithm.
  • the aforementioned program can be stored in a computer readable storage medium.
  • the program when executed, performs the steps including the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • the user key exists only in the user's mind, thus ensuring the security of the key, thereby greatly improving the security of the private data.
  • the combination of the symmetric encryption and decryption algorithm and the asymmetric encryption and decryption algorithm is improved.
  • the speed of encryption and decryption calculation is improved compared with the single use of asymmetric encryption and decryption algorithms.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Storage Device Security (AREA)

Abstract

本发明公开了一种数据加密解密方法、装置以及终端,其中,所述方法包括:在设置用户的隐私密码时随机生成非对称密钥;获得待加密数据时随机生成的对称密钥;利用所述对称密钥对待加密数据使用对称加密算法进行加密,得到已加密数据;使用非对称密钥的公钥对所述对称密钥进行加密,得到与所述对称密钥相对应的第一密文;记录所述已加密数据和第一密文。

Description

一种数据加密解密方法、 装置以及终端 技术领域
本发明涉及信息安全领域, 尤其涉及一种数据加密解密方法、 装置以 及终端。 背景技术
现有的移动终端越来越深入人们的生活, 而人们在对移动终端的使用 中越来越注重个人的隐私, 会将一些不想让其他人知道的通话记录、 短信、 图片、 视频等文件进行数据加密后, 存储在移动终端中, 知道密码的用户 通过输入密码才能查看加密数据。 例如: 手机应用现在有一个种类叫做隐 私空间, 其功能是将用户的通话记录, 短信, 图片, 视频, 文件等等隐私 的内容加密保存, 以达到保护用户隐私的目的。
现有的移动终端对隐私数据的加解密通常釆用的是对称加密算法 (如
DES, AES ), 其过程是: 根据用户预先设置的密码, 自行对需要加密的数 据进行加密, 当用户想要查看加密数据时, 输入密码, 移动终端对用户输 入的密码进行验证, 当验证通过后, 将加密的数据显示出来供用户查看。 以隐私空间应用处理短信为例, 其流程是: 用户收到短信, 隐私空间应用 判断是隐私联系人来的短信, 就将这条短信加密存储进数据库, 同时从系 统数据库中删除该短信。 当用户想要查看加密短信数据时, 输入密码, 隐 私空间对用户输入的密码进行验证, 当验证通过后, 将加密的数据显示出 来供用户查看。
现有技术的不足之处在于: 移动终端必须将用于加密数据的密钥保存 在本地。 这是因为当隐私联系人来电话和来短信时, 移动终端必须要 "自 动" (不向用户询问密码)使用存储在本地的密钥通过对称加密算法对隐私 通话记录和隐私短信进行加密保存。 但由于用于加密的密钥被保存在本地, 所以很容易被非法用户运用反编译的方法获得密钥,进而获得用户的隐私数 据, 因此用户的隐私数据, 特别是隐私通话记录和隐私短信是不安全的。 发明内容
有鉴于此, 本发明提供一种数据加密解密方法、 装置以及终端。
第一方面, 本发明实施例提供一种数据加密方法, 用于终端, 所述方 法包括:
在设置用户的隐私密码时随机生成非对称密钥;
获得待加密数据时随机生成的对称密钥;
利用所述对称密钥对待加密数据使用对称加密算法进行加密, 得到已 加密数据;
使用非对称密钥的公钥对所述对称密钥进行加密, 得到与所述对称密 钥相对应的第一密文;
记录所述已加密数据和第一密文。
优选地, 所述在设置用户的隐私密码时随机生成非对称密钥包括: 利用用户的隐私密码为密钥通过对称加密算法对非对称密钥中的私钥 进行加密, 得到第二密文;
通过第一不可逆算法从所述用户的隐私密码中获取第一字符串; 存储对称密钥所述非对称加密密钥的公钥、 所述第二密文和所述第一 字符串。
优选地, 在所述通过第一不可逆算法从所述用户的隐私密码中获取第 一字符串中, 还包括:
获取所述第一用户密码的 CRC32校验码字符串和 Adler32校验码字符 串;
将所述 CRC32校验码字符串和所述 Adler32校验码字符串相连接, 得到 第一字符串。
第二方面, 本发明实施例提供一种数据解密方法, 用于终端, 所述方 法包括:
马全证用户输入的隐私密码;
验证通过后, 利用该隐私密码对预先存储的第二密文进行解密, 获得 非对称密钥的私钥;
利用解密后的私钥对预先存储的第一密文进行解密, 获得对称密钥; 根据解密后的对称密钥, 得到已加密数据的明文。
优选地, 所述验证用户输入的隐私密码包括:
通过第一不可逆算法从所述输入的隐私密码中提取第二字符串; 对比所述第二字符串与预先存储的、 通过第一不可逆算法从所述最初 设置的用户隐私密码中提取的第一字符串是否一致, 得到一判断结果; 若判断结果指示所述第二字符串与所述第一字符串一致, 则说明所述 用户输入的隐私密码通过了验证。
优选地, 在所述通过第一不可逆算法从所述输入的隐私密码中提取第 二字符串中, 还包括:
获取所述第二用户密码的 CRC32校验码字符串和 Adler32校验码字符 串;
将所述 CRC32校验码字符串和所述 Adler32校验码字符串相连接, 得到 第二字符串。
第三方面, 本发明实施例提供一种数据加密装置, 用于终端, 所述装 置包括:
第一处理模块, 配置为在设置用户的隐私密码时随机生成非对称密钥; 获取模块, 配置为获得待加密数据时随机生成的对称密钥;
加密模块, 配置为利用随机生成的对称密钥使用对称加密算法对待加 密数据进行加密计算, 得到已加密数据;
第二处理模块, 配置为使用非对称密钥的公钥通过非对称加密算法对 所述对称密钥进行加密计算, 得到与所述对称密钥相对应的第一密文; 存储模块, 配置为记录所述第一密文和所述已加密数据。
优选地, 所述第一处理模块, 还配置为:
利用用户的隐私密码为密钥通过对称加密算法对非对称密钥中的私钥 进行加密, 得到第二密文;
通过第一不可逆算法从所述用户的隐私密码中获取第一字符串; 存储对称密钥所述非对称加密密钥的公钥、 所述第二密文和所述第一 字符串。
所述第一处理模块、 所述获取模块、 所述加密模块、 所述第二处理模 块、 所述存储模块在执行处理时, 可以釆用中央处理器 (CPU, Central Processing Unit )、 数字信号处理器(DSP, Digital Singnal Processor )或可 编程逻辑阵列 (FPGA, Field - Programmable Gate Array ) 实现。
第四方面, 本发明实施例提供一种数据解密装置, 用于终端, 所述装 置包括:
验证单元, 配置为验证用户输入的隐私密码;
第一处理单元, 配置为验证通过后, 利用该隐私密码对预先存储的第 二密文进行解密, 获得非对称密钥的私钥;
第二处理单元, 配置为利用解密后的私钥对预先存储的第一密文进行 解密, 获得对称密钥;
解密单元, 配置为才艮据解密后的对称密钥, 得到已加密数据的明文。 优选地, 所述验证单元, 还配置为:
通过第一不可逆算法从所述输入的隐私密码中提取第二字符串; 对比所述第二字符串与预先存储的、 通过第一不可逆算法从所述最初 设置的用户隐私密码中提取的第一字符串是否一致, 得到一判断结果; 若判断结果指示所述第二字符串与所述第一字符串一致, 则说明所述 用户输入的隐私密码通过了验证。
所述验证单元、 所述第一处理单元、 所述第二处理单元、 所述解密单 元在执行处理时, 可以釆用中央处理器 (CPU, Central Processing Unit ), 数字信号处理器( DSP, Digital Singnal Processor )或可编程逻辑阵列( FPGA, Field - Programmable Gate Array ) 实现。
第五方面, 本发明实施例提供一种终端, 所述终端配置为:
在设置用户的隐私密码时随机生成非对称密钥, 存储所述非对称加密 密钥的公钥、 并利用用户的隐私密码为密钥通过对称加密算法对非对称密 钥中的私钥进行加密, 得到与所述私钥对应密文;
获得待加密数据时随机生成对称密钥, 利用所述对称密钥对待加密数 据使用对称加密算法进行加密、 得到已加密数据;
使用非对称密钥的公钥对所述对称密钥进行加密, 得到与所述对称密 钥对应密文;
存储所述非对称密钥的公钥及所述密文。
优选地, 所述终端还配置为:
马全证用户输入的隐私密码;
验证通过后, 利用该隐私密码对预先存储的所述私钥对应密文进行解 密, 获得非对称密钥的私钥; 利用解密后的私钥对预先存储的所述对称密 钥对应密文进行解密, 获得对称密钥; 根据解密后的对称密钥, 得到已加 密数据的明文。
本发明实施例提供的数据加密解密方法、 装置以及终端, 解决了现有 技术将用户的隐私密钥存储在手机本地的而造成安全漏洞的问题, 在本发 明中, 用于解密的用户密钥只存在于用户脑中, 这样就保证了密钥的安全, 进而大大提高了隐私数据的安全性; 另外, 将对称加解密算法和非对称加 解密算法组合使用, 在提高了被加密数据安全性的同时, 又比单一使用非 对称加解密算法提高了加解密计算的速度。 附图说明
图 1为数据加密方法的实施例流程图;
图 2为数据解密方法的实施例流程图;
图 3为数据加密解密方法的又一实施例中生成密钥的流程图;
图 4为数据加密解密方法的又一实施例中加密的流程图;
图 5为数据加密解密方法的又一实施例中解密的流程图;
图 6为数据加密装置的实施例示意图;
图 7为数据解密装置的实施例示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。
数据加密方法的流程如图 1所示, 用于终端, 所述方法包括: 步骤 100.在设置用户的隐私密码时随机生成非对称密钥;
步骤 101.获得待加密数据时随机生成的对称密钥;
步骤 102.利用所述对称密钥对待加密数据使用对称加密算法进行加密, 得到已加密数据;
步骤 103.使用非对称密钥的公钥对所述对称密钥进行加密, 得到与所 述对称密钥相对应的第一密文; 步骤 104.记录所述已加密数据和第一密文。
具体地, 对称加密算法包括扩但不限于: DES、 AES和三重 DES; 非 对称加密算法包括但不限于: RSA和 Elg謹 1; 终端包括但不限于: 移动终 端和台式终端。
通过上述的操作, 用于解密的用户密钥只存在于用户脑中, 这样就保 证了密钥的安全, 进而大大提高了隐私数据的安全性; 将对称加解密算法 和非对称加解密算法组合使用, 在提高了被加密数据安全性的同时, 又提 高了加解密计算的速度。
具体地, 所述步骤 102具体包括:
获取待加密数据;
随机生成对称密钥;
利用所述对称密钥通过对称加密算法对所述待加密数据进行加密, 得 到已加密数据。
具体地, 所述步骤 103具体包括:
获取预先存储的利用非对称算法生成的密钥对中的公钥;
利用所述公钥通过非对称加密算法对所述对称密钥进行加密计算, 得 到与所述对称密钥相对应的第一密文。
现有的终端对用户输入的密码进行存储, 在对数据加密的过程中是不 需要输入密码的, 说明密码是保存在移动终端中的, 而一些非法用户运用 反编译的方法, 是有可以找到密码本身的, 从而窥视用户的加密数据, 造 成用户的隐私泄露, 甚至给用户带来不必要的损失。 所以目前的加密数据 的方式是不安全的。
在本实施例中, 所述步骤 100具体包括:
利用用户的隐私密码为密钥通过对称加密算法对非对称密钥中的私钥 进行加密, 得到第二密文; 通过第一不可逆算法从所述用户的隐私密码中获取第一字符串; 存储对称密钥所述非对称加密密钥的公钥、 所述第二密文和所述第一 字符串。
通过上述操作, 密码只存储在用户的脑中, 终端仅对用户所输入的密 码中的特定字符串进行不可逆计算后并进行存储, 即使非法用户获取到该 特定字符串后, 也无法通过反编译的手段得到用户输入的密码, 避免了非 法用户窥视用户的加密数据所造成用户隐私的泄露, 大大提高了用户加密 数据的安全性。
现有加密过程中, 一般釆用 MD5算法进行不可逆计算, 但是 MD5算 法较为复杂, 每次字符串的计算需要较长的时间, 增加了加密计算的复杂 度和计算时间。
在所述通过第一不可逆算法从所述第一用户密码中获取第一字符串步 骤中:
获取所述第一用户密码的 CRC32校验码字符串和 Adler32校验码字符 串;
将所述 CRC32校验码字符串和所述 Adler32校验码字符串相连接, 得 到第一字符串。
具体地, 所述第一字符串可以是签名或者通过其他不可逆算法得到的 字符串。
通过上述的操作, 在进行字符串的计算时, 无需复杂的 MD5计算, 只 需将获取的校验字符串相连就可以形成所需要的字符串, 而且, 根据当前 计算机的运算能力, 花费很短的时间就可以完成上述操作, 大大缩短了加 密计算所用的时间, 提高了加密计算的效率。
与上述数据加密方法相对应地, 本实施例还提出一种数据解密方法, 所述数据解密方法的流程图如图 2所示, 所述数据解密方法用于终端, 所 述方法包括:
步骤 200.验证用户输入的隐私密码;
步骤 201.验证通过后, 利用该隐私密码对预先存储的第二密文进行解 密, 获得非对称密钥的私钥;
步骤 202.利用解密后的私钥对预先存储的第一密文进行解密, 获得对 称密钥;
步骤 203.根据解密后的对称密钥, 得到已加密数据的明文。
具体地, 所述步骤 200具体包括:
通过第一不可逆算法从所述输入的隐私密码中提取第二字符串; 对比所述第二字符串与预先存储的、 通过第一不可逆算法从所述最初 设置的用户隐私密码中提取的第一字符串是否一致, 得到一判断结果; 若判断结果指示所述第二字符串与所述第一字符串一致, 则说明所述 用户输入的隐私密码通过了验证。
具体地, 在所述通过第一不可逆算法从所述第二用户密码中获取第二 字符串步骤中:
获取所述第二用户密码的 CRC32校验码字符串和 Adler32校验码字符 串;
将所述 CRC32校验码字符串和所述 Adler32校验码字符串相连接, 得 到第二字符串。
通过以下是实施例对数据加密解密方法作进一步描述。
本实施例中, 生成密钥的过程如图 3所示: 101是用户设置的隐私空间 密码 Key; 102是随机生成的一对 RSA非对称密钥, 公钥为 PubKey, 私钥 为 PriKey; 103是手机应用本地数据库; 104是以 Key作为密钥用 AES对 称加密将 PriKey加密得到的密文 T;105是对 Key取签名得到的字串 S。 最 终将 102中的 PubKey, 104中的 T和 105中的 S存入 103中。 加密过程如图 4所示: 201是一个随机生成的 AES密钥 KA,每一次加 密都随机生成一个 KA; 202是以 KA为密钥用 AES对称加密将明文加密得 到的密文 TM; 103是手机应用本地数据库, 从中读出 PubKey送给 204使 用; 204是以 PubKey作为公钥, 用 RSA非对称加密 KA得到的密文 TA; 205是本次加密过程对应的 TA和 TM组成的数据对( ΤΑ,ΤΜ ); 最终将 205 作为一条数据存入 103中。
解密过程如图 5所示: 301是用户输入的密码 Key2; 302是对 Key2取 签名得到的字串 S2; 103是手机应用本地数据库, 从中读出 S送给 304使 用; 304判断是否 S2==S, 如果不等, 说明 Key2是错误的, 如果相等, 说 明 Key2有极大概率就是 Key,将 Key2送给 305使用; 305从 103中读出 T, 用 Key2解密 T得到私钥 PriKey; 306从 103中读出数据对( ΤΑ,ΤΜ ), 用 PriKey解密 TA得到 KA, 再用 KA解密 TM得到明文。
以下是一个是在中兴通讯的掌心管家应用的隐私空间模块运用本加密 解密方法实施例的例子。 该模块可以存储用户的隐私联系人、 隐私短信、 隐私通话记录、 隐私图片、 隐私视频、 隐私文件、 以及各种密码。 下面仅 以隐私短信来举例:
手机应用本地数据库的表结构用 SQL语句 "CREATE TABLE publicinfo ( ID INTEGER PRIMARY KEY, sms INTEGER, calllog INTEGER, publicKey TEXT, privateKey TEXT , ac TEXT, androidlD TEXT, old— version INTEGER NOT NULL, key— type INTEGER)"创建了一个表, 其中 publicKey用于存储 明文的 PubKey, privateKey用于前述 T, ac用于存储前述 S。
用 SQL语句" CREATE TABLE privacysms ( ID INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER, thread— id INTEGER, address TEXT, ac TEXT, person INTEGER, date INTEGER, date— sent INTEGER DEFAULT 0; protocal INTEGER, read INTEGER DEFAULT 0, status INTEGER DEFAULT -1, type INTEGER, reply_path_present INTEGER, subject TEXT, body TEXT, service— center TEXT, service— date INTERGER, dest_port INTEGER, locked INTEGER DEFAULT 0, sub— id INTEGER DEFAULT 0, error— code INTEGER DEFAULT 0, seen INTEGER DEFAULT 0, recipient— cc— ids TEXT, recipient— bcc— ids TEXT, sms_pdu TEXT, expiry INTEGER DEFAULT 0, sim— index INTEGER DEFAULT 0, expand TEXT, pre— address TEXT, name TEXT, cl TEXT, version INTEGER DEFAULT 1)"创建了一个表用于存储隐 私短信。 其中 cl是前述 TA, body是前述 TM。 表中一条记录即是一个数据 对 ( ΤΑ,ΤΜ )0
1.设置用户密码的过程
用户第一次进入掌心管家的隐私空间时, 掌心管家会提示他选择设置 文字密码或者设置图形密码, 掌心管家会把用户输入的内容转化成字符串, 把这串字符串作为用户设置的用户密码 Key。
之后掌心管家会随机生成 1024位 RSA密钥对, 同时跳出等待对话框 提示用户"由于是首次使用隐私空间,我们正在对隐私空间进行初始化操作" (这是因为生成 1024位 RSA密钥对要耗费 2-5秒钟时间,所以让用户看到 等待对话框)。
生成 RSA密钥对成功后, 应用就将 PubKey存入数据表 ublicinfo的 publicKey项, 以 Key作为密钥用 128位 AES对称加密算法将 PriKey加密 得到密文 T, 将 Τ存入数据表 ublicinfo的 privateKey项, 对 Key取签名得 到字串 S, 将 S存入数据表 publicinfo的 ac项。
计算签名 S的算法是掌心管家的私有算法。 是取输入字符串的 CRC32 校验码字符串和 Adler32校验码字符串相连接得到新字符串作为签名,它与 Md5相比运算速度较快。该算法为不可逆运算,因此不能根据 S反推出 Key, 另外该算法得到的字串不会出现 SQL保留字符, 可以直接存入数据库。
另外, 为了保证 PubKey和 T存入数据库时不会出现 SQL保留字符, 在存入前将他们用 Base64 算法进行了编码, 存入数据表的是编码后的 Base64字符串, 但因为 Base64是可逆运算的, 所以从数据表中读出后, 再 用 Base64解码一次即可获得真实的 PubKey和 T。
2.加密短信过程
当掌心管家检测到用户收到隐私联系人发来短信时, 或者检测到用户 自己发短信给隐私联系人时, 都需要将该短信加密保存进掌心管家应用的 本地数据库, 同时从系统的短信数据库中删除该条短信。
加密前, 随机生成一个 128位的 AES密钥 ΚΑ, 对短信内容进行 AES 加密, 得到密文 ΤΜ, 然后用 PubKey对 KA进行 1024位 RSA加密得到密 文 TA,将 TA和 TM存入 privacysms表中同一条隐私短信记录的 cl项和 body 项中。 同样 TA和 TM在数据库中的读写也是使用了 Base64处理的, 下面 不再赘述。
3.解密短信过程
解密时, 先请用户输入用户密码, 假设用户输入为 Key2, 用前述设置 用户密码的过程中计算签名 S的算法计算出签名字符串 S2, 从 publicinfo 表中读出 ac和 privateKey, 将 S2与 ac比较, 如果相同, 证明 Key2有很大 可能是 Key。 用 Key2对 privateKey进行 128位 AES解密, 如解密成功就 得到 PriKey (如失败就说明 Key2不是 Key, 但这种不同字串的签名偶然相 同的概率极低)。 然后从需要解密的 privacysms表的一条隐私短信记录中读 出 cl项和 body项, 先用 PriKey对 cl进行 1024位 RSA解密得到 KA, 接 着用 KA对 body进行 128位 AES解密得到短信内容的明文。
以上所述, 仅为本实施例的较佳例子而已, 并非用于限定本发明的保 护范围, 凡在本发明的精神和原则之内所作的任何修改、 等同替换和改进 等(包括且不限于将 AES算法替换成其他对称加解密算法,如 DES, 3DES; 将 RSA算法替换成其他非对称加解密算法, 如椭圓曲线算法等; 将类似加 解密流程用于保护除隐私联系人, 隐私通话记录和隐私短信之外的其他类 似的因为流程的原因(特点是加密时不便让用户输入密码)而导致使用对称 加密算法无法保证其安全性的隐私信息的安全的场景), 均应包含在本发明 的保护范围之内。
通过以上实施例的描述, 本发明实施例提供的数据加密解密方法, 解 决了现有技术将用户的隐私密钥存储在手机本地的而造成安全漏洞的问 题, 在本发明中, 用于解密的用户密钥只存在于用户脑中, 这样就保证了 密钥的安全, 进而大大提高了隐私数据的安全性; 另外, 将对称加解密算 法和非对称加解密算法组合使用, 在提高了被加密数据安全性的同时, 又 比单一使用非对称加解密算法提高了加解密计算的速度。
一种数据加密装置的结构如图 6所示, 用于终端, 所述装置包括: 配置为在设置用户的隐私密码时随机生成非对称密钥的第一处理模块
10;
配置为获得待加密数据时随机生成的对称密钥的获取模块 20; 配置为利用随机生成的对称密钥使用对称加密算法对待加密数据进行 加密计算, 得到已加密数据的加密模块 30;
配置为使用非对称密钥的公钥通过非对称加密算法对所述对称密钥进 行加密计算, 得到与所述对称密钥相对应的第一密文的第二处理模块 40; 及
配置为记录所述第一密文和所述已加密数据的存储模块 50。
具体地, 所述第一处理模块 10具体配置为:
利用用户的隐私密码为密钥通过对称加密算法对非对称密钥中的私钥 进行加密, 得到第二密文;
通过第一不可逆算法从所述用户的隐私密码中获取第一字符串; 存储对称密钥所述非对称加密密钥的公钥、 所述第二密文和所述第一 字符串。 本实施例中提供的数据加密装置的功能和处理流程, 可以参见上面提 供的数据加密方法的实施例的流程, 此处不再赘述。
一种数据解密装置的结构如图 7所示, 用于终端, 所述装置包括: 配置为验证用户输入的隐私密码的验证单元 60;
配置为验证通过后, 利用该隐私密码对预先存储的第二密文进行解密, 获得非对称密钥的私钥的第一处理单元 70;
配置为利用解密后的私钥对预先存储的第一密文进行解密, 获得对称 密钥的第二处理单元 80;
配置为根据解密后的对称密钥,得到已加密数据的明文的解密单元 90。 具体地, 所述验证单元 60具体配置为:
通过第一不可逆算法从所述输入的隐私密码中提取第二字符串; 对比所述第二字符串与预先存储的、 通过第一不可逆算法从所述最初 设置的用户隐私密码中提取的第一字符串是否一致, 得到一判断结果; 若判断结果指示所述第二字符串与所述第一字符串一致, 则说明所述 用户输入的隐私密码通过了验证。
本实施例中提供的数据解密装置的功能和处理流程, 可以参见上面提 供的数解密方法的实施例的流程, 此处不再赘述。
本发明实施例提供一种终端, 包括:
配置为在设置用户的隐私密码时随机生成非对称密钥, 存储所述非对 称加密密钥的公钥、 并利用用户的隐私密码为密钥通过对称加密算法对非 对称密钥中的私钥进行加密, 得到与所述私钥对应密文的装置;
获得待加密数据时随机生成对称密钥, 利用所述对称密钥对待加密数 据使用对称加密算法进行加密、 得到已加密数据的装置;
使用非对称密钥的公钥对所述对称密钥进行加密, 得到与所述对称密 钥对应密文的装置; 存储所述非对称密钥的公钥及所述密文的装置。
进一步地, 所述终端还包括:
配置为验证用户输入的隐私密码的装置;
验证通过后, 利用该隐私密码对预先存储的所述私钥对应密文进行解 密, 获得非对称密钥的私钥; 利用解密后的私钥对预先存储的所述对称密 钥对应密文进行解密, 获得对称密钥; 根据解密后的对称密钥, 得到已加 密数据的明文。
本实施例中提供的终端的功能和处理流程, 可以参见上面提供的数据 加密、 解密方法的实施例的流程, 此处不再赘述。
通过以上实施例的描述, 本发明实施例提供的数据加密解密装置和终 端, 解决了现有技术将用户的隐私密钥存储在手机本地的而造成安全漏洞 的问题, 在本发明中, 用于解密的用户密钥只存在于用户脑中, 这样就保 证了密钥的安全, 进而大大提高了隐私数据的安全性; 另外, 将对称加解 密算法和非对称加解密算法组合使用, 在提高了被加密数据安全性的同时, 又比单一使用非对称加解密算法提高了加解密计算的速度。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成。 前述的程序可以存储于一计算机 可读取存储介质中。 该程序在执行时, 执行包括上述各方法实施例的步骤; 而前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序 代码的介质。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非 对其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的 普通技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案进 行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或 者替换, 并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。 工业实用性 本发明实施例提供的数据加密解密方法、 装置以及终端, 解决了现有 技术将用户的隐私密钥存储在手机本地的而造成安全漏洞的问题, 在本发 明中, 用于解密的用户密钥只存在于用户脑中, 这样就保证了密钥的安全, 进而大大提高了隐私数据的安全性; 另外, 将对称加解密算法和非对称加 解密算法组合使用, 在提高了被加密数据安全性的同时, 又比单一使用非 对称加解密算法提高了加解密计算的速度。

Claims

权利要求书
1.一种数据加密方法, 用于终端, 所述方法包括:
在设置用户的隐私密码时随机生成非对称密钥;
获得待加密数据时随机生成的对称密钥;
利用所述对称密钥对待加密数据使用对称加密算法进行加密, 得到已 加密数据;
使用非对称密钥的公钥对所述对称密钥进行加密, 得到与所述对称密 钥相对应的第一密文;
记录所述已加密数据和第一密文。
2.根据权利要求 1所述的数据加密方法, 其中, 所述在设置用户的隐私 密码时随机生成非对称密钥包括:
利用用户的隐私密码为密钥通过对称加密算法对非对称密钥中的私钥 进行加密, 得到第二密文;
通过第一不可逆算法从所述用户的隐私密码中获取第一字符串; 存储对称密钥所述非对称加密密钥的公钥、 所述第二密文和所述第一 字符串。
3.根据权利要求 2所述的数据加密方法, 其中, 在所述通过第一不可逆 算法从所述用户的隐私密码中获取第一字符串中, 还包括:
获取所述第一用户密码的 CRC32校验码字符串和 Adler32校验码字符 串;
将所述 CRC32校验码字符串和所述 Adler32校验码字符串相连接, 得到 第一字符串。
4.一种数据解密方法, 用于终端, 所述方法包括:
马全证用户输入的隐私密码;
验证通过后, 利用所述隐私密码对预先存储的第二密文进行解密, 获 得非对称密钥的私钥;
利用解密后的私钥对预先存储的第一密文进行解密, 获得对称密钥; 根据解密后的对称密钥, 得到已加密数据的明文。
5.根据权利要求 4所述的数据解密方法, 其中, 所述验证用户输入的隐 私密码包括:
通过第一不可逆算法从所述输入的隐私密码中提取第二字符串; 对比所述第二字符串与预先存储的、 通过第一不可逆算法从所述最初 设置的用户隐私密码中提取的第一字符串是否一致, 得到一判断结果; 若判断结果指示所述第二字符串与所述第一字符串一致, 则说明所述 用户输入的隐私密码通过了验证。
6.根据权利要求 5所述的数据解密方法, 其中, 在所述通过第一不可逆 算法从所述输入的隐私密码中提取第二字符串中, 还包括:
获取所述第二用户密码的 CRC32校验码字符串和 Adler32校验码字符 串;
将所述 CRC32校验码字符串和所述 Adler32校验码字符串相连接, 得到 第二字符串。
7.—种数据加密装置, 用于终端, 所述装置包括:
第一处理模块, 配置为在设置用户的隐私密码时随机生成非对称密钥; 获取模块, 配置为获得待加密数据时随机生成的对称密钥;
加密模块, 配置为利用随机生成的对称密钥使用对称加密算法对待加 密数据进行加密计算, 得到已加密数据;
第二处理模块, 配置为使用非对称密钥的公钥通过非对称加密算法对 所述对称密钥进行加密计算, 得到与所述对称密钥相对应的第一密文; 存储模块, 配置为记录所述已加密数据和所述第一密文。
8.根据权利要求 7所述的数据加密装置, 其中, 所述第一处理模块, 还 配置为:
利用用户的隐私密码为密钥通过对称加密算法对非对称密钥中的私钥 进行加密, 得到第二密文;
通过第一不可逆算法从所述用户的隐私密码中获取第一字符串; 存储对称密钥所述非对称加密密钥的公钥、 所述第二密文和所述第一 字符串。
9.一种数据解密装置, 用于终端, 所述装置包括:
验证单元, 配置为验证用户输入的隐私密码;
第一处理单元, 配置为验证通过后, 利用所述隐私密码对预先存储的 第二密文进行解密, 获得非对称密钥的私钥;
第二处理单元, 配置为利用解密后的私钥对预先存储的第一密文进行 解密, 获得对称密钥;
解密单元, 配置为才艮据解密后的对称密钥, 得到已加密数据的明文。
10.根据权利要求 9所述的数据解密装置, 所述验证单元, 还配置为: 通过第一不可逆算法从所述输入的隐私密码中提取第二字符串; 对比所述第二字符串与预先存储的、 通过第一不可逆算法从所述最初 设置的用户隐私密码中提取的第一字符串是否一致, 得到一判断结果; 若判断结果指示所述第二字符串与所述第一字符串一致, 则说明所述 用户输入的隐私密码通过了验证。
11. 一种终端, 所述终端配置为:
在设置用户的隐私密码时随机生成非对称密钥, 存储所述非对称加密 密钥的公钥、 并利用用户的隐私密码为密钥, 通过对称加密算法对非对称 密钥中的私钥进行加密, 得到与所述私钥对应密文;
获得待加密数据时随机生成对称密钥, 利用所述对称密钥对待加密数 据使用对称加密算法进行加密、 得到已加密数据; 使用非对称密钥的公钥对所述对称密钥进行加密, 得到与所述对称密 钥对应密文;
存储所述非对称密钥的公钥及所述密文。
12.根据权利要求 11所述的终端, 其中, 所述终端还配置为:
马全证用户输入的隐私密码的装置;
验证通过后, 利用该隐私密码对预先存储的所述私钥对应密文进行解 密, 获得非对称密钥的私钥; 利用解密后的私钥对预先存储的所述对称密 钥对应密文进行解密, 获得对称密钥; 根据解密后的对称密钥, 得到已加 密数据的明文。
PCT/CN2014/080999 2014-02-25 2014-06-27 一种数据加密解密方法、装置以及终端 WO2015127737A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410064246.5A CN104868996A (zh) 2014-02-25 2014-02-25 一种数据加密解密方法、装置以及终端
CN201410064246.5 2014-02-25

Publications (1)

Publication Number Publication Date
WO2015127737A1 true WO2015127737A1 (zh) 2015-09-03

Family

ID=53914541

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/080999 WO2015127737A1 (zh) 2014-02-25 2014-06-27 一种数据加密解密方法、装置以及终端

Country Status (2)

Country Link
CN (1) CN104868996A (zh)
WO (1) WO2015127737A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200079A (zh) * 2018-01-19 2018-06-22 深圳四方精创资讯股份有限公司 基于对称和非对称混合加密的区块链隐私保护方法及装置
CN108900533A (zh) * 2018-08-01 2018-11-27 南京荣链科技有限公司 一种共享数据隐私保护方法、系统、终端及介质

Families Citing this family (45)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105357665A (zh) * 2015-11-30 2016-02-24 江苏省电力公司苏州供电公司 手机的敏感数据的加密方法和基于其的离线解密方法
CN105721144A (zh) * 2016-02-02 2016-06-29 广东欧珀移动通信有限公司 一种无线网络接入点的密码保存方法及终端
CN107038383B (zh) * 2016-02-03 2020-08-25 华为技术有限公司 一种数据处理的方法和设备
CN107154920B (zh) * 2016-03-04 2021-07-13 神讯电脑(昆山)有限公司 安全信息的加密方法、解密方法及用以接收安全信息的接收装置
CN107306254B (zh) * 2016-04-21 2021-06-18 北京印刷学院 基于双层加密的数字版权保护方法及系统
CN107682303B (zh) * 2016-08-02 2020-11-10 北京宸信征信有限公司 个人敏感信息加密查询系统及方法
CN107770127A (zh) * 2016-08-17 2018-03-06 北京京东尚科信息技术有限公司 一种数据的传输方法和装置
CN106375306A (zh) * 2016-08-31 2017-02-01 武汉钢铁工程技术集团通信有限责任公司 手机应用数据传输加密方法及系统
CN106452754B (zh) * 2016-11-03 2020-09-08 大唐融合通信股份有限公司 一种多人在线动态加密方法及装置
CN107465665A (zh) * 2017-07-11 2017-12-12 上海互啊佑智能科技有限公司 一种基于指纹识别技术的文件加解密方法
CN107688729B (zh) * 2017-07-27 2020-11-27 大唐高鸿信安(浙江)信息科技有限公司 基于可信主机的应用程序保护系统及方法
CN109462472A (zh) * 2017-09-06 2019-03-12 阿里巴巴集团控股有限公司 数据加密和解密的方法、装置和系统
CN107911370A (zh) * 2017-11-22 2018-04-13 深圳市智物联网络有限公司 一种数据加密方法及装置、数据解密方法及装置
CN108599928B (zh) * 2018-03-27 2022-07-29 苏州科达科技股份有限公司 密钥管理方法及装置
CN108563927A (zh) * 2018-04-26 2018-09-21 惠州市德赛西威汽车电子股份有限公司 一种主机升级软件的打包加密方法
CN108964903B (zh) * 2018-07-12 2021-12-14 腾讯科技(深圳)有限公司 密码存储方法及装置
CN108810022A (zh) * 2018-07-18 2018-11-13 郑州云海信息技术有限公司 一种加密方法、解密方法及装置
CN109150882B (zh) * 2018-08-23 2021-02-12 深圳市安盾网络技术有限公司 一种基于利用路由加密的数据防泄漏方法
CN109005199A (zh) * 2018-09-28 2018-12-14 哈尔滨百香果科技有限公司 一种文件分享时的快速加解密方法
CN109543434B (zh) * 2018-11-28 2020-10-09 深圳市墨者安全科技有限公司 区块链信息加密方法、解密方法、存储方法及装置
CN110866251A (zh) * 2018-12-14 2020-03-06 哈尔滨安天科技集团股份有限公司 一种加密字符串的提取方法、装置、电子设备及存储介质
CN109474619B (zh) * 2018-12-17 2023-06-23 中国平安财产保险股份有限公司 数据加密上报方法及装置、数据解密方法及装置
CN109639407A (zh) * 2018-12-28 2019-04-16 浙江神州量子通信技术有限公司 一种基于量子网络对信息进行加密和解密的方法
CN109951453A (zh) * 2019-02-26 2019-06-28 符安文 一种基于区块链的安全加密方法
CN110636502A (zh) * 2019-09-23 2019-12-31 华南理工大学 一种无线加密通信方法和系统
CN110995648A (zh) * 2019-10-25 2020-04-10 金现代信息产业股份有限公司 安全加密方法
CN110929277B (zh) * 2019-11-19 2023-08-01 国网山东省电力公司潍坊市寒亭区供电公司 一种数据集中器、电能计量数据的处理方法及系统
CN111159757A (zh) * 2019-12-18 2020-05-15 成都烽创科技有限公司 文件加密方法、解密方法及相应装置
CN111246407B (zh) * 2020-01-10 2022-09-02 北京智信通联信息技术有限公司 用于短信传输的数据加密、解密方法及装置
CN111431917B (zh) * 2020-03-31 2022-06-03 上海涵润汽车电子有限公司 升级包加密方法及装置,升级包解密方法及装置
CN111614667A (zh) * 2020-05-20 2020-09-01 北京科东电力控制系统有限责任公司 电网调控信息实时数据传输的安全加密方法、装置和系统
CN111984985A (zh) * 2020-08-28 2020-11-24 思尔芯(上海)信息科技有限公司 一种基于fpga硬件系统的hdl源码加密方法
CN112202549B (zh) * 2020-09-02 2023-03-21 深圳市车电网络有限公司 充电管理方法、充电终端数据处理方法及充电管理平台数据处理方法
CN112668278B (zh) * 2020-12-23 2024-05-31 上海磐启微电子有限公司 一种环境验证系统及方法
CN114760081A (zh) * 2020-12-28 2022-07-15 富泰华工业(深圳)有限公司 档案加密与解密方法、装置及电子设备
CN113726725A (zh) * 2020-12-29 2021-11-30 京东数字科技控股股份有限公司 一种数据加解密方法、装置、电子设备及存储介质
CN112597521A (zh) * 2020-12-30 2021-04-02 厦门市美亚柏科信息股份有限公司 业务数据存储方法及计算机可读存储介质
CN112711764A (zh) * 2020-12-30 2021-04-27 南方电网科学研究院有限责任公司 一种数据读写方法、装置及电子设备
CN112906034B (zh) * 2021-03-16 2022-04-05 北京深思数盾科技股份有限公司 一种密钥保存方法、装置、存储介质及电子设备
CN114500037B (zh) * 2022-01-24 2023-02-28 深圳壹账通智能科技有限公司 可配置的接口加密方法、装置、计算机设备和存储介质
CN114553549B (zh) * 2022-02-24 2024-01-02 江苏商贸职业学院 一种数据加密方法及系统
CN116055207B (zh) * 2023-01-31 2023-10-03 深圳市圣驼储能技术有限公司 一种物联网通讯数据的加密方法及系统
CN115865349B (zh) * 2023-02-24 2023-05-09 蓝象智联(杭州)科技有限公司 一种一方加密多方联合解密的数据加解密方法
CN117375814A (zh) * 2023-10-11 2024-01-09 中移互联网有限公司 数据的存储方法、装置、系统、设备及存储介质
CN117955637B (zh) * 2024-03-25 2024-06-14 中国铁塔股份有限公司 数据加密方法及装置、数据解密方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972237A (zh) * 2006-12-06 2007-05-30 胡祥义 基于动态加密算法的vpn系统
CN103546421A (zh) * 2012-07-10 2014-01-29 河北省电子认证有限公司 基于pki技术的网络工作交流安全保密系统及其实现方法
CN103580859A (zh) * 2013-11-11 2014-02-12 国家电网公司 一种用于智能用电互动的非对称加密方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050015608A1 (en) * 2003-07-16 2005-01-20 Pkware, Inc. Method for strongly encrypting .ZIP files
CN101605326B (zh) * 2008-06-12 2011-07-13 中兴通讯股份有限公司 一种加密及解密移动终端锁网/锁卡解锁码的方法
CN101924739A (zh) * 2009-06-10 2010-12-22 北京环球聚浪网络科技有限公司 一种软件证书及私钥的加密存储并找回的方法
CN102377560A (zh) * 2010-08-19 2012-03-14 北京韩美智恒科技有限公司 一种移动通信终端数据加密方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972237A (zh) * 2006-12-06 2007-05-30 胡祥义 基于动态加密算法的vpn系统
CN103546421A (zh) * 2012-07-10 2014-01-29 河北省电子认证有限公司 基于pki技术的网络工作交流安全保密系统及其实现方法
CN103580859A (zh) * 2013-11-11 2014-02-12 国家电网公司 一种用于智能用电互动的非对称加密方法

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200079A (zh) * 2018-01-19 2018-06-22 深圳四方精创资讯股份有限公司 基于对称和非对称混合加密的区块链隐私保护方法及装置
CN108900533A (zh) * 2018-08-01 2018-11-27 南京荣链科技有限公司 一种共享数据隐私保护方法、系统、终端及介质
CN108900533B (zh) * 2018-08-01 2021-04-20 南京荣链科技有限公司 一种共享数据隐私保护方法、系统、终端及介质

Also Published As

Publication number Publication date
CN104868996A (zh) 2015-08-26

Similar Documents

Publication Publication Date Title
WO2015127737A1 (zh) 一种数据加密解密方法、装置以及终端
US9893892B2 (en) Authenticated remote pin unblock
US9860751B2 (en) Secure short message service (SMS) communications
KR101999188B1 (ko) 비밀 공유를 위한 타원 곡선 암호를 사용하는 개인용 장치 보안
WO2018133686A1 (zh) 一种密码保护方法、装置及存储介质
AU2016211551B2 (en) Methods for secure credential provisioning
US9338163B2 (en) Method using a single authentication device to authenticate a user to a service provider among a plurality of service providers and device for performing such a method
ES2543883T3 (es) Método de autenticación, método de autorización de pago y equipos electrónicos correspondientes
CN103516525B (zh) 一种动态口令生成方法和系统
WO2015161689A1 (zh) 一种基于协商密钥的数据处理方法
US20150113283A1 (en) Protecting credentials against physical capture of a computing device
CN108616352B (zh) 基于安全元件的动态口令生成方法和系统
KR20130131682A (ko) 웹 서비스 사용자 인증 방법
JP2024099827A (ja) 安全なメッセージングのための非接触カードを介して資格情報を提供する多要素認証
JP6397046B2 (ja) アドレス帳保護方法、装置及び通信システム
TW201003451A (en) Safety storage device with two-stage symmetrical encryption algorithm
WO2017050152A1 (zh) 用于移动设备的密码安全系统及其密码安全输入方法
WO2008053279A1 (en) Logging on a user device to a server
CN115150180A (zh) 存储设备管理方法、存储设备、管理设备及存储介质
US8769301B2 (en) Product authentication based upon a hyperelliptic curve equation and a curve pairing function
WO2015158173A1 (zh) 一种基于协商密钥的数据处理方法
CN107276961B (zh) 一种基于密码算法加密和解密数据的方法及装置
WO2019019153A1 (zh) 私钥生成存储及使用的方案
US9876774B2 (en) Communication security system and method
CN115396099A (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: 14883784

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14883784

Country of ref document: EP

Kind code of ref document: A1