CN105897417A - Encrypted data input method and device - Google Patents
Encrypted data input method and device Download PDFInfo
- Publication number
- CN105897417A CN105897417A CN201610207560.3A CN201610207560A CN105897417A CN 105897417 A CN105897417 A CN 105897417A CN 201610207560 A CN201610207560 A CN 201610207560A CN 105897417 A CN105897417 A CN 105897417A
- Authority
- CN
- China
- Prior art keywords
- random number
- encryption algorithm
- encrypted data
- fingerprint
- user
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/14—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic 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/065—Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
- H04L9/0656—Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
Abstract
Description
技术领域technical field
本发明涉及通信领域,特别是涉及一种加密数据输入方法及装置。The invention relates to the communication field, in particular to an encrypted data input method and device.
背景技术Background technique
随着智能手机的发展,大屏手机越来越受人们的欢迎,已成为潮流趋势。大屏手机在阅读和游戏影音方面具有优势,能够给人们带来良好的视觉体验,然而如何有效确保手机信息安全的问题也随之而来。With the development of smart phones, large-screen mobile phones are becoming more and more popular and have become a trend. Large-screen mobile phones have advantages in reading and video games, and can bring people a good visual experience. However, the problem of how to effectively ensure the security of mobile phone information also arises.
由于大屏手机屏幕较大,用户在其上进行操作时可能会导致信息泄露。如用户在密码输入过程中容易发生密码被他人看到的情况,这样会导致密码的泄露。现有技术无法确保密码等重要数据的输入安全,然而,一旦这些重要数据泄露就会严重危及到用户的个人隐私和利益。Due to the large screen of a large-screen mobile phone, information leakage may occur when users operate on it. For example, it is easy for the user to see the password by others during the password input process, which will lead to the disclosure of the password. The existing technology cannot ensure the input security of important data such as passwords, however, once these important data are leaked, the personal privacy and interests of users will be seriously endangered.
故,有必要提供一种可以确保数据输入过程安全的加密数据输入方法。Therefore, it is necessary to provide an encrypted data input method that can ensure the security of the data input process.
发明内容Contents of the invention
本发明实施例提供一种可以提高数据输入安全性的加密数据输入方法及装置;以解决现有的加密数据输入方法及装置无法确保数据输入安全的技术问题。Embodiments of the present invention provide an encrypted data input method and device that can improve data input security; to solve the technical problem that the existing encrypted data input method and device cannot ensure data input security.
本发明实施例提供一种加密数据输入方法,其包括:An embodiment of the present invention provides an encrypted data input method, which includes:
获取用户输入的第一指纹;Obtain the first fingerprint input by the user;
根据第一指纹获取数据库中对应的加密算法,并生成一随机数,其中随机数为多位数;Obtain the corresponding encryption algorithm in the database according to the first fingerprint, and generate a random number, wherein the random number is a multi-digit number;
将随机数进行展示操作;Display random numbers;
接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。Receive encrypted data input by the user, where the encrypted data is calculated by the user based on random numbers, original data and preset encryption algorithms.
本发明实施例还提供一种加密数据输入装置,其包括:The embodiment of the present invention also provides an encrypted data input device, which includes:
第一指纹获取模块,用于获取用户输入的第一指纹;The first fingerprint acquisition module is used to acquire the first fingerprint input by the user;
加密算法及随机数获取模块,用于根据第一指纹获取数据库中对应的加密算法,并生成一随机数,其中随机数为多位数;Encryption algorithm and random number acquisition module, used to acquire the corresponding encryption algorithm in the database according to the first fingerprint, and generate a random number, wherein the random number is a multi-digit number;
随机数展示模块,用于将随机数进行展示操作;The random number display module is used to display the random number;
加密数据接收模块,用于接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。The encrypted data receiving module is used to receive the encrypted data input by the user, wherein the encrypted data is calculated by the user according to the random number, the original data and the preset encryption algorithm.
相较于现有技术的加密数据输入方法及装置,本发明的加密数据输入方法及装置通过对输入的数据进行加密,从而可以有效的提高数据输入的安全性;解决了现有的加密数据输入方法及装置无法确保数据输入安全的技术问题。Compared with the encrypted data input method and device in the prior art, the encrypted data input method and device of the present invention can effectively improve the security of data input by encrypting the input data; The method and device cannot ensure the technical problem of data input security.
附图说明Description of drawings
图1为本发明的加密数据输入方法的第一优选实施例的流程图;Fig. 1 is the flowchart of the first preferred embodiment of the encrypted data input method of the present invention;
图2为本发明的加密数据输入方法的第二优选实施例的流程图;Fig. 2 is the flowchart of the second preferred embodiment of the encrypted data input method of the present invention;
图3为本发明的加密数据输入装置的第一优选实施例的结构示意图;Fig. 3 is a schematic structural diagram of the first preferred embodiment of the encrypted data input device of the present invention;
图4为本发明的加密数据输入装置的第二优选实施例的结构示意图;FIG. 4 is a schematic structural diagram of a second preferred embodiment of the encrypted data input device of the present invention;
图5为本发明的加密数据输入方法及装置的具体实施例的流程图。Fig. 5 is a flowchart of a specific embodiment of the encrypted data input method and device of the present invention.
具体实施方式detailed description
请参照图式,其中相同的组件符号代表相同的组件,本发明的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本发明具体实施例,其不应被视为限制本发明未在此详述的其它具体实施例。Referring to the drawings, wherein like reference numerals represent like components, the principles of the present invention are exemplified when implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the invention, which should not be construed as limiting other specific embodiments of the invention not described in detail herein.
在以下的说明中,本发明的具体实施例将参考由一部或多部计算机所执行之作业的步骤及符号来说明,除非另有述明。因此,其将可了解到这些步骤及操作,其中有数次提到为由计算机执行,包括了由代表了以一结构化型式中的数据之电子信号的计算机处理单元所操纵。此操纵转换该数据或将其维持在该计算机之内存系统中的位置处,其可重新配置或另外以本领域技术人员所熟知的方式来改变该计算机之运作。该数据所维持的数据结构为该内存之实体位置,其具有由该数据格式所定义的特定特性。但是,本发明原理以上述文字来说明,其并不代表为一种限制,本领域技术人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。In the following description, specific embodiments of the present invention are described with reference to steps and symbols for operations performed by one or more computers, unless otherwise stated. Accordingly, it will be understood that the steps and operations, which at times are referred to as being performed by a computer, include manipulation by a computer processing unit of electronic signals representing data in a structured form. This manipulation transforms the data or maintains it at a location in the computer's memory system that can reconfigure or otherwise alter the operation of the computer in a manner well known to those skilled in the art. The data structures maintained by the data are physical locations in the memory that have specific characteristics defined by the data format. However, the principles of the present invention are described in the above words, which are not meant to be a limitation. Those skilled in the art will understand that the various steps and operations described below can also be implemented in hardware.
本发明的加密数据输入装置可使用各种电子设备进行实施,该电子设备包括但不限于个人计算机、服务器计算机、手持式或膝上型设备、移动设备(比如移动电话、个人数字助理、媒体播放器等等)、多处理器系统、消费型电子设备、小型计算机、大型计算机、包括上述任意系统或设备的分布式计算环境,等等。但该电子设备优选为包括智能移动设备,以提高智能移动设备上数据输入的安全性。The encrypted data input apparatus of the present invention may be implemented using a variety of electronic devices including, but not limited to, personal computers, server computers, hand-held or laptop devices, mobile devices such as mobile phones, personal digital assistants, media player processors, etc.), multiprocessor systems, consumer electronics devices, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. However, the electronic device preferably comprises a smart mobile device, in order to increase the security of data entry on the smart mobile device.
实施例一Embodiment one
请参照图1,图1为本发明的加密数据输入方法的第一优选实施例的流程图。本优选实施例的加密数据输入方法包括:Please refer to FIG. 1 , which is a flowchart of a first preferred embodiment of the encrypted data input method of the present invention. The encrypted data input method of this preferred embodiment includes:
步骤S101,获取用户输入的第一指纹;Step S101, acquiring the first fingerprint input by the user;
步骤S102,根据第一指纹获取数据库中对应的加密算法,并生成一随机数,其中随机数为多位数;Step S102, obtain the corresponding encryption algorithm in the database according to the first fingerprint, and generate a random number, wherein the random number has multiple digits;
步骤S103,将随机数进行展示操作;Step S103, displaying the random number;
步骤S104,接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。Step S104, receiving encrypted data input by the user, wherein the encrypted data is calculated by the user based on random numbers, original data and a preset encryption algorithm.
下面详细说明本优选实施例的加密数据输入方法的各步骤的具体流程。The specific flow of each step of the encrypted data input method in this preferred embodiment will be described in detail below.
在步骤S101中,终端获取用户输入的第一指纹。终端获取用户输入的第一指纹,其中该终端优选为手机、平板电脑等智能移动终端。在社会生活中,我们每天都要和许许多多的密码打交道,银行卡提款需要密码,连接无线网需要密码等等。人们为了方便记忆密码,往往选择一个或几个密码作为多个账户的共用密码,这样一旦密码泄露就会危及到用户的隐私和利益,故有必要提高密码输入过程中的安全性。In step S101, the terminal acquires a first fingerprint input by a user. The terminal obtains the first fingerprint input by the user, wherein the terminal is preferably an intelligent mobile terminal such as a mobile phone or a tablet computer. In social life, we have to deal with a lot of passwords every day, bank card withdrawal requires passwords, connects to wireless networks requires passwords, and so on. For the convenience of remembering passwords, people often choose one or several passwords as the shared passwords of multiple accounts. Once the passwords are leaked, the privacy and interests of users will be endangered. Therefore, it is necessary to improve the security of the password input process.
由于指纹具有唯一性、方便性,因此在本优选实施例通过获取用户的第一指纹既可以用于对用户身份进行识别,又可以将加密算法与用户绑定,从而用户可以快速根据加密算法计算得到加密数据。这样通过对输入的数据进行加密可以大大提高数据输入过程的安全性。具体的,当用户处于火车站、商场等公共场合时,在进行密码输入时,可以选择对数据进行加密,终端接收到该加密请求后显示指纹输入界面,用于获取用户的指纹。随后转入步骤S102。Due to the uniqueness and convenience of fingerprints, in this preferred embodiment, by obtaining the user's first fingerprint, it can be used to identify the user's identity, and the encryption algorithm can be bound to the user, so that the user can quickly calculate according to the encryption algorithm. get encrypted data. In this way, the security of the data input process can be greatly improved by encrypting the input data. Specifically, when the user is in a public place such as a train station or a shopping mall, he may choose to encrypt the data when inputting a password. After receiving the encryption request, the terminal displays a fingerprint input interface for obtaining the user's fingerprint. Then go to step S102.
在步骤S102中,终端根据第一指纹获取数据库中对应的加密算法,并生成一随机数,其中随机数为多位数。具体的,该加密算法为根据数据的特点,使用随机数对该数据进行加密的一系列算法。举例来说,如数据为十进制数,则可通过对数据和随机数进行加、减、乘、除等基本四则运算方法以实现对数据的加密;如数据为二进制数,则可通过对数据和随机数进行异或、与、或等逻辑运算以实现对数据的加密。这样根据数据特点使用随机数进行加密的方法种类繁多,难以破译,有效的提高了数据输入的安全性。In step S102, the terminal acquires the corresponding encryption algorithm in the database according to the first fingerprint, and generates a random number, wherein the random number has multiple digits. Specifically, the encryption algorithm is a series of algorithms that use random numbers to encrypt the data according to the characteristics of the data. For example, if the data is a decimal number, the encryption of the data can be realized by adding, subtracting, multiplying, and dividing the data and random numbers; Random numbers are subjected to logic operations such as XOR, AND, or to realize data encryption. In this way, there are various methods of encrypting with random numbers according to data characteristics, which are difficult to decipher, and effectively improve the security of data input.
需要说明的是,随机数俗称乱数,是按随机顺序排列并服从一定概率分布律的数字,具有不确定性,即每次生成的数字都是不确定的。这样即使是通过一种加密算法,由于随机数不同,得到的加密数据也不同,从而增强了数据输入的安全性。It should be noted that random numbers, commonly known as random numbers, are numbers arranged in a random order and subject to a certain probability distribution law. They are uncertain, that is, the numbers generated each time are uncertain. In this way, even through one encryption algorithm, the encrypted data obtained is different due to different random numbers, thereby enhancing the security of data input.
在本优选实施例中,将该随机数设置为多位数可以增加加密数据破解的难度,从而进一步提高数据输入的安全性。随后转入步骤S103。In this preferred embodiment, setting the random number to a multi-digit number can increase the difficulty of decrypting encrypted data, thereby further improving the security of data input. Then go to step S103.
在步骤S103中,终端将随机数进行展示操作。具体的,终端将步骤S103中生成的随机数显示给用户,以供用户根据该随机数计算得到加密数据。随后转入步骤S104。In step S103, the terminal displays the random number. Specifically, the terminal displays the random number generated in step S103 to the user, so that the user can calculate and obtain encrypted data according to the random number. Then go to step S104.
在步骤S104中,终端接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。原始数据即需要被加密的数据,举例来说,当用户在餐厅消费后使用微信支付方式买单时,用户原本设置的支付密码123456即为原始数据。In step S104, the terminal receives encrypted data input by the user, wherein the encrypted data is calculated by the user according to random numbers, original data and a preset encryption algorithm. The original data is the data that needs to be encrypted. For example, when the user uses the WeChat payment method to pay after consumption in a restaurant, the payment password 123456 originally set by the user is the original data.
在原始数据为123456,生成的随机数为13的情况下,如预设加密算法为原始数据减去随机数,则用户将输入加密数据123443;又如预设加密算法为原始数据加上随机数,则用户将输入加密数据123469。在原始数据为123456,预设加密算法为原始数据减去随机数的情况下,如生成的随机数为11,则用户将输入加密数据123445;如生成的随机数为21,则用户将输入加密数据123435。综上可知,预设加密算法的不同、生成的随机数的不同都会使用户输入的加密数据不同,因此加大了人们对加密数据破解的难度,从而提高了数据输入的安全性。In the case where the original data is 123456 and the generated random number is 13, if the preset encryption algorithm is the original data minus the random number, the user will input the encrypted data 123443; and if the preset encryption algorithm is the original data plus the random number , the user will enter the encrypted data 123469. In the case where the original data is 123456 and the preset encryption algorithm is the original data minus the random number, if the generated random number is 11, the user will input the encrypted data 123445; if the generated random number is 21, the user will input the encrypted data Data 123435. To sum up, it can be seen that the difference in the preset encryption algorithm and the difference in the generated random number will make the encrypted data input by the user different, thus increasing the difficulty for people to decipher the encrypted data, thereby improving the security of data input.
这样即完成了本优选实施例的加密数据输入方法的加密数据输入过程。In this way, the encrypted data input process of the encrypted data input method in this preferred embodiment is completed.
本优选实施例的加密数据输入方法通过使用多位随机数对输入的数据进行加密,由于每次生成的随机数都不一样,因此即使在相同加密算法的情况下每次加密生成的加密数据都不一样,从而大大的提高了加密数据被破解的难度,进而提高了加密数据输入的安全性,并有效的保护了原始数据。The encrypted data input method of this preferred embodiment encrypts the input data by using multi-bit random numbers. Since the random numbers generated each time are different, even under the same encryption algorithm, the encrypted data generated by each encryption is different. Not the same, which greatly increases the difficulty of decrypting encrypted data, thereby improving the security of encrypted data input, and effectively protecting the original data.
实施例二Embodiment two
请参照图2,图2为本发明的加密数据输入方法的第二优选实施例的流程图。本优选实施例的加密数据输入方法包括:Please refer to FIG. 2 , which is a flowchart of a second preferred embodiment of the encrypted data input method of the present invention. The encrypted data input method of this preferred embodiment includes:
步骤S201,获取用户输入的第一指纹;Step S201, acquiring the first fingerprint input by the user;
步骤S202,判断第一指纹是否与数据库中的第二指纹匹配;Step S202, judging whether the first fingerprint matches the second fingerprint in the database;
步骤S203,如步骤S202中第一指纹与第二指纹不匹配,则提示用户指纹输入错误;Step S203, if the first fingerprint does not match the second fingerprint in step S202, prompting the user to input wrong fingerprint;
步骤S204,如步骤S202中第一指纹与第二指纹匹配,则获取第二指纹对应的加密算法,并生成一随机数,其中随机数为多位数;Step S204, if the first fingerprint matches the second fingerprint in step S202, then obtain the encryption algorithm corresponding to the second fingerprint, and generate a random number, wherein the random number is a multi-digit number;
步骤S205,将随机数进行展示操作;Step S205, displaying the random number;
步骤S206,接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。Step S206, receiving the encrypted data input by the user, wherein the encrypted data is calculated by the user according to the random number, the original data and the preset encryption algorithm.
下面详细说明本优选实施例的加密数据输入方法的各步骤的具体流程。The specific flow of each step of the encrypted data input method in this preferred embodiment will be described in detail below.
在步骤S201中,终端获取用户输入的第一指纹。终端获取用户输入的第一指纹,其中该终端优选为手机、平板电脑等智能移动终端。在社会生活中,我们每天都要和许许多多的密码打交道,银行卡提款需要密码,连接无线网需要密码等等。人们为了方便记忆密码,往往选择一个或几个密码作为多个账户的共用密码,这样一旦密码泄露就会危及到用户的隐私和利益,故有必要提高密码输入过程中的安全性。In step S201, the terminal acquires the first fingerprint input by the user. The terminal obtains the first fingerprint input by the user, wherein the terminal is preferably an intelligent mobile terminal such as a mobile phone or a tablet computer. In social life, we have to deal with a lot of passwords every day, bank card withdrawal requires passwords, connects to wireless networks requires passwords, and so on. For the convenience of remembering passwords, people often choose one or several passwords as the shared passwords of multiple accounts. Once the passwords are leaked, the privacy and interests of users will be endangered. Therefore, it is necessary to improve the security of the password input process.
由于指纹具有唯一性、方便性,因此在本优选实施例通过获取用户的第一指纹既可以用于对用户身份进行识别,又可以将加密算法与用户绑定,从而用户可以快速根据加密算法计算得到加密数据。这样通过对输入的数据进行加密可以大大提高数据输入过程的安全性。具体的,当用户处于火车站、商场等公共场合时,在进行密码输入时,可以选择对数据进行加密,终端接收到该加密请求后显示指纹输入界面,用于获取用户的指纹。随后转入步骤S202。Due to the uniqueness and convenience of fingerprints, in this preferred embodiment, by obtaining the user's first fingerprint, it can be used to identify the user's identity, and the encryption algorithm can be bound to the user, so that the user can quickly calculate according to the encryption algorithm. get encrypted data. In this way, the security of the data input process can be greatly improved by encrypting the input data. Specifically, when the user is in a public place such as a train station or a shopping mall, he may choose to encrypt the data when inputting a password. After receiving the encryption request, the terminal displays a fingerprint input interface for obtaining the user's fingerprint. Then go to step S202.
在步骤S202中,终端判断第一指纹是否与数据库中的第二指纹匹配,如不匹配,则转入步骤S203;如匹配,则转入步骤S204。需要说明的是,该数据库中包含第二指纹、加密算法及二者的关联关系,具体的建立过程如下:首先,终端获取用户的第二指纹;接着,终端获取加密算法;最后,终端存储第二指纹、加密算法及二者的关联关系,以建立数据库。其中,该第二指纹和加密算法的对应关系可以是一对一、一对多或多对多,通过将第二指纹与加密算法绑定可以确保用户知道加密算法的具体计算过程。In step S202, the terminal judges whether the first fingerprint matches the second fingerprint in the database, if not, proceeds to step S203; if matches, proceeds to step S204. It should be noted that the database includes the second fingerprint, the encryption algorithm and the relationship between them. The specific establishment process is as follows: first, the terminal obtains the user's second fingerprint; then, the terminal obtains the encryption algorithm; finally, the terminal stores the second fingerprint of the user. Two fingerprints, encryption algorithms and the relationship between the two to establish a database. Wherein, the correspondence between the second fingerprint and the encryption algorithm can be one-to-one, one-to-many or many-to-many, and binding the second fingerprint to the encryption algorithm can ensure that the user knows the specific calculation process of the encryption algorithm.
在步骤S203中,如步骤S202中第一指纹与第二指纹不匹配,则终端提示用户指纹输入错误。优选的,终端提示用户指纹输入错误后,可进一步提示用户是否选择输入初始数据,这样可以使急于进行数据输入的用户快速输入数据。In step S203, if the first fingerprint does not match the second fingerprint in step S202, the terminal prompts the user to input an incorrect fingerprint. Preferably, after the terminal prompts the user to input wrong fingerprints, the terminal may further prompt the user whether to choose to input initial data, so that the user who is eager to input data can quickly input data.
在步骤S204中,如步骤S202中第一指纹与第二指纹匹配,则终端获取该第二指纹对应的加密算法,并生成一随机数,其中随机数为多位数。该加密算法为根据数据的特点,使用随机数对该数据进行加密的一系列算法。举例来说,如数据为十进制数,则可通过对数据和随机数进行加、减、乘、除等基本四则运算方法以实现对数据的加密;如数据为二进制数,则可通过对数据和随机数进行异或、与、或等逻辑运算以实现对数据的加密。这样根据数据特点使用随机数进行加密的方法种类繁多,难以破译,有效的提高了数据输入的安全性。In step S204, if the first fingerprint matches the second fingerprint in step S202, the terminal obtains the encryption algorithm corresponding to the second fingerprint, and generates a random number, wherein the random number has multiple digits. The encryption algorithm is a series of algorithms that use random numbers to encrypt the data according to the characteristics of the data. For example, if the data is a decimal number, the encryption of the data can be realized by adding, subtracting, multiplying, and dividing the data and random numbers; Random numbers are subjected to logic operations such as XOR, AND, or to realize data encryption. In this way, there are various methods of encrypting with random numbers according to data characteristics, which are difficult to decipher, and effectively improve the security of data input.
具体的,该加密算法至少包括相加加密算法、相减加密算法、相乘加密算法、相除加密算法、异或加密算法、或加密算法、与加密算法中的一种。接下来将对以上算法进行具体介绍。Specifically, the encryption algorithm includes at least one of an addition encryption algorithm, a subtraction encryption algorithm, a multiplication encryption algorithm, a division encryption algorithm, an XOR encryption algorithm, or an encryption algorithm and an encryption algorithm. Next, the above algorithm will be introduced in detail.
首先,以原始数据233985,随机数123456为例对相加加密算法、相减加密算法、相乘加密算法、相除加密算法进行说明。First, take the original data 233985 and the random number 123456 as examples to illustrate the addition encryption algorithm, subtraction encryption algorithm, multiplication encryption algorithm, and division encryption algorithm.
其中,相加加密算法为将随机数123456与原始数据233985的按位相加,并保留相加后每一位的最低位,得到加密数据356331。优选的,相加加密算法还可以是将随机数123456与原始数据233985相加,得到加密数据357441。Among them, the addition encryption algorithm is to add the random number 123456 and the original data 233985 bit by bit, and keep the lowest bit of each bit after the addition to obtain the encrypted data 356331. Preferably, the addition encryption algorithm can also be to add the random number 123456 and the original data 233985 to obtain the encrypted data 357441.
相减加密算法为将原始数据233985与随机数123456按位相减,并取相减后每一位的绝对值,得到加密数据110531。优选的,该相减加密算法还可以是将原始数据233985与随机数123456相减,并取相减后的绝对值,得到加密数据110529。The subtraction encryption algorithm is to subtract the original data 233985 and the random number 123456 bit by bit, and take the absolute value of each bit after the subtraction to obtain the encrypted data 110531. Preferably, the subtraction encryption algorithm can also subtract the original data 233985 and the random number 123456, and take the absolute value after subtraction to obtain the encrypted data 110529.
相乘加密算法为将随机数123456与原始数据233985按位相乘,并保留相乘后每一位的最低位,得到加密数据269600。The multiplication encryption algorithm is to multiply the random number 123456 and the original data 233985 bit by bit, and retain the lowest bit of each bit after multiplication to obtain the encrypted data 269600.
相除加密算法为将原始数据233985与随机数123456按位相除,并保留相除后每一位的整数部分,得到加密数据211210。The division encryption algorithm is to divide the original data 233985 and the random number 123456 bit by bit, and keep the integer part of each bit after division to obtain the encrypted data 211210.
接着,以原始数据110101,随机数1011为例,对异或加密算法、或加密算法、与加密算法进行描述。由于随机数的位数小于原始数据的位数,因此对随机数1011的末位进行补0操作后,得到随机数101100。同理的,如果随机数为1100010101,则该随机数1100010101的位数大于原始数据的位数,因此对舍去该随机数1100010101的末位,得到随机数110001。Next, taking the original data 110101 and the random number 1011 as examples, the XOR encryption algorithm, or the encryption algorithm, and the encryption algorithm are described. Since the number of digits of the random number is smaller than that of the original data, the random number 101100 is obtained after the last digit of the random number 1011 is filled with 0. Similarly, if the random number is 1100010101, the number of digits of the random number 1100010101 is greater than the number of digits of the original data, so the last digit of the random number 1100010101 is discarded to obtain the random number 110001.
其中,异或加密算法为将随机数101100与原始数据110101按位进行异或运算,得到加密数据011001。Wherein, the XOR encryption algorithm is to perform a bitwise XOR operation on the random number 101100 and the original data 110101 to obtain the encrypted data 011001.
或加密算法为将随机数101100与原始数据110101按位进行或运算,得到加密数据111101。Or the encryption algorithm is to perform a bitwise OR operation on the random number 101100 and the original data 110101 to obtain the encrypted data 111101.
与加密算法为将随机数101100与原始数据110101按位进行与运算,得到加密数据100100。The AND encryption algorithm is to perform a bitwise AND operation on the random number 101100 and the original data 110101 to obtain the encrypted data 100100.
需要说明的是,上述加密具体如何将随机数与原始数据进行加密计算,可以由用户自己设定,此处不做具体限定。It should be noted that how the above-mentioned encryption performs the encryption calculation of the random number and the original data can be set by the user, and is not specifically limited here.
需要说明的是,随机数俗称乱数,是按随机顺序排列并服从一定概率分布律的数字,具有不确定性,即每次生成的数字都是不确定的。这样即使是通过一种加密算法,由于随机数不同,得到的加密数据也不同,从而增强了数据输入的安全性。It should be noted that random numbers, commonly known as random numbers, are numbers arranged in a random order and subject to a certain probability distribution law. They are uncertain, that is, the numbers generated each time are uncertain. In this way, even through one encryption algorithm, the encrypted data obtained is different due to different random numbers, thereby enhancing the security of data input.
在本优选实施例中,将该随机数设置为多位数可以增加加密数据破解的难度,从而进一步提高数据输入的安全性。优选的,如随机数0110的位数小于原始数据1010010的位数,可以通过在随机数0110首位补0得到0000110,也可以通过在随机数0110首位补1得到1110110,还可以通过在随机数0110末位补1得到0110111等等方法对随机数进行处理,以得到与原始数据相同位数的随机数,从而方便二者的计算。同理,如随机数0110101的位数大于原始数据1011的位数,可以通过舍去随机数0110101的末位得到随机数0110,也可以通过舍去随机数0110101的首位得到随机数0101等等方法对随机数进行处理。需要说明的是,相关的处理方法可以由用户自己确定,此处不作具体限定。In this preferred embodiment, setting the random number to a multi-digit number can increase the difficulty of decrypting encrypted data, thereby further improving the security of data input. Preferably, if the number of digits of the random number 0110 is less than the number of digits of the original data 1010010, 0000110 can be obtained by adding 0 to the first digit of the random number 0110, or 1110110 can be obtained by adding 1 to the first digit of the random number 0110, or by adding 1 to the first digit of the random number 0110 Add 1 to the last digit to get 0110111 and so on to process the random number to obtain a random number with the same number of digits as the original data, so as to facilitate the calculation of the two. Similarly, if the number of digits of the random number 0110101 is greater than that of the original data 1011, the random number 0110 can be obtained by discarding the last digit of the random number 0110101, or the random number 0101 can be obtained by discarding the first digit of the random number 0110101, etc. Handle random numbers. It should be noted that the relevant processing method may be determined by the user himself, which is not specifically limited here.
同时,在本优选实施例中不仅可以通过将随机数处理成与原始数据具有相同位数的随机数,也可以使用不同位数的随机数与原始数据进行计算,如直接将原始数据2031与随机数11相加,得到加密数据2042。需要说明的是,此处列举不做具体限定。随后转入步骤S205。At the same time, in this preferred embodiment, not only can the random number be processed into a random number with the same number of digits as the original data, but also a random number with a different number of digits and the original data can be used for calculation, such as directly combining the original data 2031 with the random number The number 11 is added to obtain the encrypted data 2042. It should be noted that the examples listed here are not specifically limited. Then go to step S205.
在步骤S205中,终端将随机数进行展示操作。具体的,终端将步骤S204中生成的随机数显示给用户,以供用户根据该随机数计算得到加密数据。随后转入步骤S206。In step S205, the terminal displays the random number. Specifically, the terminal displays the random number generated in step S204 to the user, so that the user can calculate and obtain encrypted data according to the random number. Then go to step S206.
在步骤S206中终端接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。原始数据即需要被加密的数据,举例来说,当用户在餐厅消费后使用微信支付方式买单时,用户原本设置的支付密码123456即为原始数据。In step S206, the terminal receives the encrypted data input by the user, wherein the encrypted data is calculated by the user according to the random number, the original data and the preset encryption algorithm. The original data is the data that needs to be encrypted. For example, when the user uses the WeChat payment method to pay after consumption in a restaurant, the payment password 123456 originally set by the user is the original data.
需要说明的是,该预设加密算法为上文描述的加密算法中的一种。在原始数据为123456,生成的随机数为13的情况下,如预设加密算法为原始数据减去随机数,则用户将输入加密数据123443;又如预设加密算法为原始数据加上随机数,则用户将输入加密数据123469。在原始数据为123456,预设加密算法为原始数据减去随机数的情况下,如生成的随机数为11,则用户将输入加密数据123445;如生成的随机数为21,则用户将输入加密数据123435。综上可知,预设加密算法的不同、生成的随机数的不同都会使用户输入的加密数据不同,因此加大了人们对加密数据破解的难度,从而提高了数据输入的安全性。It should be noted that the preset encryption algorithm is one of the encryption algorithms described above. In the case where the original data is 123456 and the generated random number is 13, if the preset encryption algorithm is the original data minus the random number, the user will input the encrypted data 123443; and if the preset encryption algorithm is the original data plus the random number , the user will enter the encrypted data 123469. In the case where the original data is 123456 and the preset encryption algorithm is the original data minus the random number, if the generated random number is 11, the user will input the encrypted data 123445; if the generated random number is 21, the user will input the encrypted data Data 123435. To sum up, it can be seen that the difference in the preset encryption algorithm and the difference in the generated random number will make the encrypted data input by the user different, thus increasing the difficulty for people to decipher the encrypted data, thereby improving the security of data input.
这样即完成了本优选实施例的加密数据输入方法的加密数据输入过程。In this way, the encrypted data input process of the encrypted data input method in this preferred embodiment is completed.
在第一优选实施例的基础上,本优选实施例的加密数据输入方法详细描述了使用多位随机数进行加密的相关算法,由于随机数为多位数,处理方法复杂,且相关算法种类繁多,因而他人破解难度大,从而进一步提高了数据输入的安全性。On the basis of the first preferred embodiment, the encrypted data input method of this preferred embodiment describes in detail the related algorithms that use multi-digit random numbers for encryption. Since the random numbers are multi-digit, the processing method is complicated, and there are many types of related algorithms , so it is very difficult for others to crack, thereby further improving the security of data input.
实施例三Embodiment Three
请参照图3,图3为本发明的加密数据输入装置的第一优选实施例的结构图。本优选实施例的加密数据输入装置30包括第一指纹获取模块301、加密算法和随机数获取模块302、随机数展示模块303及加密数据接收模块304。其中,第一指纹获取模块301用于获取用户输入的第一指纹;加密算法和随机数获取模块302用于根据第一指纹获取数据库中对应的加密算法,并生成一随机数,其中随机数为多位数;随机数展示模块303用于将随机数进行展示操作;加密数据接收模块304用于接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。Please refer to FIG. 3 , which is a structural diagram of a first preferred embodiment of the encrypted data input device of the present invention. The encrypted data input device 30 of this preferred embodiment includes a first fingerprint acquisition module 301 , an encryption algorithm and random number acquisition module 302 , a random number display module 303 and an encrypted data receiving module 304 . Wherein, the first fingerprint acquisition module 301 is used to acquire the first fingerprint input by the user; the encryption algorithm and random number acquisition module 302 is used to acquire the corresponding encryption algorithm in the database according to the first fingerprint, and generate a random number, wherein the random number is Multiple digits; the random number display module 303 is used to display the random number; the encrypted data receiving module 304 is used to receive the encrypted data input by the user, wherein the encrypted data is calculated by the user according to the random number, the original data and the preset encryption algorithm out.
本加密数据输入装置30使用时,首先第一指纹获取模块301获取用户输入的第一指纹。在社会生活中,我们每天都要和许许多多的密码打交道,银行卡提款需要密码,连接无线网需要密码等等。人们为了方便记忆密码,往往选择一个或几个密码作为多个账户的共用密码,这样一旦密码泄露就会危及到用户的隐私和利益,故有必要提高密码输入过程中的安全性。When the encrypted data input device 30 is used, firstly, the first fingerprint acquisition module 301 acquires the first fingerprint input by the user. In social life, we have to deal with a lot of passwords every day, bank card withdrawal requires passwords, connects to wireless networks requires passwords, and so on. For the convenience of remembering passwords, people often choose one or several passwords as the shared passwords of multiple accounts. Once the passwords are leaked, the privacy and interests of users will be endangered. Therefore, it is necessary to improve the security of the password input process.
由于指纹具有唯一性、方便性,因此在本优选实施例通过第一指纹获取模块301获取用户的第一指纹既可以用于对用户身份进行识别,又可以将加密算法与用户绑定,从而用户可以快速根据加密算法计算得到加密数据。这样通过对输入的数据进行加密可以大大提高数据输入过程的安全性。具体的,当用户处于火车站、商场等公共场合时,在进行密码输入时可以选择对数据进行加密,在接收到该加密请求后会显示指纹输入界面,这样第一指纹获取模块301即可获取用户输入的指纹。随后调用加密算法和随机数获取模块302。Due to the uniqueness and convenience of fingerprints, the acquisition of the user's first fingerprint by the first fingerprint acquisition module 301 in this preferred embodiment can be used to identify the user's identity, and the encryption algorithm can be bound with the user, so that the user The encrypted data can be quickly calculated according to the encryption algorithm. In this way, the security of the data input process can be greatly improved by encrypting the input data. Specifically, when the user is in a public place such as a train station or a shopping mall, he can choose to encrypt the data when entering a password, and the fingerprint input interface will be displayed after receiving the encryption request, so that the first fingerprint acquisition module 301 can acquire The fingerprint entered by the user. Then the encryption algorithm and random number acquisition module 302 is called.
然后,加密算法和随机数获取模块302根据第一指纹获取数据库中对应的加密算法,并生成一随机数,其中随机数为多位数。具体的,该加密算法为根据数据的特点,使用随机数对该数据进行加密的一系列算法。举例来说,如数据为十进制数,则可通过对数据和随机数进行加、减、乘、除等基本四则运算方法以实现对数据的加密;如数据为二进制数,则可通过对数据和随机数进行异或、与、或等逻辑运算以实现对数据的加密。这样根据数据特点使用随机数进行加密的方法种类繁多,难以破译,有效的提高了数据输入的安全性。Then, the encryption algorithm and random number acquisition module 302 acquires the corresponding encryption algorithm in the database according to the first fingerprint, and generates a random number, wherein the random number has multiple digits. Specifically, the encryption algorithm is a series of algorithms that use random numbers to encrypt the data according to the characteristics of the data. For example, if the data is a decimal number, the encryption of the data can be realized by adding, subtracting, multiplying, and dividing the data and random numbers; Random numbers are subjected to logic operations such as XOR, AND, or to realize data encryption. In this way, there are various methods of encrypting with random numbers according to data characteristics, which are difficult to decipher, and effectively improve the security of data input.
需要说明的是,随机数俗称乱数,是按随机顺序排列并服从一定概率分布律的数字,具有不确定性,即每次生成的数字都是不确定的。这样即使是通过一种加密算法,由于随机数不同,得到的加密数据也不同,从而增强了数据输入的安全性。It should be noted that random numbers, commonly known as random numbers, are numbers arranged in a random order and subject to a certain probability distribution law. They are uncertain, that is, the numbers generated each time are uncertain. In this way, even through one encryption algorithm, the encrypted data obtained is different due to different random numbers, thereby enhancing the security of data input.
在本优选实施例中,将该随机数设置为多位数可以增加加密数据破解的难度,从而进一步提高数据输入的安全性。随后调用随机数展示模块303。In this preferred embodiment, setting the random number to a multi-digit number can increase the difficulty of decrypting encrypted data, thereby further improving the security of data input. Then the random number display module 303 is called.
接着,随机数展示模块303将随机数进行展示操作。具体的,随机数展示模块303将加密算法和随机数获取模块302生成的随机数显示给用户,以供用户根据该随机数计算得到加密数据。随后调用加密数据接收模块304。Next, the random number display module 303 performs a display operation on the random number. Specifically, the random number display module 303 displays the encryption algorithm and the random number generated by the random number acquisition module 302 to the user, so that the user can calculate and obtain encrypted data according to the random number. Then the encrypted data receiving module 304 is called.
最后,加密数据接收模块304接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。原始数据即需要被加密的数据,举例来说,当用户在餐厅消费后使用微信支付方式买单时,用户原本设置的支付密码123456即为原始数据。Finally, the encrypted data receiving module 304 receives the encrypted data input by the user, wherein the encrypted data is calculated by the user according to random numbers, original data and a preset encryption algorithm. The original data is the data that needs to be encrypted. For example, when the user uses the WeChat payment method to pay after consumption in a restaurant, the payment password 123456 originally set by the user is the original data.
在原始数据为123456,生成的随机数为3的情况下,如预设加密算法为原始数据减去随机数,则用户将输入加密数据123453;又如预设加密算法为原始数据加上随机数,则用户将输入加密数据123459。在原始数据为123456,预设加密算法为原始数据减去随机数的情况下,如生成的随机数为1,则用户将输入加密数据123455;如生成的随机数为2,则用户将输入加密数据123454。综上可知,预设加密算法的不同、生成的随机数的不同都会使用户输入的加密数据不同,因此加大了人们对加密数据破解的难度,从而提高了数据输入的安全性。In the case where the original data is 123456 and the generated random number is 3, if the preset encryption algorithm is the original data minus the random number, the user will input the encrypted data 123453; and if the preset encryption algorithm is the original data plus the random number , the user will enter encrypted data 123459. In the case where the original data is 123456 and the preset encryption algorithm is the original data minus the random number, if the generated random number is 1, the user will input the encrypted data 123455; if the generated random number is 2, the user will input the encrypted data Data 123454. To sum up, it can be seen that the difference in the preset encryption algorithm and the difference in the generated random number will make the encrypted data input by the user different, thus increasing the difficulty for people to decipher the encrypted data, thereby improving the security of data input.
这样即完成了本优选实施例的加密数据输入装置的加密数据输入过程。In this way, the encrypted data input process of the encrypted data input device of the preferred embodiment is completed.
本优选实施例的加密数据输入装置通过使用多位随机数对输入的数据进行加密,由于每次生成的随机数都不一样,因此即使在相同加密算法的情况下每次加密生成的加密数据都不一样,从而大大的提高了加密数据被破解的难度,进而提高了加密数据输入的安全性,并有效的保护了原始数据。The encrypted data input device of this preferred embodiment encrypts the input data by using multi-bit random numbers. Since the random numbers generated each time are different, even under the same encryption algorithm, the encrypted data generated by each encryption is different. Not the same, which greatly increases the difficulty of decrypting encrypted data, thereby improving the security of encrypted data input, and effectively protecting the original data.
实施例四Embodiment Four
请参照图4,图4为本发明的加密数据输入装置的第二优选实施例的结构图。本优选实施例的加密数据输入装置40包括第一指纹获取模块401、加密算法和随机数获取模块402、随机数展示模块403及加密数据接收模块404。其中,加密算法和随机数获取模块402还包括第二指纹获取单元4021、加密算法获取单元4022、数据库建立单元4023、指纹匹配判断单元4024、加密算法和随机数获取单元4025及提示单元4026。Please refer to FIG. 4 , which is a structural diagram of a second preferred embodiment of the encrypted data input device of the present invention. The encrypted data input device 40 of this preferred embodiment includes a first fingerprint acquisition module 401 , an encryption algorithm and random number acquisition module 402 , a random number display module 403 and an encrypted data receiving module 404 . Wherein, the encryption algorithm and random number acquisition module 402 also includes a second fingerprint acquisition unit 4021, an encryption algorithm acquisition unit 4022, a database establishment unit 4023, a fingerprint matching judgment unit 4024, an encryption algorithm and random number acquisition unit 4025, and a prompt unit 4026.
本优选实施例的加密数据输入装置在第一优选实施例的基础上做了细化,其中,第二指纹获取单元401用于获取用户的第二指纹;加密算法获取单元402用于获取加密算法;数据库建立单元403用于存储第二指纹、加密算法及二者的关联关系,以建立数据库;指纹匹配判断单元404用于判断第一指纹是否与数据库中的第二指纹匹配;加密算法和随机数获取单元405用于在匹配时,获取第二指纹对应的加密算法,并生成一随机数;提示单元406用于在不匹配时,提示用户指纹输入错误。The encrypted data input device of this preferred embodiment is refined on the basis of the first preferred embodiment, wherein the second fingerprint acquisition unit 401 is used to acquire the user's second fingerprint; the encryption algorithm acquisition unit 402 is used to acquire the encryption algorithm The database building unit 403 is used to store the second fingerprint, the encryption algorithm and the association between the two, so as to set up the database; the fingerprint matching judging unit 404 is used to judge whether the first fingerprint matches the second fingerprint in the database; the encryption algorithm and random The number obtaining unit 405 is used for obtaining the encryption algorithm corresponding to the second fingerprint when matching, and generating a random number; the prompting unit 406 is used for prompting the user to input wrong fingerprint when not matching.
加密数据输入装置40使用时,首先,第一指纹获取模块401获取用户输入的第一指纹。在社会生活中,我们每天都要和许许多多的密码打交道,银行卡提款需要密码,连接无线网需要密码等等。人们为了方便记忆密码,往往选择一个或几个密码作为多个账户的共用密码,这样一旦密码泄露就会危及到用户的隐私和利益,故有必要提高密码输入过程中的安全性。When the encrypted data input device 40 is used, first, the first fingerprint acquisition module 401 acquires the first fingerprint input by the user. In social life, we have to deal with a lot of passwords every day, bank card withdrawal requires passwords, connects to wireless networks requires passwords, and so on. For the convenience of remembering passwords, people often choose one or several passwords as the shared passwords of multiple accounts. Once the passwords are leaked, the privacy and interests of users will be endangered. Therefore, it is necessary to improve the security of the password input process.
由于指纹具有唯一性、方便性,因此在本优选实施例通过获取用户的第一指纹既可以用于对用户身份进行识别,又可以将加密算法与用户绑定,从而用户可以快速根据加密算法计算得到加密数据。这样通过对输入的数据进行加密可以大大提高数据输入过程的安全性。具体的,当用户处于火车站、商场等公共场合时,在进行密码输入时可以选择对数据进行加密,在接收到该加密请求后会显示指纹输入界面,这样第一指纹获取模块401即可获取用户输入的指纹。随后调用加密算法和随机数获取模块402中的指纹匹配判断单元4024。Due to the uniqueness and convenience of fingerprints, in this preferred embodiment, by obtaining the user's first fingerprint, it can be used to identify the user's identity, and the encryption algorithm can be bound to the user, so that the user can quickly calculate according to the encryption algorithm. get encrypted data. In this way, the security of the data input process can be greatly improved by encrypting the input data. Specifically, when the user is in a public place such as a train station or a shopping mall, he can choose to encrypt the data when entering a password, and the fingerprint input interface will be displayed after receiving the encryption request, so that the first fingerprint acquisition module 401 can acquire The fingerprint entered by the user. Then call the fingerprint matching judgment unit 4024 in the encryption algorithm and random number acquisition module 402 .
然后,指纹匹配判断单元4024判断第一指纹是否与数据库中的第二指纹匹配,如不匹配,则调用加密算法和随机数获取模块402中的提示单元4026;如匹配,则调用加密算法和随机数获取模块402中的加密算法和随机数获取单元4025。需要说明的是,该数据库中包含第二指纹、加密算法及二者的关联关系,具体的建立过程如下:首先,加密算法和随机数获取模块402中的第二指纹获取单元4021获取用户的第二指纹;接着,加密算法和随机数获取模块402中的加密算法获取单元4022获取加密算法;最后,加密算法和随机数获取模块402中的数据库建立单元4023存储第二指纹、加密算法及二者的关联关系,以建立数据库。其中,该第二指纹和加密算法的对应关系可以是一对一、一对多或多对多,通过将第二指纹与加密算法绑定可以确保用户知道加密算法的具体计算过程。Then, the fingerprint matching judging unit 4024 judges whether the first fingerprint matches the second fingerprint in the database, and if it does not match, then calls the encryption algorithm and the prompt unit 4026 in the random number acquisition module 402; The encryption algorithm in the number acquisition module 402 and the random number acquisition unit 4025. It should be noted that the database includes the second fingerprint, the encryption algorithm and the relationship between the two. The specific establishment process is as follows: first, the second fingerprint acquisition unit 4021 in the encryption algorithm and random number acquisition module 402 acquires the user's second fingerprint. Two fingerprints; then, the encryption algorithm and the encryption algorithm acquisition unit 4022 in the random number acquisition module 402 acquire the encryption algorithm; finally, the encryption algorithm and the database establishment unit 4023 in the random number acquisition module 402 store the second fingerprint, the encryption algorithm and both relationship to create a database. Wherein, the correspondence between the second fingerprint and the encryption algorithm can be one-to-one, one-to-many or many-to-many, and binding the second fingerprint to the encryption algorithm can ensure that the user knows the specific calculation process of the encryption algorithm.
如指纹匹配判断单元4024判断第一指纹与第二指纹不匹配,则提示单元4026提示用户指纹输入错误。提示单元4026提示用户指纹输入错误后,可进一步提示用户是否选择输入初始数据,这样可以使急于进行数据输入的用户快速输入数据。If the fingerprint matching judging unit 4024 judges that the first fingerprint does not match the second fingerprint, the prompting unit 4026 prompts the user to input an incorrect fingerprint. After the prompting unit 4026 prompts the user to input wrong fingerprints, it can further prompt the user whether to choose to input initial data, so that the user who is eager to input data can quickly input data.
如指纹匹配判断单元4024判断第一指纹与第二指纹匹配,则加密算法和随机数获取单元4025获取该第二指纹对应的加密算法,并生成一随机数,其中随机数为多位数。该加密算法为根据数据的特点,使用随机数对该数据进行加密的一系列算法。举例来说,如数据为十进制数,则可通过对数据和随机数进行加、减、乘、除等基本四则运算方法以实现对数据的加密;如数据为二进制数,则可通过对数据和随机数进行异或、与、或等逻辑运算以实现对数据的加密。这样根据数据特点使用随机数进行加密的方法种类繁多,难以破译,有效的提高了数据输入的安全性。If the fingerprint matching judgment unit 4024 judges that the first fingerprint matches the second fingerprint, the encryption algorithm and random number acquisition unit 4025 acquires the encryption algorithm corresponding to the second fingerprint, and generates a random number, wherein the random number has multiple digits. The encryption algorithm is a series of algorithms that use random numbers to encrypt the data according to the characteristics of the data. For example, if the data is a decimal number, the encryption of the data can be realized by adding, subtracting, multiplying, and dividing the data and random numbers; Random numbers are subjected to logic operations such as XOR, AND, or to realize data encryption. In this way, there are various methods of encrypting with random numbers according to data characteristics, which are difficult to decipher, and effectively improve the security of data input.
具体的,该加密算法至少包括相加加密算法、相减加密算法、相乘加密算法、相除加密算法、异或加密算法、或加密算法、与加密算法中的一种。接下来将对以上算法进行具体介绍。Specifically, the encryption algorithm includes at least one of an addition encryption algorithm, a subtraction encryption algorithm, a multiplication encryption algorithm, a division encryption algorithm, an XOR encryption algorithm, or an encryption algorithm and an encryption algorithm. Next, the above algorithm will be introduced in detail.
具体的,该加密算法至少包括相加加密算法、相减加密算法、相乘加密算法、相除加密算法、异或加密算法、或加密算法、与加密算法中的一种。接下来将对以上算法进行具体介绍。Specifically, the encryption algorithm includes at least one of an addition encryption algorithm, a subtraction encryption algorithm, a multiplication encryption algorithm, a division encryption algorithm, an XOR encryption algorithm, or an encryption algorithm and an encryption algorithm. Next, the above algorithm will be introduced in detail.
首先,以原始数据233985,随机数123456为例对相加加密算法、相减加密算法、相乘加密算法、相除加密算法进行说明。First, take the original data 233985 and the random number 123456 as examples to illustrate the addition encryption algorithm, subtraction encryption algorithm, multiplication encryption algorithm, and division encryption algorithm.
其中,相加加密算法为将随机数123456与原始数据233985的按位相加,并保留相加后每一位的最低位,得到加密数据356331。优选的,相加加密算法还可以是将随机数123456与原始数据233985相加,得到加密数据357441。Among them, the addition encryption algorithm is to add the random number 123456 and the original data 233985 bit by bit, and keep the lowest bit of each bit after the addition to obtain the encrypted data 356331. Preferably, the addition encryption algorithm can also be to add the random number 123456 and the original data 233985 to obtain the encrypted data 357441.
相减加密算法为将原始数据233985与随机数123456按位相减,并取相减后每一位的绝对值,得到加密数据110531。优选的,该相减加密算法还可以是将原始数据233985与随机数123456相减,并取相减后的绝对值,得到加密数据110529。The subtraction encryption algorithm is to subtract the original data 233985 and the random number 123456 bit by bit, and take the absolute value of each bit after the subtraction to obtain the encrypted data 110531. Preferably, the subtraction encryption algorithm can also subtract the original data 233985 and the random number 123456, and take the absolute value after subtraction to obtain the encrypted data 110529.
相乘加密算法为将随机数123456与原始数据233985按位相乘,并保留相乘后每一位的最低位,得到加密数据269600。The multiplication encryption algorithm is to multiply the random number 123456 and the original data 233985 bit by bit, and retain the lowest bit of each bit after multiplication to obtain the encrypted data 269600.
相除加密算法为将原始数据233985与随机数123456按位相除,并保留相除后每一位的整数部分,得到加密数据211210。The division encryption algorithm is to divide the original data 233985 and the random number 123456 bit by bit, and keep the integer part of each bit after division to obtain the encrypted data 211210.
接着,以原始数据110101,随机数1011为例,对异或加密算法、或加密算法、与加密算法进行描述。由于随机数的位数小于原始数据的位数,因此对随机数1011的末位进行补0操作后,得到随机数101100。同理的,如果随机数为1100010101,则该随机数1100010101的位数大于原始数据的位数,因此对舍去该随机数1100010101的末位,得到随机数110001。Next, taking the original data 110101 and the random number 1011 as examples, the XOR encryption algorithm, or the encryption algorithm, and the encryption algorithm are described. Since the number of digits of the random number is smaller than that of the original data, the random number 101100 is obtained after the last digit of the random number 1011 is filled with 0. Similarly, if the random number is 1100010101, the number of digits of the random number 1100010101 is greater than the number of digits of the original data, so the last digit of the random number 1100010101 is discarded to obtain the random number 110001.
其中,异或加密算法为将随机数101100与原始数据110101按位进行异或运算,得到加密数据011001。Wherein, the XOR encryption algorithm is to perform a bitwise XOR operation on the random number 101100 and the original data 110101 to obtain the encrypted data 011001.
或加密算法为将随机数101100与原始数据110101按位进行或运算,得到加密数据111101。Or the encryption algorithm is to perform a bitwise OR operation on the random number 101100 and the original data 110101 to obtain the encrypted data 111101.
与加密算法为将随机数101100与原始数据110101按位进行与运算,得到加密数据100100。The AND encryption algorithm is to perform a bitwise AND operation on the random number 101100 and the original data 110101 to obtain the encrypted data 100100.
需要说明的是,上述加密算法具体如何将随机数与原始数据进行加密计算,可以由用户自己设定,此处不做具体限定。It should be noted that how the above-mentioned encryption algorithm encrypts the random number and the original data can be set by the user, and is not specifically limited here.
需要说明的是,随机数俗称乱数,是按随机顺序排列并服从一定概率分布律的数字,具有不确定性,即每次生成的数字都是不确定的。这样即使是通过一种加密算法,由于随机数不同,得到的加密数据也不同,从而增强了数据输入的安全性。It should be noted that random numbers, commonly known as random numbers, are numbers arranged in a random order and subject to a certain probability distribution law. They are uncertain, that is, the numbers generated each time are uncertain. In this way, even through one encryption algorithm, the encrypted data obtained is different due to different random numbers, thereby enhancing the security of data input.
在本优选实施例中,将该随机数设置为多位数可以增加加密数据破解的难度,从而进一步提高数据输入的安全性。随后调用随机数展示模块403。In this preferred embodiment, setting the random number to a multi-digit number can increase the difficulty of decrypting encrypted data, thereby further improving the security of data input. Then call the random number display module 403 .
然后,随机数展示模块403将随机数进行展示操作。具体的,随机数展示模块403将加密算法和随机数获取单元4025生成的随机数显示给用户,以供用户根据该随机数计算得到加密数据。随后调用加密数据接收模块404。Then, the random number display module 403 performs a display operation on the random number. Specifically, the random number display module 403 displays the encryption algorithm and the random number generated by the random number acquisition unit 4025 to the user, so that the user can calculate and obtain encrypted data according to the random number. Then the encrypted data receiving module 404 is called.
最后,加密数据接收模块404接收用户输入的加密数据,其中加密数据由用户根据随机数、原始数据和预设加密算法计算得出。原始数据即需要被加密的数据,举例来说,当用户在餐厅消费后使用微信支付方式买单时,用户原本设置的支付密码123456即为原始数据。Finally, the encrypted data receiving module 404 receives the encrypted data input by the user, wherein the encrypted data is calculated by the user according to random numbers, original data and a preset encryption algorithm. The original data is the data that needs to be encrypted. For example, when the user uses the WeChat payment method to pay after consumption in a restaurant, the payment password 123456 originally set by the user is the original data.
需要说明的是,该预设加密算法为上文描述的加密算法中的一种。在原始数据为123456,生成的随机数为3的情况下,如预设加密算法为原始数据减去随机数,则用户将输入加密数据123453;又如预设加密算法为原始数据加上随机数,则用户将输入加密数据123459。在原始数据为123456,预设加密算法为原始数据减去随机数的情况下,如生成的随机数为1,则用户将输入加密数据123455;如生成的随机数为2,则用户将输入加密数据123454。综上可知,预设加密算法的不同、生成的随机数的不同都会使用户输入的加密数据不同,因此加大了人们对加密数据破解的难度,从而提高了数据输入的安全性。It should be noted that the preset encryption algorithm is one of the encryption algorithms described above. In the case where the original data is 123456 and the generated random number is 3, if the preset encryption algorithm is the original data minus the random number, the user will input the encrypted data 123453; and if the preset encryption algorithm is the original data plus the random number , the user will enter encrypted data 123459. In the case where the original data is 123456 and the preset encryption algorithm is the original data minus the random number, if the generated random number is 1, the user will input the encrypted data 123455; if the generated random number is 2, the user will input the encrypted data Data 123454. To sum up, it can be seen that the difference in the preset encryption algorithm and the difference in the generated random number will make the encrypted data input by the user different, thus increasing the difficulty for people to decipher the encrypted data, thereby improving the security of data input.
这样即完成了本优选实施例的加密数据输入装置的加密数据输入过程。In this way, the encrypted data input process of the encrypted data input device of the preferred embodiment is completed.
在第一优选实施例的基础上,本优选实施例的加密数据输入装置详细描述了使用多位随机数进行加密的相关算法,由于随机数为多位数,处理方法复杂,且相关算法种类繁多,因而他人破解难度大,从而进一步提高了数据输入的安全性。On the basis of the first preferred embodiment, the encrypted data input device of this preferred embodiment describes in detail the related algorithms that use multi-digit random numbers for encryption. Since the random numbers are multi-digit, the processing method is complicated, and there are many kinds of related algorithms , so it is very difficult for others to crack, thereby further improving the security of data input.
实施例五Embodiment five
请参照图5,图5为本发明的加密数据输入方法及装置的具体实施例的流程图。Please refer to FIG. 5 , which is a flowchart of a specific embodiment of the encrypted data input method and device of the present invention.
步骤S501,在火车站候车时,张三长按手机电源键,以打开手机玩游戏。手机接收到长按电源键产生的密码输入请求,提示张三是否需要对解锁密码进行加密。Step S501, when waiting at the train station, Zhang San long presses the power button of the mobile phone to turn on the mobile phone and play games. The mobile phone receives a password input request generated by long pressing the power button, prompting Zhang San whether to encrypt the unlock password.
步骤S502,由于火车站人多眼杂,为了确保解锁密码不泄露,张三选择对解锁密码进行加密。手机接收到加密请求后,显示指纹输入界面。In step S502, Zhang San chooses to encrypt the unlocking password in order to ensure that the unlocking password is not leaked due to the crowds at the train station. After receiving the encryption request, the mobile phone displays the fingerprint input interface.
步骤S503,张三在指纹输入界面上输入指纹,手机根据该指纹获取相加加密算法,并生成随机数1显示在手机界面上。In step S503, Zhang San inputs a fingerprint on the fingerprint input interface, and the mobile phone obtains an additive encryption algorithm based on the fingerprint, and generates a random number 1 to be displayed on the mobile phone interface.
步骤S504,张三看到手机上显示的随机数121212,将其与原始密码987654按位相加,并保留相加后每一位的最低位得新的密码008866,于是将新密码输入。Step S504, Zhang San sees the random number 121212 displayed on the mobile phone, adds it to the original password 987654 bit by bit, and keeps the lowest digit of each digit after the addition to get a new password 008866, so he enters the new password.
步骤S505,手机接收到张三输入的新密码与加密后的密码一致,故将屏幕解锁。Step S505, the mobile phone receives that the new password entered by Zhang San is consistent with the encrypted password, so the screen is unlocked.
本优选实施例的加密数据输入方法及数据输入装置通过使用多位随机数对数据进行加密,由于多位随机数处理复杂,且随机数相关加密算法繁多,从而大大提高了数据被破解的难度,从而大大提高了数据输入的安全性。The encrypted data input method and the data input device in this preferred embodiment encrypt data by using multi-bit random numbers. Since multi-bit random numbers are complicated to process and there are many encryption algorithms related to random numbers, the difficulty of data being cracked is greatly increased. This greatly increases the security of data entry.
本发明实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。上述提到的存储介质可以是只读存储器,磁盘或光盘等。上述的各装置或系统,可以执行相应方法实施例中的方法。Each functional unit in the embodiment of the present invention may be integrated into one processing module, or each unit may physically exist separately, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are realized in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, and the like. Each of the above devices or systems may execute the methods in the corresponding method embodiments.
综上所述,虽然本发明已以优选实施例揭露如上,但上述优选实施例并非用以限制本发明,本领域的普通技术人员,在不脱离本发明的精神和范围内,均可作各种更动与润饰,因此本发明的保护范围以权利要求界定的范围为准。In summary, although the present invention has been disclosed above with preferred embodiments, the above preferred embodiments are not intended to limit the present invention, and those of ordinary skill in the art can make various modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope defined in the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610207560.3A CN105897417A (en) | 2016-04-01 | 2016-04-01 | Encrypted data input method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610207560.3A CN105897417A (en) | 2016-04-01 | 2016-04-01 | Encrypted data input method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN105897417A true CN105897417A (en) | 2016-08-24 |
Family
ID=57012554
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610207560.3A Pending CN105897417A (en) | 2016-04-01 | 2016-04-01 | Encrypted data input method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105897417A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106850220A (en) * | 2017-02-22 | 2017-06-13 | 腾讯科技(深圳)有限公司 | Data ciphering method, data decryption method and device |
| CN110266733A (en) * | 2019-07-25 | 2019-09-20 | 群淂数码科技(上海)有限公司 | Data ciphering method and its system |
| CN110765465A (en) * | 2018-07-25 | 2020-02-07 | 中国移动通信有限公司研究院 | Encryption method and device for digital information and service server |
| CN111277702A (en) * | 2020-01-21 | 2020-06-12 | 北京连山科技股份有限公司 | Multilink safety mobile phone companion system |
| CN111314218A (en) * | 2020-01-21 | 2020-06-19 | 北京连山科技股份有限公司 | Multi-link secure transmission router system |
| CN111654466A (en) * | 2020-04-25 | 2020-09-11 | 中山佳维电子有限公司 | A Data Encryption Method for Electronic Valuation Scales |
| CN113378134A (en) * | 2021-06-08 | 2021-09-10 | 国科政信科技(北京)股份有限公司 | Identity authentication method and device |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101290647A (en) * | 2007-04-19 | 2008-10-22 | 鸿富锦精密工业(深圳)有限公司 | Password protection device and method and password keyboard |
| CN102523565A (en) * | 2011-11-23 | 2012-06-27 | 宇龙计算机通信科技(深圳)有限公司 | Method, system and mobile communication terminal for encrypting and decrypting message data safely |
| CN104778393A (en) * | 2015-04-16 | 2015-07-15 | 电子科技大学 | Security fingerprint identification method for intelligent terminal |
| CN105141673A (en) * | 2015-08-07 | 2015-12-09 | 努比亚技术有限公司 | Intelligent terminal and user information processing method thereof |
| US20160057011A1 (en) * | 2004-05-19 | 2016-02-25 | Philip Drope | Multimedia network system with content importation, content exportation, and integrated content management |
-
2016
- 2016-04-01 CN CN201610207560.3A patent/CN105897417A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160057011A1 (en) * | 2004-05-19 | 2016-02-25 | Philip Drope | Multimedia network system with content importation, content exportation, and integrated content management |
| CN101290647A (en) * | 2007-04-19 | 2008-10-22 | 鸿富锦精密工业(深圳)有限公司 | Password protection device and method and password keyboard |
| CN102523565A (en) * | 2011-11-23 | 2012-06-27 | 宇龙计算机通信科技(深圳)有限公司 | Method, system and mobile communication terminal for encrypting and decrypting message data safely |
| CN104778393A (en) * | 2015-04-16 | 2015-07-15 | 电子科技大学 | Security fingerprint identification method for intelligent terminal |
| CN105141673A (en) * | 2015-08-07 | 2015-12-09 | 努比亚技术有限公司 | Intelligent terminal and user information processing method thereof |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106850220A (en) * | 2017-02-22 | 2017-06-13 | 腾讯科技(深圳)有限公司 | Data ciphering method, data decryption method and device |
| CN110765465A (en) * | 2018-07-25 | 2020-02-07 | 中国移动通信有限公司研究院 | Encryption method and device for digital information and service server |
| CN110266733A (en) * | 2019-07-25 | 2019-09-20 | 群淂数码科技(上海)有限公司 | Data ciphering method and its system |
| CN111277702A (en) * | 2020-01-21 | 2020-06-12 | 北京连山科技股份有限公司 | Multilink safety mobile phone companion system |
| CN111314218A (en) * | 2020-01-21 | 2020-06-19 | 北京连山科技股份有限公司 | Multi-link secure transmission router system |
| CN111654466A (en) * | 2020-04-25 | 2020-09-11 | 中山佳维电子有限公司 | A Data Encryption Method for Electronic Valuation Scales |
| CN113378134A (en) * | 2021-06-08 | 2021-09-10 | 国科政信科技(北京)股份有限公司 | Identity authentication method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105897417A (en) | Encrypted data input method and device | |
| JP6302592B2 (en) | Information processing apparatus, information processing method, and program | |
| US20220239509A1 (en) | Method for storing and recovering key for blockchain-based system, and device therefor | |
| CN105703901A (en) | Encrypted data input method and encrypted data input device | |
| US20160330244A1 (en) | Secure Storage of Data Among Multiple Devices | |
| CN105453483A (en) | Image-based key derivation function | |
| GB2514419A (en) | Improved user authentication system and method | |
| CN104125055A (en) | Encryption and decryption method and electronic device | |
| US10395232B2 (en) | Methods for enabling mobile payments | |
| CN105005731A (en) | A data encryption and decryption method and mobile terminal | |
| US20160212119A1 (en) | Authentication information encryption server apparatuses, computer readable mediums and methods | |
| CN105117632B (en) | The method and terminal of a kind of terminal unlocking | |
| CN107895105B (en) | Password processing method, terminal equipment and computer readable storage medium | |
| CN113826096A (en) | User authentication and signature device and method using user biometric identification data | |
| CN106487758B (en) | data security signature method, service terminal and private key backup server | |
| CN109214201A (en) | A kind of data sharing method, terminal device and computer readable storage medium | |
| CN105900103B (en) | Touch terminal and password generation method for touch terminal | |
| CN112636914A (en) | Identity authentication method, identity authentication device and smart card | |
| US9641328B1 (en) | Generation of public-private key pairs | |
| CN105243331A (en) | Encryption device and encryption method, and decryption device and decryption method | |
| JP2019009767A (en) | Information processing device | |
| CN104915583A (en) | Interface decryption processing method and mobile terminal | |
| CN104428803A (en) | Payment method and apparatus and payment element processing method and apparatus | |
| CN110417740B (en) | User data processing method, intelligent terminal, server and storage medium | |
| CN108390867A (en) | Card file enciphering method and decryption method are deposited in the administration of justice |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160824 |