CN109033867A - A kind of file encrypting method and system - Google Patents

A kind of file encrypting method and system Download PDF

Info

Publication number
CN109033867A
CN109033867A CN201810701459.2A CN201810701459A CN109033867A CN 109033867 A CN109033867 A CN 109033867A CN 201810701459 A CN201810701459 A CN 201810701459A CN 109033867 A CN109033867 A CN 109033867A
Authority
CN
China
Prior art keywords
file
key
byte
encryption
encrypting method
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
Application number
CN201810701459.2A
Other languages
Chinese (zh)
Inventor
金京
陈学亮
李明静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Aiyouwei Software Development Co Ltd
Original Assignee
Shanghai Aiyouwei Software Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Aiyouwei Software Development Co Ltd filed Critical Shanghai Aiyouwei Software Development Co Ltd
Priority to CN201810701459.2A priority Critical patent/CN109033867A/en
Publication of CN109033867A publication Critical patent/CN109033867A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2107File encryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the present application discloses a kind of file encrypting method and system, is related to intelligent terminal technical field.The described method includes: obtaining a kind of file;The byte interval of calculation document encryption;The key of selecting file encryption;According to the key, the byte of each byte interval of the file is encrypted.The file encrypting method and system of the application is encrypted using the byte of each byte interval of key-pair file, to ensure the safety of the personal document of user, and improves the efficiency of file encryption, realizes efficient cryptographic file.

Description

A kind of file encrypting method and system
Technical field
This application involves intelligent terminal technical field more particularly to file encrypting method and systems.
Background technique
With the rapid development of mobile communication technology, the work, life of people and intelligent terminal are closely bound up.User utilizes File data is uploaded or downloaded to terminal, to realize the functions such as data storage and/or information exchange.Currently, each file can be with A unique MD5 value is generated, whether the network platform (for example, cloud disk etc.) can identical by MD5 value, to judge in database It whether include the consistent alternative document of MD5 value.However, when the MD5 value of the file in the file and cloud disk database that user uploads When consistent, there is the risk for being deleted or distorting in the file that user uploads.For the safety of the personal document of guarantee user, need To file encryption, to improve the safety of personal document.
Accordingly, it is desired to provide a kind of file encrypting method and system, utilize the word of each byte interval of key-pair file Section is encrypted, and to ensure the safety of the personal document of user, and improves the efficiency of file encryption, realizes efficient cryptographic text Part.
Summary of the invention
According to some embodiments of the present application in a first aspect, a kind of file encrypting method is provided, applied to terminal (example Such as, electronic equipment etc.) in, the method may include: obtain a kind of file;The byte interval of calculation document encryption;Choose text The key of part encryption;According to the key, the byte of each byte interval of the file is encrypted.
In some embodiments, the method may further include: obtain the file size;The file size with Byte is unit calculating.
In some embodiments, the byte interval of the calculation document encryption further comprises: determining that file is to be encrypted Byte number;According to the file size, the byte interval of calculation document encryption.
In some embodiments, the key includes exclusive or key, and the key is arranged by system or is made by oneself by user Justice.
In some embodiments, it is different that the key of the selecting file encryption, which further comprises 8 bit binary value of selection, Or key.
In some embodiments, the method may further include: obtain encryption file;Judge the MD5 of the file Whether value and the MD5 value of the encryption file are identical.
In some embodiments, the decoding data flow further comprises: if it is different, exporting the encryption file; If they are the same, the key of change file encryption;Or the byte interval of adjustment file encryption.
In some embodiments, the method may further include: according to the key, decrypt each of the file The byte of byte interval.
In some embodiments, the method may further include: obtain decryption file;Determine the MD5 of the file It is worth identical with the decryption MD5 value of file.
According to the second aspect of some embodiments of the present application, a system is provided, comprising: a memory is matched It is set to storing data and instruction;One is established the processor communicated with memory, wherein when executing the instruction in memory, The processor is configured to: obtain a kind of file;The byte interval of calculation document encryption;The key of selecting file encryption;Root According to the key, the byte of each byte interval of the file is encrypted.
Therefore, according to the file encrypting method of some embodiments of the present application and system, each of key-pair file is utilized The byte of byte interval is encrypted, and to ensure the safety of the personal document of user, and improves the efficiency of file encryption, real Existing efficient cryptographic file.
Detailed description of the invention
To more fully understand and illustrating some embodiments of the present application, below with reference to the description of attached drawing reference implementation example, In the drawings, same digital number indicates corresponding part in the accompanying drawings.
Fig. 1 is the illustrative diagram of the Environment System provided according to some embodiments of the present application.
Fig. 2 is the exemplary cell schematic diagram of the electronic functionalities configuration provided according to some embodiments of the present application.
Fig. 3 is the exemplary process diagram of the file encrypting method provided according to some embodiments of the present application.
Specific embodiment
Below with reference to being described as convenient for Integrated Understanding the application as defined in claim and its equivalent for attached drawing Various embodiments.These embodiments include various specific details in order to understand, but these are considered only as illustratively.Cause This, it will be appreciated by those skilled in the art that carrying out variations and modifications without departing from this to various embodiments described herein The scope and spirit of application.In addition, briefly and to be explicitly described the application, the application will be omitted to known function and structure Description.
The term used in following description and claims and phrase are not limited to literal meaning, and being merely can Understand and consistently understands the application.Therefore, for those skilled in the art, it will be understood that provide to the various implementations of the application The description of example is only the purpose to illustrate, rather than limits the application of appended claims and its Equivalent definitions.
Below in conjunction with the attached drawing in some embodiments of the application, technical solutions in the embodiments of the present application carries out clear Chu is fully described by, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments. Based on the embodiment in the application, obtained by those of ordinary skill in the art without making creative efforts all Other embodiments shall fall in the protection scope of this application.
It should be noted that the term used in the embodiment of the present application is only merely for the mesh of description specific embodiment , it is not intended to be limiting the application." one " of the embodiment of the present application and singular used in the attached claims, "one", "an", " described " and "the" be also intended to including most forms, unless the context clearly indicates other meaning.Also It should be appreciated that term "and/or" used herein refers to and includes that any of project is listed in one or more mutually bindings Or all possible combinations.Expression " first ", " second ", " first " and " second " be for modify respective element without Consideration sequence or importance are used only for distinguishing a kind of element and another element, without limiting respective element.
Can be electronic equipment according to the terminal of some embodiments of the application, the electronic equipment may include smart phone, PC (PC, such as tablet computer, desktop computer, notebook, net book, palm PC PDA), mobile phone, e-book Reader, portable media player (PMP), audio/video player (MP3/MP4), video camera, virtual reality device (VR) and the combination of one or more of wearable device etc..According to some embodiments of the present application, the wearable device It may include type of attachment (such as wrist-watch, ring, bracelet, glasses or wear-type device (HMD)), integrated type (such as electronics Clothes), decorated type (such as pad skin, tatoo or built in electronic device) etc. or several combinations.In some realities of the application One of it applies in example, the electronic equipment can be flexibly, be not limited to above equipment, or can be above-mentioned various equipment Or several combination.In this application, term " user " can be indicated using the people of electronic equipment or setting using electronic equipment Standby (such as artificial intelligence electronic equipment).
The embodiment of the present application provides a kind of file encrypting method.The embodiment of the present application in order to facilitate understanding, below will ginseng Attached drawing is examined the embodiment of the present application is described in detail.
Fig. 1 is the illustrative diagram of the Environment System 100 provided according to some embodiments of the present application.Such as Fig. 1 Shown, Environment System 100 may include electronic equipment 110, network 120 and server 130 etc..Electronic equipment 110 can be with Including bus 111, processor 112, memory 113, input/output module 114, display 115, communication module 116 and physics Key 117 etc..In some embodiments of the present application, electronic equipment 110 can be omitted one or more elements, or can be into one Step includes one or more of the other element.
Bus 111 may include circuit.The circuit can be with one or more element (examples in interconnection electronics 110 Such as, bus 111, processor 112, memory 113, input/output module 114, display 115, communication module 116 and secondary or physical bond 117).The circuit can also be realized between one or more elements in electronic equipment 110 communication (for example, obtain and/or Send information).
Processor 112 may include one or more coprocessors (Co-processor), application processor (AP, Application Processor) and communication processor (Communication Processor).As an example, processor 112 can execute with the control of one or more elements of electronic equipment 110 and/or data processing (for example, file encryption etc. is grasped Make).
Memory 113 can store data.The data may include other with one or more of electronic equipment 110 The relevant instruction of element or data.For example, the data may include the initial data before processor 112 is handled, intermediate data And/or treated data.Memory 113 may include impermanent memory memory and/or permanent memory memory.Make For example, memory 113 can store key etc..
According to some embodiments of the present application, memory 113 can store software and/or program.Described program can wrap It includes kernel, middleware, Application Programming Interface (API, Application Programming Interface) and/or applies journey Sequence (or " application ").
At least part of the kernel, the middleware or the Application Programming Interface may include operating system (OS, Operating System).As an example, the kernel be can control or be managed for executing other programs (for example, intermediate Part, Application Programming Interface and application program) in realize operation or function system resource (for example, bus 111, processor 112, memory 113 etc.).In addition, the kernel can provide interface.The interface can by the middleware, described answer With one or more elements of programming interface or application program access electronic equipment 110 to control or management system resource.
The middleware can be used as the middle layer of data transmission.Data transmission can permit Application Programming Interface or Application program is with the kernel communication to exchange data.As an example, the middleware can handle from the application program One or more task requests of acquisition.For example, the middleware can distribute electronic equipment to one or more application program The priority of 110 system resource (for example, bus 111, processor 112, memory 113 etc.), and processing it is one or Multiple tasks request.The Application Programming Interface can be the application program for control from the kernel or the middleware The interface of function is provided.The Application Programming Interface also may include one or more interfaces or function (for example, instruction).It is described Function can be used for starting control, data channel control, security control, communication control, document control, window control, text control System, image procossing, information processing etc..
What input/output module 114 can be inputted to the transmission of the other elements of electronic equipment 110 from user or external equipment Instruction or data.Input/output module 114 can also be defeated by the instruction or data that obtain from the other elements of electronic equipment 110 Out to user or external equipment.In some embodiments, input/output module 114 may include input unit, and user can lead to Cross the input unit input information or instruction.
Display 115 can show content.The content can to user show various types (for example, text, image, Video, icon and/or symbol etc. or several combinations).Display 115 may include liquid crystal display (LCD, Liquid Crystal Display), light emitting diode (LED, Light-Emitting Diode) display, Organic Light Emitting Diode (OLED, Organic Light Emitting Diode) display, Micro Electro Mechanical System (MEMS, Micro Electro Mechanical Systems) display or electric paper display etc. or several combinations.Display 115 may include display Screen, touch screen etc..The display screen can show encryption file, or the original document of decryption etc..In some embodiments, it shows Device 115 can show virtual key.The input of the available virtual key of touch screen.Display 115 can be by described Touch screen obtains input.The input may include touch input, gesture input, action input, close input, electronic pen or use The input (for example, hovering input) of family body part.
Communication module 116 can configure the communication between equipment.In some embodiments, Environment System 100 can be with It further comprise electronic equipment 140.As an example, the communication between the equipment may include electronic equipment 110 and other set Communication between standby (for example, server 130 or electronic equipment 140).For example, communication module 116 can by wireless communication or Wire communication is connected to network 120, communicates with other equipment (for example, server 130 or electronic equipment 140) realization.
The wireless communication may include microwave communication and/or satellite communication etc..The wireless communication may include honeycomb Communication is (for example, global mobile communication (GSM, Global System for Mobile Communications), CDMA (CDMA, Code Division MultipleAccess), 3G (Third Generation) Moblie (3G, The 3rd Generation Telecommunication), forth generation mobile communication (4G), the 5th third-generation mobile communication (5G), Long Term Evolution (LTE, Long Term Evolution), Long Term Evolution upgrade version (LTE-A, LTE-Advanced), wideband code division multiple access (WCDMA, Wideband Code Division MultipleAccess), Universal Mobile Communication System (UMTS, Universal Mobile Telecommunications System), WiMAX (WiBro, Wireless Broadband) etc. or several Combination.According to some embodiments of the present application, the wireless communication may include WLAN (WiFi, Wireless Fidelity), bluetooth, low-power consumption bluetooth (BLE, Bluetooth Low Energy), ZigBee protocol (ZigBee), near-field communication (NFC, Near Field Communication), magnetic safe transmission, radio frequency and body area network (BAN, BodyAreaNetwork) Deng or several combinations.According to some embodiments of the present application, the wire communication may include Global Navigation Satellite System (Glonass/GNSS, Global Navigation Satellite System), global positioning system (GPS, Global Position System), Beidou navigation satellite system or Galileo (European Global Satellite Navigation System) etc..The cable modem Letter may include universal serial bus (USB, Universal Serial Bus), high-definition media interface (HDMI, High- Definition Multimedia Interface), proposed standard 232 (RS-232, Recommend Standard 232), And/or plain old telephone service (POTS, Plain Old Telephone Service) etc. or several combinations.
Secondary or physical bond 117 can be used for user's interaction.Secondary or physical bond 117 may include one or more entity keys.In some realities It applies in example, user can be with the function of customized secondary or physical bond 117.As an example, secondary or physical bond 117 can send instruction.Described instruction It may include encryption file etc..
In some embodiments, electronic equipment 110 may further include sensor.The sensor may include but not It is limited to photosensitive sensor, acoustic sensor, gas sensor, chemical sensor, voltage sensitive sensor, temp-sensitive sensor, fluid to pass Sensor, biosensor, laser sensor, Hall sensor, intelligence sensor etc. or several combinations.
In some embodiments, electronic equipment 110 may further include infrared equipment, image capture device etc..As Example, the infrared equipment can identify by infrared ray mode of delivery, and blink, watch the technologies such as identification acquisition eyes attentively Information.For example, the infrared equipment authenticates user information by acquiring the blink movement of user.As an example, described image Acquiring equipment may include camera, iris device etc..The functions such as eyeball tracking may be implemented in the camera.The iris dress It sets and can use iris recognition technology progress authentication (for example, certification user information).The iris device may include rainbow Film camera, the available iris information of iris camera, the iris information can store in memory 113.
Network 120 may include communication network.The communication network may include computer network (for example, local area network (LAN, Local Area Network) or wide area network (WAN, Wide Area Network)), internet and/or telephone network Deng or several combinations.Network 120 can be to the other equipment in Environment System 100 (for example, electronic equipment 110, clothes Business device 130, electronic equipment 140 etc.) send information.
Server 130 can connect the other equipment in Environment System 100 (for example, electronic equipment by network 120 110, electronic equipment 140 etc.).In some embodiments, server 130 can be counted by network 120 and electronic equipment 110 According to transmission etc..For example, server 130 can send the data such as key of file encryption by network 120 to electronic equipment 110, Electronic equipment 110 can send file data etc. to server 130 by network 120.
Electronic equipment 140 can be identical or different with electronic equipment 110 type.According to some embodiments of the present application, Some or all of execution operation can be in another equipment or multiple equipment (for example, electronic equipment 140 in electronic equipment 110 And/or server 130) in execute.In some embodiments, when electronic equipment 110 be automatically or in response to request execute it is a kind of or When multiple functions and/or service, electronic equipment 110 can request other equipment (for example, electronic equipment 140 and/or server 130) substitution executes function and/or service.In some embodiments, electronic equipment 110 is in addition to executing function or service, further Execute relative one or more functions.In some embodiments, other equipment are (for example, electronic equipment 140 and/or clothes Business device 130) requested function or other relevant one or more functions can be executed, implementing result can be sent to electricity Sub- equipment 110.Electronic equipment 110 can repeat result or be further processed implementing result, to provide requested function Or service.As an example, cloud computing, distributed computing technology and/or client-server end, which can be used, in electronic equipment 110 calculates meter Calculation etc. or several combinations.In some embodiments, according to the difference of cloud computing service property, the cloud computing may include Public cloud, private clound and mixed cloud etc..For example, electronic equipment 110 can carry out data transmission with electronic equipment 140, for example, electric Sub- equipment 140 can transmit the key of encryption file to electronic equipment 110 etc..
It should be noted that the description for Environment System 100 above only for convenience of description can not be this Shen It please be limited within the scope of illustrated embodiment.It is appreciated that the principle based on this system can for those skilled in the art Any combination can be carried out to each element, or constitute subsystem and connect with other elements under the premise of without departing substantially from the principle, Various modifications and variations in form and details are carried out to the implementation above method and systematic difference field.For example, network environment System 100 may further include database etc..In another example electronic equipment 110 can not include secondary or physical bond 117 etc..It is all such The deformation of class, within the scope of protection of this application.
Fig. 2 is the exemplary cell block diagram of the electronic functionalities configuration provided according to some embodiments of the present application.Such as Shown in Fig. 2, processor 112 may include processing module 200, and the processing module 200 may include acquiring unit 210, determine Unit 220, processing unit 230, control unit 240, computing unit 250.
According to some embodiments of the present application, the available data of acquiring unit 210.In some embodiments, the number According to may include information, the information can include but is not limited to text, image, audio, video, movement, gesture, sound, eye Eyeball (for example, iris information etc.), breath, light etc. or several combinations.In some embodiments, the information may include but It is not limited to input information, system information and/or communication information etc..As an example, acquiring unit 210 can pass through input/output Module 114, the touch screen of display 115, secondary or physical bond 117 and/or sensor obtain the input information of electronic equipment 110.It is described Inputting information may include other equipment (for example, electronic equipment 140) and/or the input of user, for example, key-press input, touch-control Input, gesture input, action input, remote input, transmission input, eyes input, voice input, breath input, light input etc., Or several combination.The obtaining widget of the input information can include but is not limited to infrared equipment, image capture device, sensing Device etc. or several combinations.As an example, the key etc. of the available file encryption of acquiring unit 210.In another example obtaining single First 210 available encryption files, and/or obtain decryption file etc..
In some embodiments, acquiring unit 210 can obtain the communication information by network 120.The communication information can To include application software information, communication signal (for example, voice signal, vision signal etc.), short message etc..In some embodiments In, acquiring unit 210 can obtain system information by network 120, memory 113 and/or sensor.The system information can To include but is not limited to the information that stores of the system mode of electronic equipment 110, presupposed information, memory 113 (for example, iris is recognized Demonstrate,prove information etc.) etc. or several combinations.
In some embodiments, the information may include instruction.Described instruction includes user instruction and/or system command Deng or several combinations.Described instruction may include triggering command, certification instruction, fill in instruction etc. or several combinations.Institute Stating certification instruction may include certification user information instruction etc..As an example, when user presses secondary or physical bond (for example, shortcut key etc.) When, available encryption file instruction of electronic equipment 110 etc..
According to some embodiments of the present application, determination unit 220 can determine information.In some embodiments, it determines single The byte interval that member 220 can be encrypted with calculation document.In another example determination unit 220 can determine file byte number to be encrypted Mesh etc..In some embodiments, determination unit 220 may determine that the MD5 value (Message-Digest of original document Algorithm 5, Message-Digest Algorithm 5) it is whether identical as the MD5 value of encryption file.In another example determination unit 220 can be true Whether the MD5 of the MD5 value and original document of decrypting file surely identical, whether to be tampered after determining original document encrypting and decrypting or It destroys.
According to some embodiments of the present application, processing unit 230 can handle data.In some embodiments, processing is single The key etc. that member 230 can be encrypted with selecting file.Add as an example, processing unit 230 can choose exclusive or key for file It is close.The key can be arranged or be customized by the user by system.For example, processing unit 230 can be arranged with selecting system 8 bit binary value be exclusive or key.Exclusive or algorithm can be used in the exclusive or key, and the exclusive or algorithm can be two 0 is exported when inputting identical, does not export 1 simultaneously.In some embodiments, the key that processing unit 230 can be encrypted with change file; Or the byte interval etc. of adjustment file encryption.
According to some embodiments of the present application, control unit 240 can control file encryption.In some embodiments, it controls Unit 240 processed according to the key, can encrypt the byte of each byte interval of original document.As an example, control unit 240 can encrypt the determining file of determination unit 220 byte to be encrypted.File byte to be encrypted can pass through file Size and the byte interval of file encryption etc. are calculated.In some embodiments, control unit 240 can be according to described close Key decrypts the byte of each byte interval of the file.
According to some embodiments of the present application, computing unit 250 can calculate data.In some embodiments, it calculates single Member 250 can be using byte as unit calculation document size.As an example, if video file size is 100MB, computing unit 250 The byte-sized that the video file can be calculated is 100*1024*1024=104857600.In some embodiments, it calculates Unit 250 can be to be encrypted according to the size and file of original document byte number, the byte interval etc. of calculation document encryption. As an example, when the byte number to be encrypted that the video file is arranged is 1, that is, encrypt a byte, computing unit 250 can be with The byte interval of calculation document encryption is 104857599, that is, encrypts the last byte of the video file.
It should be noted that the unit in processing module 200 is described above, it only for convenience of description, can not be this Application is limited within the scope of illustrated embodiment.It is appreciated that for those skilled in the art, the principle based on this system, Any combination may be carried out to each unit, or constitute submodule and other units company under the premise of without departing substantially from the principle It connects, various modifications and variations in form and details is carried out to the function of implementing above-mentioned module and unit.For example, processing module 200 may further include storage unit, and the storage unit can store the key etc. of original document, file encryption.Such as Such deformation, within the scope of protection of this application.
Fig. 3 is the exemplary process diagram of the file encrypting method provided according to some embodiments of the present application.Such as Fig. 3 institute Show, process 300 can be realized by processing module 200.
301, a kind of file is obtained.Operation 301 can be realized by the acquiring unit 210 of processing module 200.Some In embodiment, acquiring unit 210 can obtain file data by input/output module 114.The file data may include The data types such as text, image, audio-video or several combinations.In some embodiments, the available institute of acquiring unit 210 File size is stated, the file size is calculated as unit of byte.As an example, acquiring unit 210 can pass through network 120 etc. Obtain video file.
302, the byte interval of calculation document encryption.Operation 302 can pass through the determination unit 220 of processing module 200 It is realized with computing unit 250.In some embodiments, determination unit 220 can determine file byte number to be encrypted, calculate Unit 250 can according to acquiring unit 210 obtain file size and byte number to be encrypted, calculation document encryption Byte interval.As an example, determination unit 220 can determine that file byte number to be encrypted is 1 byte, the video text Part size is 104857600 bytes, and the byte interval that computing unit 250 can calculate the file encryption is 104857599, i.e., Encrypt the last byte of the video file.
303, the key of selecting file encryption.Operation 303 can be realized by the processing unit 230 of processing module 200. In some embodiments, the key that processing unit 230 can be encrypted with selecting file, the key may include exclusive or key, institute Stating key can be arranged or be customized by the user by system.As an example, processing unit 230 can choose 8 bits Value is exclusive or key.For example, it is exclusive or key that processing unit 230, which can choose key (0x1F), being scaled binary system is 00011111.The exclusive or key key (0x1F) can use exclusive or algorithm and realize that file encryption, the exclusive or algorithm can be Two inputs export 0 when identical, do not export 1 simultaneously.
304, according to the key, the byte of each byte interval of the file is encrypted.Operation 304 can pass through place The control unit 240 for managing module 200 is realized.In some embodiments, control unit 240 can encrypt institute according to the key State the byte of each byte interval of file.As an example, control unit 240 can be according to the exclusive or key key (0x1F) Encrypt the last byte of the video file.For example, the last byte of the video file is 0x08 (binary system 00001000), after exclusive or key key (0x1F) encryption, encrypted byte 0x17 (Binary Zero 0010111) is obtained.
According to some embodiments of the present application, process 300 may further include acquisition encryption file.As an example, obtaining The available encrypted video file of unit 210 is taken, determination unit 220 may determine that the MD5 value and encryption view of the video file Whether the MD5 value of frequency file is identical.In some embodiments, if MD5 value is different, control unit 240 can export the encryption Video file;If MD5 value is identical, processing unit 230 can be with the key of change file encryption;Or between the byte of adjustment file encryption Every etc..
According to some embodiments of the present application, process 300 may further include acquisition decryption file.In some embodiments In, control unit 240 according to the key, can decrypt the byte of each byte interval of the file.As an example, control Unit 240 can decrypt the last byte 0x17 of the encrypted video file according to the exclusive or key key (0x1F) (Binary Zero 0010111) obtains decryption byte 0x08 (Binary Zero 0001000), output decryption video file.In some implementations Example in, the available decryption file of acquiring unit 210, determination unit 220 can determine it is described decryption video file MD5 value with The MD5 value of the video file is identical.
It should be noted that the description for process 300 above can not only for convenience of description be limited in the application Within the scope of illustrated embodiment.It is appreciated that the principle based on this system may not carry on the back for those skilled in the art Under the premise of from the principle, any combination is carried out to each operation, or constitute sub-process and other operative combinations, in implementation The function of stating process and operation carries out various modifications and variations in form and details.For example, process 300 may further include It obtains encryption file, obtain the operations such as decryption file.Suchlike deformation, within the scope of protection of this application.
In conclusion utilizing each word of key-pair file according to the file encrypting method and system of the embodiment of the present application The byte of septa intersegmental is encrypted, and to ensure the safety of the personal document of user, and improves the efficiency of file encryption, is realized Efficient cryptographic file.
It should be noted that the above embodiments are intended merely as example, the application is not limited to such example, but can To carry out various change.
It should be noted that in the present specification, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Finally, it is to be noted that, it is above-mentioned it is a series of processing not only include with sequence described here in temporal sequence The processing of execution, and the processing including executing parallel or respectively rather than in chronological order.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with It is completed by the relevant hardware of computer program instructions, the program can be stored in a computer readable storage medium, The program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can for magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) Deng.
Above disclosed is only some preferred embodiments of the application, and the right model of the application cannot be limited with this It encloses, those skilled in the art can understand all or part of the processes for realizing the above embodiment, and wants according to the application right Made equivalent variations is sought, is still belonged to the scope covered by the invention.

Claims (10)

1. a kind of file encrypting method characterized by comprising
Obtain a kind of file;
The byte interval of calculation document encryption;
The key of selecting file encryption;
According to the key, the byte of each byte interval of the file is encrypted.
2. file encrypting method according to claim 1, which is characterized in that further comprise:
Obtain the file size;The file size is calculated as unit of byte.
3. file encrypting method according to claim 2, which is characterized in that the byte interval of calculation document encryption into One step includes:
Determine file byte number to be encrypted;
According to the file size, the byte interval of calculation document encryption.
4. file encrypting method according to claim 1, which is characterized in that the key includes exclusive or key, described close Key is arranged or is customized by the user by system.
5. file encrypting method according to claim 4, which is characterized in that the key of the selecting file encryption is further It is exclusive or key including choosing 8 bit binary value.
6. file encrypting method according to claim 1, which is characterized in that further comprise:
Obtain encryption file;
Whether the MD5 value of the MD5 value and the encryption file that judge the file is identical.
7. file encrypting method according to claim 6, which is characterized in that the decoding data flow is further wrapped It includes:
If it is different, exporting the encryption file;
If they are the same, the key of change file encryption;Or the byte interval of adjustment file encryption.
8. file encrypting method according to claim 1, which is characterized in that further comprise:
According to the key, the byte of each byte interval of the file is decrypted.
9. file encrypting method according to claim 8, which is characterized in that further comprise:
Obtain decryption file;
The MD5 value of the MD5 value and the decryption file that determine the file is identical.
10. a system characterized by comprising
One memory, is configured as storing data and instruction;
One is established the processor communicated with memory, wherein when executing the instruction in memory, the processor is configured Are as follows:
Obtain a kind of file;
The byte interval of calculation document encryption;
The key of selecting file encryption;
According to the key, the byte of each byte interval of the file is encrypted.
CN201810701459.2A 2018-06-29 2018-06-29 A kind of file encrypting method and system Pending CN109033867A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810701459.2A CN109033867A (en) 2018-06-29 2018-06-29 A kind of file encrypting method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810701459.2A CN109033867A (en) 2018-06-29 2018-06-29 A kind of file encrypting method and system

Publications (1)

Publication Number Publication Date
CN109033867A true CN109033867A (en) 2018-12-18

Family

ID=65521050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810701459.2A Pending CN109033867A (en) 2018-06-29 2018-06-29 A kind of file encrypting method and system

Country Status (1)

Country Link
CN (1) CN109033867A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254127A (en) * 2011-08-11 2011-11-23 华为技术有限公司 Method, device and system for encrypting and decrypting files
CN105260668A (en) * 2015-10-10 2016-01-20 北京搜狗科技发展有限公司 File encryption method and electronic device
CN105893857A (en) * 2016-03-31 2016-08-24 北京金山安全软件有限公司 File encryption method, device and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254127A (en) * 2011-08-11 2011-11-23 华为技术有限公司 Method, device and system for encrypting and decrypting files
CN105260668A (en) * 2015-10-10 2016-01-20 北京搜狗科技发展有限公司 File encryption method and electronic device
CN105893857A (en) * 2016-03-31 2016-08-24 北京金山安全软件有限公司 File encryption method, device and equipment

Similar Documents

Publication Publication Date Title
CN109636401A (en) A kind of method of payment and system based on the micro- expression of user
CN109492412A (en) The encryption storage method and system of file
CN107132985A (en) A kind of display changeover method
CN108319408A (en) Stereogram target operating method and system
CN107315681A (en) Application program self-starting test system, medium and method
CN107423100A (en) A kind of methods, devices and systems of terminal OTA firmware updatings
CN109472122A (en) A kind of multimedia messages reminding method and system
CN107423585A (en) The concealed application method and system of a kind of application
CN107085678A (en) A kind of display methods and its terminal
CN107483969A (en) A kind of data transmission method and system based on PCA
CN107404484A (en) A kind of method, apparatus and system of mechanical release authority
CN107220531A (en) A kind of information processing method of convenient login
CN107862518A (en) A kind of method of payment and system based on terminal location
CN107018153A (en) A kind of safe login method
CN109189536A (en) A kind of terminal applies display methods and system
CN108897479A (en) A kind of terminal touch control method and system
CN108021350A (en) A kind of terminal output volume method of adjustment and system
CN108874465A (en) A kind of application starting method and system based on caching
CN107562314A (en) Scroll application icon display methods and system
CN109033867A (en) A kind of file encrypting method and system
CN107071182A (en) A kind of communication means
CN109101292A (en) A kind of terminal shortcut operation method and system
CN107563162A (en) A kind of concealed unlocking method and system
CN108509017A (en) A kind of control method and system of terminal applies
CN109413266A (en) It is a kind of based on the data back up method and terminal that fall detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20181218