Summary of the invention
Its purpose of the present invention just is to provide a kind of file security storage means of multinode Network Based; Thereby solved the not enough or excessive problem of redundancy of fail safe in the existing network file storage; Under the situation that guarantees minimum redundancy, provided the file division storage algorithm of Maximum Safety.
The technical scheme that realizes above-mentioned purpose and take comprises
(1) obtain the separate memory node that has possessed and count N, said separate give away secrets or damage for arbitrary node can not cause all the other nodes to give away secrets or damage;
(2) original document is encrypted;
(3) according to memory node quantity N, encrypt file is cut into N (N-1)/2 a file sheet, every size is any, and each file sheet is numbered;
(4) the file sheet is stored in N the node; Every node storage N-1 sheet; And make that a file sheet is all arranged between any two nodes is identical; And each file sheet is all occurring twice in the node altogether, and promptly the total memory space of each node is the twice of original document size, and the code distance of stored file numbering is 1 in any two nodes.
Compared with prior art the present invention has the following advantages.
1, can adapt to a large amount of memory nodes and carry out the network storage.
2, can resist effectively to divulge a secret in inside and the network hacker invasion, as long as invasion node number is not more than N-2 (it is individual to contain N-2), all can't utilize node file sheet to synthesize original document in N the memory node, file all is safe in theory.
3, any node lost efficacy because of any reason, all can not cause data to recover, and can restore the unique file sheet constituted mode of this node through all the other nodes.
4, through any N-1 node, all can restore original document.
Embodiment
As shown in Figure 1, comprise
(1) obtain the separate memory node that has possessed and count N, said separate give away secrets or damage for arbitrary node can not cause all the other nodes to give away secrets or damage;
(2) original document is encrypted;
(3) according to memory node quantity N, encrypt file is cut into N (N-1)/2 a file sheet, every size is any, and each file sheet is numbered;
(4) the file sheet is stored in N the node; Every node storage N-1 sheet; And make that a file sheet is all arranged between any two nodes is identical; And each file sheet is all occurring twice in the node altogether, and promptly the total memory space of each node is the twice of original document size, and the code distance of stored file numbering is 1 in any two nodes.
As shown in Figure 2, said file slice encode algorithm is following:
1. obtain memory node and count N;
2. a [N] [N-1] that defines arrays is used for collecting every node files stored sheet numbering (index bound is a [0] [0] ~ a [N-1] [N-2]), and the span of array is node file sheet numbering 1 ~ N (N-1)/2;
3. initialization row, row subscript and file sheet are numbered, and respectively with i, j, m represent, and i=0, m=1;
If 4. i >=N-1, jump to 10.
⑤?j=i;
If 6. j >=N-1, jump to 4. 9.
7. the value among a [i] [j] and a [j+1] [i] is changed to m;
8. m=m+1; J=j+1; Jump to 6.
9. 4. i=i+1 jumps to
10. accomplish the file slice encode, the numbering of the file sheet of depositing in corresponding respectively N the node of a [0] ~ a [N-1].
The present invention proposes the file security storage means of multinode Network Based, and concrete characteristic may further comprise the steps: (as shown in Figure 1)
1, obtains the separate memory node that has possessed and count N; The numerical value of N is big more; Then storage security is high more, can't cause simultaneously the raising of general act memory space, and " separate " is meant that arbitrary node is given away secrets or damaged and can not causes all the other nodes to give away secrets or damage here;
2, original document is encrypted with existing known way;
3, according to memory node quantity N, encrypt file is cut into N (N-1)/2 a file sheet, every size is any, and each file sheet is numbered, and note: file must be divided into N (N-1)/2, and this is the minimal redundancy dividing method;
4, the file sheet is stored in N the node; Every node storage N-1 sheet; And make that a file sheet is all arranged between any two nodes is identical; And each file sheet is all occurring twice in the node altogether, and promptly the total memory space of each node is the twice of original document size, and the code distance of stored file numbering is 1 in any two nodes.File slice encode algorithm is (flow chart is seen Fig. 2) as follows:
1. obtain memory node and count N;
2. a [N] [N-1] that defines arrays is used for collecting every node files stored sheet numbering (index bound is a [0] [0] ~ a [N-1] [N-2]), and the span of array is node file sheet numbering 1 ~ N (N-1)/2;
3. initialization row, row subscript and file sheet are numbered, and respectively with i, j, m represent, and i=0, m=1;
If 4. i >=N-1, jump to 10.
⑤ j=i;
If 6. j >=N-1, jump to 4. 9.
7. the value among a [i] [j] and a [j+1] [i] is changed to m;
8. m=m+1; J=j+1; Jump to 6.
9. 4. i=i+1 jumps to
10. accomplish the file slice encode, the numbering of the file sheet of depositing in corresponding respectively N the node of a [0] ~ a [N-1].
Embodiment
Existence conditions: N strange land memory device arranged, and a need to be keep secret files stored, embodiment be (following example is in N=5) as follows:
1, file is used existing compressed software such as ZIP through the mode that password is set; Carry out the burst compression; File is divided into S=N (N-1)/2, respectively called after Z (1), Z (2) ..., Z (S), when N=5; Total sheet number of file division is S=5 (5-1)/2=10 sheet, be numbered Z (1) Z (1), Z (2) ..., Z (10);
2, the file sheet is stored in N the node, every node storage N-1 sheet, and make that a file sheet is all arranged between any two nodes is identical, and each file sheet occurs in each node and only occurs twice.Can pass through following algorithm, but be not limited to following algorithm the file sheet divided into groups, be example with the C language, and establishing the memory node number is 5:
main()
{
The quantity of #define N 5 // definition strange land memory device
Int a [N] [N-1]; // create an array, subscript 0 is row, subscript 1 is row, a memory node institute of every line display files stored numbering
Int i, j, m; //i, j are respectively the ranks subscript, and m is a reference number of a document
M=1; // put the reference number of a document initial value
For (i=0; I < N-1; I++) />/ and following array is carried out assignment, the respective file numbering is put in the corresponding array
for(j=i;j<N-1;j++)
{
a[i][j]=m;
a[j+1][i]=m;
m++;
}
For (i=0; I < N; I++) />/ and display file sheet grouping situation, the file sheet that node of every behavior is preserved
{
for(j=0;j<N-1;j++)
printf("%5d",a[i][j]);
printf("\n");
}
}
Operation result is following:
1 2 3 4
1 5 6 7
2 5 8 9
3 6 8 10
4 7 9 10
Show:
The 1st memory node storage { Z (1), Z (2), Z (3), Z (4) }
The 2nd memory node storage { Z (1), Z (5), Z (6), Z (7) }
The 3rd memory node storage { Z (2), Z (5), Z (8), Z (9) }
The 4th memory node storage { Z (3), Z (6), Z (8), Z (10) }
The 5th memory node storage { Z (4), Z (7), Z (9), Z (10) }.