Summary of the invention
Based on the above deficiencies in the existing technologies, the present invention provides a kind of encryption method, decryption side for storing equipment
Method and storage equipment.
In order to achieve the above object of the invention, the present invention uses following technical scheme:
A kind of encryption method storing equipment, includes the following steps:
S1, to storage one memory space of equipment application;
S2, judge whether the remaining space stored in equipment is greater than or equal to applied memory space;If so, going to
Step S3;
S3, input user information, generate first key according to user information, by first key to institute Shen in storage equipment
Memory space please is encrypted.
Preferably, before the step S1, further include:
S0, the communication connection for establishing storage equipment and terminal.
Preferably, the step S3 further includes:The first key is stored in storage equipment and is sent to
The terminal.
Preferably, the step S2 further includes:If it is not, then prompting insufficient space.
Preferably, the key is one of one-dimensional bar code, two dimensional code, three-dimension code.
The present invention also provides a kind of decryption methods for storing equipment, include the following steps:
S10, one second key of input;
S20, the second key of parsing are to obtain the second key information, by respectively storage is empty in the second key information and storage equipment
Between preset key information matched;If matching, is decrypted corresponding memory space.
Preferably, before the step S10, further include:S00, the communication connection for establishing storage equipment and terminal.
Preferably, second key is one of one-dimensional bar code, two dimensional code, three-dimension code.
The present invention also provides a kind of storage equipment, including:
Disk, for providing memory space;
Key production module, for generating first key according to the user information of input;
Encrypting module, for being encrypted by first key to memory space.
Preferably, the storage equipment further includes:
Cipher key storage block, for storing the preset key information of each memory space;
Key-parsing module, for being parsed second key of input to obtain corresponding second key information;
Matching module, for being matched to the second key information with preset key information;
Deciphering module, for memory space corresponding to matched preset key information to be decrypted.
Compared with prior art, the present invention beneficial effect is:
Storage equipment, can be carried out subregion encryption by the encryption method of storage equipment of the invention, and Information Security is high;It is real
Existing storage spatial resources share reduces use cost.
The decryption method of storage equipment of the invention only decrypts corresponding memory space, and the data of other memory spaces are still
It is so encrypted, Information Security is high.
Storage equipment of the invention can be carried out subregion encryption, realize memory space resource-sharing, reduce use cost.
Specific embodiment
In order to illustrate the embodiments of the present invention more clearly, Detailed description of the invention a specific embodiment of the invention will be compareed below.
It should be evident that drawings in the following description are only some embodiments of the invention, those of ordinary skill in the art are come
It says, without creative efforts, is also possible to obtain other drawings based on these drawings, and obtain other real
Apply mode.
As shown in Figure 1, the encryption method of the mobile hard disk of the embodiment of the present invention, includes the following steps:
S0, beginning establish the communication connection of mobile hard disk and mobile terminal;Specifically, on mobile hard disk there is communication to connect
Mouthful, such as USB interface, Type-C interface etc., USB interface or Type-C interface are transmission data-interface, for connect PC or
Mobile phone carries out partition holding operation, acquires user information for the first time, is managed to hard disc data, passes through the corresponding interface
Mobile hard disk is connect by data line with mobile terminal, realizes the communication between storage equipment and mobile terminal.Wherein, mobile terminal
It can be the portable devices such as mobile phone or the end PC.The mobile hard disk of the present embodiment connects the end PC by USB interface.
S1, user N are to mobile hard disk application memory space (N);Specifically, expensive due to mobile hard disk, for
For one family, if everyone will protect the privacy information of itself, a mobile hard disk generally can be respectively bought;However,
The capacity of mobile hard disk is generally large, personal at all without so big capacity, causes the waste of memory space, and individual is alone
Buy the higher cost of mobile hard disk.Based on this, can more people share a mobile hard disk, only need to apply on mobile hard disk needed for
Memory space, for example, the memory space of a mobile hard disk be 10T, if user only needs the memory space of 500M, Ke Yitong
Cross memory space of the mobile terminal to mobile hard disk application 500M.
S2, judge whether the remaining space stored in equipment is greater than or equal to applied memory space;If so, going to
Step S3.Specifically, user checks whether the remaining space of mobile hard disk is enough by the display interface at the end PC, if mobile hard disk
Remaining space be sufficient to accommodate the applied memory space of user, then go to step S3;If the remaining space of mobile hard disk is insufficient
To accommodate the applied memory space of user, illustrate that the remaining space of mobile hard disk is less than the applied memory space of user, then
Directly prompted on the display interface at the end PC:" insufficient space, application failure ".Preferably, the display interface at the end PC can be passed through
The specific remaining space for showing current mobile hard disk, when user applies for memory space, i.e., the display interface pop-up at the end PC is aobvious
Show the window of the remaining space of current mobile hard disk or the remaining space of current mobile hard disk and applied memory space difference,
To prompt user that can also currently apply for great memory space on the mobile hard disk, in this way, memory space can be improved
Apply for efficiency, without if the memory space of application is greater than the remaining space of mobile hard disk, needing anti-when applying for memory space
It is multiple to attempt by reducing applied memory space to determine whether to apply successfully.Such as:User N needs to apply 500M's
Memory space, but the remaining space of current mobile hard disk only remains 400M;If user directly applies for the memory space of 500M, gesture
Application must be caused to fail;And if giving and the remaining space of current mobile hard disk being prompted only to remain when user applies for memory space
400M prompts the remaining space of current mobile hard disk and first application storage empty after the failure of first application memory space
Between between difference be negative 100M;In this way, user N can directly apply for the memory space of 400M, or in the first time Shen user N
Please 500M memory space failure after, according to the difference between the remaining space of current mobile hard disk and first application memory space
Negative 100M directly applies for the memory space of 400M again, improves the application efficiency of memory space.
S3, input user information, generate key (same to code key) according to user information, store institute Shen in equipment by key pair
Memory space please is encrypted.Specifically, it is sufficient to accommodate the applied memory space of user in the remaining space of mobile hard disk,
Then apply for memory space success, then prompts user N to input personal information by the display interface at the end PC, for example, at the end PC
A text box is popped up on display interface, inputs personal information for user, personal information can be name, identification card number, family
Township, operating coordinates, family to company information, the end PC such as navigation routine personal information is transmitted to the two dimensional code built in mobile hard disk
Generator, two-dimension code generator generate user by key using the personal information inputted and apply for memory space corresponding unique two
Code N is tieed up, the applied memory space of user is encrypted by two dimensional code N.In addition, the system of mobile hard disk is by two dimensional code
N is stored in the two dimensional code memory block of mobile hard disk, and two dimensional code is also sent to the end PC, and the display interface pop-up window at the end PC is informed
User N prompts user to save two dimensional code.So far, the memory space of user N and key have all been applied completing, subsequent direct use
?.
When next user files an application memory space, repetitive cycling above-mentioned steps S1-S3, until mobile hard disk is deposited
Storage space has been expired, can be directly in the display interface pop-up window prompt at the end PC:" memory space has been expired ".
Storage equipment can be carried out subregion encryption by the encryption method of the present embodiment mobile hard disk, unique using two dimensional code
Identify encryption technology, storage security is high, protects privacy of user data;It realizes memory space resource-sharing, reduces use cost;
Cryptographic operation is simple and fast.
Corresponding to the encryption method of above-mentioned mobile hard disk, as shown in Fig. 2, also to provide a kind of movement hard for the embodiment of the present invention
Disk, mobile hard disk has USB interface or Type-C interface, mobile hard disk include:
Disk, for providing memory space;Specifically, disk is for memory space needed for providing N number of user, i.e., to magnetic
Disk carries out subregion, to be divided into N number of subregion;Such as:The total memory space of disk is 10T, is carried out dividing respective institute by N number of user
The memory space needed.User can connect mobile phone or the end PC by the USB interface or Type-C interface of mobile hard disk, carry out memory block
Domain divide, as subregion one, subregion two ..., subregion N, respectively correspond user one, user two ..., user N.
Key production module, for generating key according to the user information of input;Specifically, key production module is movement
Two-dimension code generator built in hard disk prompts user N to input personal information, for example, at the end PC by the display interface at the end PC
A text box is popped up on display interface, inputs personal information for user, personal information can be name, identification card number, family
Township, operating coordinates, family to company information, the end PC such as navigation routine personal information is transmitted to two-dimension code generator, two dimensional code
Generator generates user by key using the personal information inputted and applies for the corresponding unique two dimensional code N of memory space.In addition, moving
Two dimensional code N is stored in the two dimensional code memory block of mobile hard disk by dynamic hard disk, and two dimensional code is also sent to the end PC, display circle at the end PC
Face pop-up window informs user N, and user is prompted to save two dimensional code.So far, the memory space of user N and key have all been applied
At subsequent direct use.Corresponding to subregion one, subregion two ..., subregion N, respectively generate two dimensional code one, two dimensional code
Two ..., two dimensional code N.
Encrypting module, for being encrypted by two dimensional code N subregion N applied to user N.Realize independently adding for subregion
It is close, while mobile hard disk is shared, guarantee the privacy of each user storage space.
Cipher key storage block, for storing the preset key information of each memory space;Specifically, the key of the present embodiment is deposited
Storage module is two dimensional code memory block, and each preset key information of memory space is that each subregion N that two-dimension code generator generates is corresponding
Two dimensional code N, two dimensional code memory block is sent to by two-dimension code generator and is stored.
Key-parsing module, for being parsed an input key to obtain corresponding key information.Specifically, this reality
The key-parsing module for applying example is dimensional code scanner, is used for user identity authentication;Input cipher key operation can be to beat at the end PC
Corresponding two dimensional code is opened, dimensional code scanner scans the two-dimensional code acquisition two-dimensional barcode information;
Matching module is connect with key-parsing module, cipher key storage block, for believing key information and preset key
Breath is matched.Specifically, N pairs of each subregion in two-dimensional barcode information dimensional code scanner scanning obtained and two dimensional code memory block
The two dimensional code N answered is matched, if two dimensional code N corresponding from subregion N each in two dimensional code memory block is different, can not enable shifting
Dynamic hard disk;If one in two dimensional code N corresponding with subregion N each in two dimensional code memory block matches, by deciphering module, it is used for
Matched subregion is decrypted, corresponding partition holding is opened, user can carry out any operation to this subregion, such as:Copy moves
The operations such as dynamic, deletion.
The mobile hard disk of the present embodiment can carry out subregion encryption, and Information Security is high;Realize memory space resource-sharing,
Reduce use cost.
Preferably, indicator light or loudspeaker can be set on mobile hard disk, and indicator light or loudspeaker are used to indicate user N
Whether application memory space succeeds, such as:If the success of user's N application memory space, trigger signal to indicator light is so as to refer to
Show that lamp shows green light;If user's N application memory space fail, trigger signal to indicator light so that indicator light show red light,
It gives user and intuitively understands whether application memory space succeeds.Loudspeaker can pass through sending " applying successfully in space " or " sky
Between apply failure " prompt tone.
Corresponding to the encryption method and mobile hard disk of mobile hard disk described in above-described embodiment, the embodiment of the present invention is also provided
A kind of decryption method of mobile hard disk, includes the following steps:
S00, beginning establish the communication connection of mobile hard disk and mobile terminal;Specifically, on mobile hard disk there is communication to connect
Mouthful, such as USB interface, Type-C interface etc.;Mobile hard disk is connect with mobile terminal by the data line of the corresponding interface, is realized
Store the communication between equipment and mobile terminal.Wherein, mobile terminal can be the portable devices such as mobile phone or the end PC.This implementation
The mobile hard disk of example connects the end PC by USB interface.
S10, input key;Specifically, input cipher key operation can be saved in ciphering process by opening at PC end
Two dimensional code can also be the two dimensional code etc. of user's printing.
S20, parsing key are to obtain key information, by each preset key of memory space in key information and storage equipment
Information is matched;If matching, is decrypted corresponding memory space.Specifically, pass through the two dimensional code on mobile hard disk
Scanner scans the two dimensional code that the end PC is opened, and obtains two-dimensional barcode information, the two-dimensional barcode information that dimensional code scanner scanning is obtained
Two dimensional code N corresponding with subregion N each in two dimensional code memory block is matched, if corresponding with subregion N each in two dimensional code memory block
Two dimensional code N is different, then can not enable mobile hard disk;If one in two dimensional code N corresponding with subregion N each in two dimensional code memory block
A two dimensional code matching, then be decrypted the corresponding subregion of matched two dimensional code by deciphering module, and corresponding storage point is opened
Area, user can carry out any operation to this subregion, such as:The operation such as copy, mobile, deletion.
The decryption method of the present embodiment mobile hard disk need to only input the two dimensional code for being stored in the end PC originally, will not go out
The problem of now forgetting decruption key.
As a preferred embodiment, the two dimensional code that above-described embodiment is related to is as key, in addition, key can also be one-dimensional item
Shape code or three-dimension code.One-dimensional bar code is suitable for encrypting the general data of security requirement;And three-dimension code due to comprising
Abundant information, make it difficult to be cracked, suitable for encrypting the higher data of security requirement.
Above-mentioned N is natural number, is label.
The mobile hard disk of above-described embodiment can also store equipment for USB flash disk, mobile phone, PC etc..
The technical solution of the embodiment of the present invention is applied in specific real case, as described below:
One mobile hard disk is provided, there is USB interface, mobile hard disk is built-in with disk, two dimensional code generates on mobile hard disk
Device, encrypting module, two dimensional code memory block, dimensional code scanner, matching module and deciphering module.The disk of the mobile hard disk is always empty
Between be 6T.
Mobile hard disk is connect by USB data line with the end PC to realize that mobile hard disk is communicated with the end PC, at the end PC
Upper operation mobile hard disk encryption software, firstly, the window of the display screen pop-up application memory space at the end PC, user one deposit in application
The window input application memory space 2T for storing up space, since the remaining space of current mobile hard disk is 6T, therefore can accommodate user
One applied memory space, then apply for memory space success, and the display screen at the end PC pops up userspersonal information's input interface, uses
Family one inputs personal name, and the two-dimension code generator of mobile hard disk generates two dimensional code one, two dimension according to the personal name of user one
Code one is stored in two dimensional code memory block, and is sent to the end PC, and the display screen pop-up prompt window at the end PC is to prompt user to save two
Code one is tieed up, the memory space that subregion one is applied as user one is divided in disk, is encrypted by two dimensional code a pair of subregion one;
So far, user one completes the encryption to subregion one.
Next user is waited to apply for memory space, user two can rerun mobile hard disk encryption software, can also be with
After user one completes to the encryption of subregion one, " the applying for memory space again " clicked in mobile hard disk encryption software interface is pressed
Button, the window of the display screen pop-up application memory space at the end PC, window input application storage of the user two in application memory space
Space 3T since the remaining space of current mobile hard disk is 4T, therefore can accommodate the applied memory space of user two, then apply
The display screen of memory space success, the end PC pops up userspersonal information's input interface, and user two inputs personal name, mobile hard disk
Two-dimension code generator two dimensional code two is generated according to the personal name of user two, two dimensional code two is stored in two dimensional code memory block, and
It is sent to the end PC, the display screen pop-up prompt window at the end PC divides subregion two in disk and make to prompt user to save two dimensional code two
For the memory space that user two applies, subregion two is encrypted by two dimensional code two;So far, user two completes to subregion two
Encryption.
Next user is waited to apply for memory space, user three can rerun mobile hard disk encryption software, can also be with
After user two completes to the encryption of subregion two, " the applying for memory space again " clicked in mobile hard disk encryption software interface is pressed
Button, the window of the display screen pop-up application memory space at the end PC, window input application storage of the user three in application memory space
Space 2T since the remaining space of current mobile hard disk is 1T, therefore cannot accommodate the applied memory space of user three, then PC
The display screen pop-up prompt window " insufficient space, application failure " at end applies for memory space failure with prompt, in addition prompt window
Also prompt the remaining space 1T of current mobile hard disk;The window of application memory space is returned to, if user three applies for the storage of 1T
It space can also be with then user three applies for memory space 1T in the window input of application memory space, due to current mobile hard disk
Remaining space is 1T, therefore can accommodate the applied memory space of user two, then applies for memory space success, the display screen at the end PC
Userspersonal information's input interface is popped up, user three inputs personal name, and the two-dimension code generator of mobile hard disk is according to user three
Personal name generate two dimensional code three, two dimensional code three is stored in two dimensional code memory block, and is sent to the end PC, the display screen bullet at the end PC
Prompt window divides the memory space that subregion three is applied as user three, leads to out to prompt user to save two dimensional code three in disk
Two dimensional code three is crossed to encrypt subregion three;So far, user three completes the encryption to subregion three, and whole spaces of mobile hard disk
It is occupied, if next user also needs application memory space, while the window of pop-up application memory space, directly
The memory space of prompt mobile hard disk has been expired.If user three does not need the memory space of application 1T, directly terminate.
When user one needs to operate subregion one, then the two dimensional code one that user one saves on the end PC is opened, two dimension
Code scanner scans the two-dimensional code one, each two dimensional code that will be scanned obtained one information of two dimensional code and store in two dimensional code memory block
Information is matched, if one information of two dimensional code and one information of two dimensional code of storage in two dimensional code memory block that scanning obtains
Match, then user one can carry out any operation, such as copy, mobile, deletion operation to subregion one.
When user two needs to operate subregion two, then the two dimensional code two that user two saves on the end PC is opened, two dimension
Code scanner scans the two-dimensional code two, each two dimensional code that will be scanned obtained two information of two dimensional code and store in two dimensional code memory block
Information is matched, if two information of two dimensional code and two information of two dimensional code of storage in two dimensional code memory block that scanning obtains
Match, then user two can carry out any operation, such as copy, mobile, deletion operation to subregion two.And so on.
The mobile hard disk of the real case realizes subregion encryption, and memory space is shared;Except first application memory space needs
Be separately provided it is outer, behind using need to only scan the two-dimensional code, be not in the problem of forgetting Password.
It should be noted that the above is only that the preferred embodiment of the present invention and principle are described in detail, it is right
For those skilled in the art, the thought provided according to the present invention will change in specific embodiment, and
These changes should also be regarded as the scope of the invention.