This application claims priority to Taiwanese Patent Application No. 103146427 filed on Dec. 31, 2014, the contents of which are incorporated by reference herein.
The subject matter herein generally relates to data encryption and decryption.
An electronic device can have a number of application programs installed. An input device of an electronic device can generate data in response to inputs of a user and send the data to an application program. However, the data can be hacked during transmission.
The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures and components have not been described in detail so as not to obscure the related relevant feature being described. Also, the description is not to be considered as limiting the scope of the embodiments described herein. The drawings are not necessarily to scale and the proportions of certain parts may be exaggerated to better illustrate details and features of the present disclosure.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. Several definitions that apply throughout this disclosure will now be presented. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
Several definitions that apply throughout this disclosure will now be presented. The term “module” refers to logic embodied in computing or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an erasable programmable read only memory (EPROM). The modules described herein may be implemented as either software and/or computing modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives. The term “comprising” means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in a so-described combination, group, series and the like.
The present disclosure is described in relation to an electronic device and data encrypting and decrypting method. Programs cause at least one processor to display at least one user interface of an application program which is activated. Input operations on the user interface are detected and data is thus generated. A key pair comprising a public key and an associated private key is generated and the data is encrypted with the public key to obtain cryptographs, the cryptographs being sent to the application program. The method can decrypt the cryptographs with the private key to obtain the original data.
Referring to
In a first embodiment, the key generating module 201 generates a public-private key pair when the application program 300 is installed. The public-private key pair includes a public key and a private key. The key generating module 201 sends the public key to the encryption module 202 and sends the private key to the decryption module 203. In at least one embodiment, the decryption module 203 is embedded in the application program 300.
The encryption module 202 encrypts the data, generated by the input device 101, with the public key to obtain cryptographs. The decryption module 203 can decrypt the cryptographs with the private key to obtain the original data. Then the application program 300 receives the data in clear and the display device 102 displays the data.
In a second embodiment, the key generating module 201 generates a first public-private key pair when the user interface 1020 is utilized by the user. The first public-private pair includes a first public key and a first private key. The key generating module 201 sends the first public key to the encryption module 202 and sends the first private key to the decryption module 203. In at least one embodiment, the decryption module 203 is embedded in the application program 300.
The encryption module 202 encrypts the data with the public key to obtain cryptographs. The decryption module 203 decrypts the cryptographs with the private key to obtain the data. Then the application program 300 receives the data from the decryption module 203 and the display device 102 displays the data. After the user input, such as the user closing the virtual keyboard 1021, the encryption module 202 abandons the first pubic key and the decryption module 203 abandons the private key. A second public-private pair is generated by the key generating module 201 when the user starts new input operations. The second public-private key pair includes a second public key and second private key. The key generating module 201 sends the second public key to the encryption module 202 to encrypt new data, and sends the second private key to the decryption module 203 to decrypt cryptographs corresponding to the new data.
Referring to
At block 401, a key generating module generates a public-private key pair when an application program is installed in an electronic device. The public-private key pair includes a public key and private key. Then the key generating module sends the public key to an encryption module and sends the private key to a decryption module. In at least one embodiment, the decryption module is embedded in the application program.
At block 402, a display device displays a user interface of the application program when the application program is activated. In at least one embodiment, the display device further displays a virtual keyboard on the user interface.
At block 403, an input device detects user input and generates corresponding data.
At block 404, the encryption module encrypts the data, generated by the input device, with the public key to obtain cryptographs, and sends the cryptographs to the application program.
At block 405, the decryption module decrypts the cryptographs with the private key to obtain the data. Then the application program can receive the data from the decryption module and display the data.
Referring to
At block 501, a display device displays a user interface corresponding to an application program when the application program is activated. In at least one embodiment, the display device further displays a virtual keyboard on the user interface for a user to input.
At block 502, an input device detects user input and generates corresponding data.
At block 503, a key generating module generates a first public-private key pair when the user gives input. The first public-private key pair includes a first public key and a first private key. Then the key generating module sends the first public key to an encryption module and sends the first private key to a decryption module. In at least one embodiment, the decryption module is embedded in the application program.
At block 504, the encryption module encrypts the data, generated by the input device, with the first public key to obtain cryptographs. The encryption module further sends the cryptographs to the application program.
At block 505, the decryption module decrypts the cryptographs with the first private key to obtain the original data. Then the application program receives the data from the decryption module and the display device displays the data.
At block 506, the encryption module abandons the first public key and the decryption module abandons the first private key when user input is terminated. In at least one embodiment, if the user taps a “close” symbol on the user interface to close the virtual keyboard, then the input is determined to be finished.
At block 507, the key generating module generates a second public-private key pair when the user starts new input. The second public-private key pair includes a second public key and a second private key. Then the key generating module sends the second public key to the encryption module to encrypt data corresponding to the new input operations, and sends the second private key to the decryption module to decrypt cryptographs corresponding to the new data.
The embodiments shown and described above are only examples. Many details are often found in the art such as the other features of an electronic device and method for encrypting and decrypting data. Therefore, many such details are neither shown nor described. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, including in matters of shape, size and arrangement of the parts within the principles of the present disclosure, up to and including the full extent established by the broad general meaning of the terms used in the claims.
Number | Date | Country | Kind |
---|---|---|---|
103146427 | Dec 2014 | TW | national |