Invention content
Based on above-mentioned deficiency existing in the prior art, the present invention provide the encryption method of storage device, decryption method and
Storage device.
In order to reach foregoing invention purpose, the present invention uses following technical scheme:
The encryption method of storage device, includes the following steps:
S1, to one memory space of storage device application;
S2, judge whether the remaining space in storage device is greater than or equal to apllied memory space;If so, going to
Step S3;
S3, the first identifying code is generated, the identifying code of an input is matched with the first identifying code;If matching, is realized
To apllied memory space encryption in storage device.
Preferably, first identifying code is dynamic verification code.
Preferably, before the step S1, further include:S0, the communication link for establishing storage device and control terminal
It connects, passes through control terminal application memory space.
Preferably, the step S3 further includes:First identifying code is sent to preset mobile terminal;It is described defeated
The identifying code entered is the identifying code that mobile terminal receives.
Preferably, the step S3 further includes:To apllied memory space with the corresponding number of mobile terminal
It is identified.
Preferably, the step S3 further includes:If mismatching, prompt to re-enter identifying code.
The present invention also provides the decryption methods of storage device, correspond to the encryption method described in either a program as above, including
Following steps:
S10, the apllied memory space of triggering;
S20, the second identifying code is generated, the identifying code of an input is matched with the second identifying code;It is realized if matching
To apllied memory space decryption in storage device.
Preferably, second identifying code is dynamic verification code.
The present invention also provides storage devices, including:
Disk, for providing memory space;
Identifying code generation module, for generating the first identifying code at random according to the memory space of application;
Identifying code matching module, for matching the identifying code of an input with the first identifying code;If the verification of input
Code is matched with the first identifying code, then realizes and encrypted to apllied memory space in storage device.
Preferably, the identifying code generation module is additionally operable to give birth at random when apllied memory space is triggered
At the second identifying code;The identifying code matching module is additionally operable to match the identifying code of an input with the second identifying code;If
The identifying code of input is matched with the second identifying code, then realizes and decrypted to apllied memory space in storage device.
Compared with prior art, the present invention advantageous effect is:
The encryption method of the storage device of the present invention carries out subregion encryption, data using verification code technology to storage device
It is safe;It realizes memory space resource-sharing, reduces use cost.
The decryption method of the storage device of the present invention, corresponding memory space, Qi Tacun are only decrypted using verification code technology
The data for storing up space are still encrypted, and Information Security is high.
The storage device of the present invention carries out subregion encryption using verification code technology, realizes memory space resource-sharing, reduces
Use cost.
Specific implementation mode
In order to illustrate the embodiments of the present invention more clearly, below by the specific implementation mode of the control description of the drawings present invention.
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, other drawings may also be obtained based on these drawings, and obtains 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:
The communication connection of mobile hard disk and control terminal is established in S0, beginning;Specifically, on mobile hard disk there is communication to connect
Mouthful, such as USB interface, Type-C interfaces etc.;Mobile hard disk is connect with control terminal by the data line of the corresponding interface, is realized
Communication between storage device and control terminal.Wherein, control terminal can be the portable devices such as mobile phone or the ends PC.This implementation
The mobile hard disk of example connects the ends 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
The cost for buying mobile hard disk is higher.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 in storage device is greater than or equal to apllied 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 ends PC, if mobile hard disk
Remaining space be sufficient to accommodate the apllied memory space of user, then go to step S3;If the remaining space of mobile hard disk is insufficient
To accommodate the apllied memory space of user, illustrate that the remaining space of mobile hard disk is less than the apllied memory space of user, then
Directly prompted on the display interface at the ends PC:" insufficient space, application failure ".Preferably, the display interface at the ends PC can be passed through
The specific remaining space for showing current mobile hard disk, it is when user applies for memory space, i.e., aobvious in the pop-up of the display interface at the ends PC
Show the window of the remaining space of current mobile hard disk or the remaining space and apllied memory space difference of current mobile hard disk,
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 when applying for memory space, if the memory space of application is more than the remaining space of mobile hard disk, needing anti-
It is multiple to attempt by reducing apllied memory space to determine whether to apply successfully.Such as:User N needs to apply for 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 when user applies for memory space, it gives and the remaining space of current mobile hard disk is prompted only to remain
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 Shens user N
Please 500M memory spaces 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, improves the application efficiency of memory space again.
S3, the first identifying code is generated, the identifying code of an input is matched with the first identifying code;If matching, is realized
To apllied memory space encryption in storage device.Specifically, it is sufficient to accommodate user institute Shen in the remaining space of mobile hard disk
Memory space please then applies for memory space success, then prompts user's N input handset numbers by the display interface at the ends PC,
For example, popping up a text box on the display interface at the ends PC, it to be used for user's input handset number;The system of mobile hard disk is automatic
The first dynamic verification code is generated, and the first dynamic verification code is sent to the corresponding mobile terminal of phone number input by user, is connect
It the timer built in mobile hard disk to start to work, countdown 60s, user's N needs input identifying code in countdown 60s, with
Just the dynamic verification code comparator built in mobile hard disk matches the identifying code of input with the first dynamic verification code;Wherein,
First dynamic verification code is 8 identifying codes, and the time limit of countdown can be freely arranged, for example, it is also possible to for time limits such as 30s, 90s.
If user N does not input identifying code in countdown 60s, return to step S1 is needed to re-start memory space
Application;
If user inputs identifying code in countdown 60s, the identifying code of input is matched with the first dynamic verification code, then real
Now apllied memory space in mobile hard disk is encrypted, phone number is stored in the cell-phone number memory block of mobile hard disk, stores
N applications in space are completed, and the mark of memory space N is named as corresponding phone number, and convenient follow-up search uses.
If user inputs identifying code in countdown 60s, but the identifying code and the first dynamic verification code inputted is not
Match, then needs to click the button for retransmitting identifying code on the display interface at the ends PC, to carry out subsequent matching operation.
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, and can directly be prompted in the display interface pop-up window at the ends PC:" memory space has been expired ".
Storage device can be carried out subregion encryption, using dynamic verification code by the encryption method of the present embodiment mobile hard disk
Encryption technology, storage security is high, protects privacy of user data;It realizes memory space resource-sharing, reduces use cost;Encryption
It is simple and quick.
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 include with USB interface or Type-C interfaces, mobile hard disk:
Disk, for providing memory space;Specifically, disk is used to provide the memory space needed for 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 ends PC by the USB interface or Type-C interfaces of mobile hard disk, carry out memory block
Domain divide, as subregion one, subregion two ..., subregion N, correspond to respectively user one, user two ..., user N.
Identifying code generation module, for generating the first identifying code at random according to the memory space of application;Specifically, identifying code
Generation module is random 8 verifications code generator built in mobile hard disk, prompts user's N inputs to use by the display interface at the ends PC
The phone number of the affiliated mobile terminal in family inputs hand for example, popping up a text box on the display interface at the ends PC for user
Machine number.Random 8 verifications code generator automatically generates 8 random verification codes according to the memory space that user applies, and triggers
60s timers built in mobile hard disk carry out countdown, and it is corresponding mobile whole that 8 random verification codes are also sent to phone number
End, mobile terminal receive 8 random verification codes.
Identifying code matching module, for matching the identifying code of input with the first identifying code;If the identifying code of input
It is matched with the first identifying code, then realizes and apllied memory space in storage device is encrypted.Specifically, the verification of the present embodiment
Code matching module is dynamic verification code comparator, the identifying code of input be the text box that is popped up on the display interface of the ends PC of user into
8 identifying codes that row input mobile terminal receives, and 8 identifying codes of input are matched with the first identifying code;If defeated
8 identifying codes entered are matched with 8 random verification codes that verification code generator generates, then user N is realized to institute in storage device
The memory space N encryptions of application.Wherein, input identifying code when be limited to 60s, if more than 60s, the identifying code inputted is invalid.
Memory module, the phone number for storing input, and the one-to-one correspondence for establishing phone number and memory space closes
System;Specifically, the memory module of the present embodiment is cell-phone number memory block, is stored with cell-phone number one and corresponds to subregion one, cell-phone number two
Corresponding subregion two, cell-phone number N correspond to subregion N, and so on.So showing being named as subregion one on the display interface at the ends PC
Cell-phone number one, subregion two be named as cell-phone number two, subregion N is named as cell-phone number N, convenient for subsequent lookups use.
In addition, after the completion of encryption, identifying code generation module is additionally operable to random when apllied memory space N is triggered
Generate the second identifying code;Specifically, if user N needs to operate subregion N, user needs the display interface at the ends PC
It is upper to search the subregion N for being named as cell-phone number N, when finding the location of subregion N, by clicking trigger, random 8 identifying codes
Generator automatically generates 8 random verification codes according to trigger signal, and triggers the 60s timers built in mobile hard disk and counted
When, 8 random verification codes are also sent to the corresponding mobile terminals of phone number N to prestore, mobile terminal receives 8 and tests at random
Demonstrate,prove code.
Identifying code matching module is additionally operable to match the identifying code of an input with the second identifying code;If the verification of input
Code is matched with the second identifying code, then realizes and decrypted to apllied memory space in storage device.Specifically, the present embodiment is tested
Card code matching module is dynamic verification code comparator, and the identifying code of input is the text box that user pops up on the display interface of the ends PC
8 identifying codes that input mobile terminal receives are carried out, dynamic verification code comparator is by 8 identifying codes of input and the second identifying code
It is matched;If 8 identifying codes of input are matched with 8 random verification codes that verification code generator generates, user N is realized
Any operation can be memory space N to apllied memory space N decryption, user N in storage device, such as replicate, is mobile,
Delete, format etc..If 8 random verification codes that 8 identifying codes of input are generated with verification code generator mismatch, use
Family N can not access any content in mobile hard disk or carry out any operation.Wherein, input identifying code when be limited to 60s, if
More than 60s, then the identifying code inputted is invalid.
The mobile hard disk of the present embodiment carries out subregion encryption, Information Security using dynamic verification code technology to mobile hard disk
It is high;It realizes memory space resource-sharing, reduces use cost.
Preferably, indicator light or loud speaker can be set on mobile hard disk, and indicator light or loud speaker are used to indicate user N
Whether application memory space succeeds, such as:If user's N application memory space successes, trigger signal to indicator light is so as to refer to
Show that lamp shows green light;If user N application memory space failure, trigger signal to indicator light so that indicator light shows red light,
It gives user and is visually known whether application memory space succeeds.Loud speaker can be by sending out " applying successfully in space " or " empty
Between apply failure " prompt tone.
Corresponding to the encryption method and mobile hard disk of the mobile hard disk described in above-described embodiment, the embodiment of the present invention also provides
A kind of decryption method of mobile hard disk, includes the following steps:
The communication connection of mobile hard disk and mobile terminal is established in S00, beginning;Specifically, on mobile hard disk there is communication to connect
Mouthful, such as USB interface, Type-C interfaces etc.;Mobile hard disk is connect with mobile terminal by the data line of the corresponding interface, is realized
Communication between storage device and mobile terminal.Wherein, mobile terminal can be the portable devices such as mobile phone or the ends PC.This implementation
The mobile hard disk of example connects the ends PC by USB interface.
S10, the apllied memory space of triggering;Specifically, if user N needs to operate subregion N, user needs
The subregion N for being named as cell-phone number N is searched on the display interface at the ends PC passes through click when finding the location of subregion N
Apllied subregion N generates trigger signal.
S20, the second identifying code is generated, the identifying code of an input is matched with the second identifying code;It is realized if matching
To apllied memory space decryption in storage device.Specifically, random 8 verifications code generator is given birth to automatically according to trigger signal
It at 8 random verification codes, and triggers the 60s timers built in mobile hard disk and carries out countdown, also send 8 random verification codes
To the corresponding mobile terminals of phone number N to prestore, mobile terminal receives 8 random verification codes, and the identifying code of input is user
The text box popped up on the display interface of the ends PC carries out 8 identifying codes that input mobile terminal receives, dynamic verification code comparator
8 identifying codes of input are matched with the second identifying code;If 8 identifying codes of input are generated with verification code generator
8 random verification code matchings, then user N, which is realized, decrypts apllied memory space N in storage device, and user N can be to storage
Space N does any operation, such as replicate, is mobile, deleting, format etc..If 8 identifying codes of input and verification code generator
8 random verification codes generated mismatch, then user N can not access any content in mobile hard disk or carry out any behaviour
Make.Wherein, input identifying code when be limited to 60s, if more than 60s, the identifying code inputted is invalid.
The decryption method of the present embodiment mobile hard disk is not in forget decruption key using dynamic verification code technology
Problem.
As a preferred embodiment, above-described embodiment can omit timer, i.e., what random 8 verifications code generator generated
In one cycle effectively, a cycle refers to user N to the encrypted processes of subregion N or user N to subregion to identifying code
The process of N decryption.Suitable for the application scenarios not high to security requirement.
Above-mentioned N is natural number, is label.
Above-mentioned mobile hard disk may be replaced by the storage devices such as USB flash disk, mobile phone, computer.
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 to be built-in with disk, random 8 verifications on mobile hard disk
Code generator, 60s timers, dynamic verification code comparator, cell-phone number memory block.The total disk space of the mobile hard disk is 6T.
Mobile hard disk is connect by USB data line with the ends PC to realize that mobile hard disk is communicated with the ends PC, at the ends PC
Upper operation mobile hard disk encryption software, first, the window of the display screen pop-up application memory space at the ends PC, user one are deposited 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 apllied memory space then applies for that memory space success, the display screen at the ends PC are popped up subscriber phone number input interface, used
One input handset number one of family, the random 8 verifications code generator of triggering generates 8 the first identifying codes at random, and triggers 60s timers
Countdown is carried out, 8 random verification codes are also sent to one corresponding mobile terminal of cell-phone number, mobile terminal receives 8 at random
Identifying code.User needs to input 8 accidental validations that mobile terminal receives in 60s, and dynamic verification code comparator is by the 8 of input
Position accidental validation is matched with 8 the first identifying codes, if matching, realization adds apllied memory space in mobile hard disk
Close, cell-phone number one is stored in cell-phone number memory block, and the application of subregion one is completed, and the mark of subregion one is named as cell-phone number one, convenient
Follow-up search uses.
If have it is next need to apply, wait for next user to apply for that memory space, user two can rerun shifting
Dynamic HD encryption software can also be clicked after user one completes to the encryption of subregion one in mobile hard disk encryption software interface
" applying for memory space again " button, the ends PC display screen pop-up application memory space window, user two application store
The window input application memory space 3T in space, since the remaining space of current mobile hard disk is 4T, therefore can accommodate user two
Apllied memory space then applies for that subscriber phone number input interface, user are popped up in memory space success, the display screen at the ends PC
Two input handsets number two, triggering it is random 8 verification code generator at random generate 8 third identifying codes, and trigger 60s timers into
8 random verification codes are also sent to two corresponding mobile terminal of cell-phone number by row countdown, and mobile terminal receives 8 and tests at random
Demonstrate,prove code.User needs to input 8 accidental validations that mobile terminal receives in 60s, and dynamic verification code comparator is by 8 of input
Accidental validation is matched with 8 third identifying codes, if matching, realization adds apllied memory space in mobile hard disk
Close, cell-phone number two is stored in cell-phone number memory block, and the application of subregion two is completed, and the mark of subregion two is named as cell-phone number two, convenient
Follow-up search uses.
If have it is next need to apply, wait for next user to apply for that memory space, user three can rerun shifting
Dynamic HD encryption software can also be clicked after user two completes to the encryption of subregion two in mobile hard disk encryption software interface
" applying for memory space again " button, the ends PC display screen pop-up application memory space window, user three application store
The window input application memory space 2T in space, since the remaining space of current mobile hard disk is 1T, therefore cannot accommodate user
Three apllied memory spaces, then the display screen pop-up prompt window " insufficient space, application failure " at the ends PC is to prompt application to deposit
Space failure is stored up, in addition prompt window also prompts the remaining space 1T of current mobile hard disk;The window of application memory space is returned,
If user three apply 1T memory space can also, user three application memory space window input application memory space
1T since the remaining space of current mobile hard disk is 1T, therefore can accommodate two apllied memory space of user, then apply storing
The display screen of space success, the ends PC pops up subscriber phone number input interface, three input handset number three of user, random 8 of triggering
It verifies code generator and generates 8 the 5th identifying codes at random, and trigger 60s timers and carry out countdown, also by 8 random verification codes
It is sent to three corresponding mobile terminal of cell-phone number, mobile terminal receives 8 random verification codes.User, which needs to input in 60s, to move
8 accidental validations that dynamic terminal receives, dynamic verification code comparator by 8 accidental validations of input and 8 the 5th identifying codes into
Row matching is realized if matching and is stored in cell-phone number storage to apllied memory space encryption, cell-phone number three in mobile hard disk
Area, the application of subregion three are completed, and the mark of subregion three is named as cell-phone number three, and convenient follow-up search uses;So far, user three completes
Encryption to subregion three, and whole spaces of mobile hard disk are occupied, if next user also needs application memory space,
While the window of pop-up application memory space, directly the memory space of mobile hard disk is prompted to expire.If user three is not required to
The memory space for applying for 1T, then directly terminate.
When user one needs to operate subregion one, then user one needs to search on the display interface at the ends PC to be named as
The subregion one of cell-phone number one generates trigger signal when finding the location of subregion one by clicking apllied subregion one;
Random 8 verifications code generator automatically generates 8 random verification codes according to trigger signal, and triggers the 60s built in mobile hard disk
Timer carries out countdown, and 8 random verification codes are also sent to the one corresponding mobile terminal of cell-phone number to prestore, mobile terminal
8 random verification codes are received, the identifying code of input is that the text box that user pops up on the display interface of the ends PC carries out input movement
Terminal receive 8 identifying codes, dynamic verification code comparator by 8 identifying codes of input with verification code generator generate 8
Random verification code is matched;If 8 identifying codes of input are matched with 8 random verification codes that verification code generator generates,
Then user one realizes and is decrypted to apllied subregion one in storage device that user one can do any operation to subregion one, such as multiple
System, mobile, deletion, formatting etc..Otherwise, any operation cannot be executed to mobile hard disk.
When user two needs to operate subregion two, then user two needs to search on the display interface at the ends PC to be named as
The subregion two of cell-phone number two generates trigger signal when finding the location of subregion two by clicking apllied subregion two;
Random 8 verifications code generator automatically generates 8 random verification codes according to trigger signal, and triggers the 60s built in mobile hard disk
Timer carries out countdown, and 8 random verification codes are also sent to the two corresponding mobile terminal of cell-phone number to prestore, mobile terminal
8 random verification codes are received, the identifying code of input is that the text box that user pops up on the display interface of the ends PC carries out input movement
Terminal receive 8 identifying codes, dynamic verification code comparator by 8 identifying codes of input with verification code generator generate 8
Random verification code is matched;If 8 identifying codes of input are matched with 8 random verification codes that verification code generator generates,
Then user two realizes and is decrypted to apllied subregion two in storage device that user two can do any operation to subregion two, such as multiple
System, mobile, deletion, formatting etc..Otherwise, any operation cannot be executed to mobile hard disk.
And so on.
The mobile hard disk of the real case utilizes dynamic verification code technology, realizes that subregion encryption, memory space are shared;Except
Primary application memory space need to be separately provided it is outer, behind need to only utilize mobile phone reception dynamic verification code be verified, will not
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 implementation mode, and
These changes should also be regarded as the scope of the invention.