File encryption and decryption method and device

A file encryption and file technology, applied in the field of data processing, can solve the problems of low efficiency and long processing time, and achieve the effect of reducing processing time and improving efficiency

Active Publication Date: 2013-10-30
TENCENT TECH (SHENZHEN) CO LTD
View PDF3 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Since private data mainly includes data in formats such as pictures, videos, and sounds, the files storing such data are relatively large. When using existing technologies to en

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • File encryption and decryption method and device
  • File encryption and decryption method and device
  • File encryption and decryption method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0055] see figure 1 , the embodiment of the present invention provides a file encryption method, comprising:

[0056] 101: replace the data in the preset position in the file to be encrypted, and obtain the encrypted file after the data is changed;

[0057] Further, after obtaining the encrypted file after the data change, it also includes:

[0058] Set an encryption suffix for encrypted files to identify encrypted files based on their encryption suffix.

[0059] 102: Use the password input by the user as a symmetric key to encrypt the data at the replaced preset location to form a decryption factor;

[0060] 103: Store the decryption factor.

[0061] For this step, this embodiment does not limit the specific implementation of storing the decryption factor, including but not limited to the following methods:

[0062] Establish a corresponding relationship between the decryption factor and the encrypted file, and store the decryption factor locally according to the correspo...

Embodiment 2

[0065] see figure 2, this embodiment provides a file encryption method. For the convenience of description, in combination with the content of the first embodiment above, this embodiment replaces the data at the preset position in the file to be encrypted with the data at the start and end positions of the file to be encrypted as As an example, the method provided in this embodiment is illustrated. see figure 2 , the method flow provided by this embodiment is specifically as follows:

[0066] 201: replace the data at the start and end positions in the file to be encrypted with garbled characters, and obtain the encrypted file after data modification;

[0067] Wherein, garbled characters are the chaotic characters that cannot be read normally because the system or software lacks support for a certain character encoding. The purpose of browsing the file to be encrypted normally is to achieve the effect of encryption. For the data at the start position and the end position ...

Embodiment 3

[0079] This embodiment provides a file encryption device, which is used to implement the file encryption methods provided in the first and second embodiments above. see image 3 , the device consists of:

[0080] Replacement module 301, is used for replacing the data of preset position in the file to be encrypted, obtains the encrypted file after data change;

[0081] An encryption module 302, configured to use the password input by the user as a symmetric key to encrypt the data at the preset position replaced by the replacement module 301 to form a decryption factor;

[0082] The storage module 303 is configured to store the decryption factor obtained by the encryption module 302 .

[0083] Wherein, when the replacement module 301 replaces the data in the preset position in the file to be encrypted, its specific implementation method can refer to the relevant description of step 201 in the second embodiment above, and will not be repeated here. The process of encrypting t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a file encryption and decryption method and device and belongs to the technical field of data processing. The file encryption method comprises the steps of replacing data at a preset position in a to-be-encrypted file, and obtaining an encryption file with data modified; enabling a password input by a user to serve as a symmetric key to encrypt the replaced data at the preset position, and forming a decryption factor; and storing the decryption factor. The file decryption method comprises the steps of obtaining the password input by the user and the decryption factor corresponding to the encryption file; decrypting the decryption factor according to the password input by the user, and obtaining decrypted data; and replacing the data at the currently preset position of the encryption file with the decrypted data to obtain the decrypted file. By replacing the data at the preset position of the file and only performing encryption and decryption treatment on the data at the preset position, compared with encryption and decryption treatment on a whole file in the prior art, the file encryption and decryption method and device can effectively reduce treatment time and improve treatment efficiency.

Description

technical field [0001] The invention relates to the technical field of data processing, in particular to a file encryption and decryption method and device. Background technique [0002] With the improvement of terminal intelligence and the increase of storage capacity, people are more and more fond of saving some private data in the terminal in the form of files. In order to protect the privacy of the user, that is, to ensure the security of the files stored in the terminal, it is particularly important to encrypt and decrypt the files. [0003] When the prior art encrypts a file, it is necessary to select an encryption algorithm, and encode the entire file through the selected encryption algorithm to obtain an encoded encrypted file; when the prior art decrypts an encrypted file, it is necessary to Select a decryption algorithm that is the same as or corresponding to the encryption algorithm, and decode the encrypted file through the selected decryption algorithm to obtai...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F21/62
Inventor 梁家辉
Owner TENCENT TECH (SHENZHEN) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products