Disclosure of Invention
The invention provides an online examination management system based on blockchain and CP-ABE, which overcomes the technical defects that the existing online examination system has easy data tampering and easy examination content leakage.
The invention also provides an application method of the block chain and CP-ABE based on-line examination management system.
In order to solve the technical problems, the technical scheme of the invention is as follows:
the system comprises a data node, a right management unit, a CP-ABE subsystem and a blockchain network; wherein:
the right management unit distributes access and modification rights for the data node;
the right judging unit is used for judging the access right of the data node;
the CP-ABE subsystem is used for encrypting, namely decrypting, the data based on the attribute and writing or reading the data in the blockchain network;
and the data node performs information interaction with the blockchain network through the CP-ABE subsystem.
The data nodes comprise manager nodes, examinee nodes and examinee nodes; and the manager node distributes access and modification authorities for the examinee node and the examinee node through the authority management unit.
The CP-ABE subsystem comprises a data encryption unit, a data decryption unit and a data interaction unit; wherein:
the data encryption unit encrypts according to the result of the authority judging unit and writes the encrypted data into the blockchain network through the data interaction unit;
the data decryption unit obtains the encryption information according to the result of the authority judgment unit, and obtains the encryption data corresponding to the encryption information in the blockchain network through the data interaction unit to decrypt.
The application method of the block chain and CP-ABE based on-line examination management system comprises the following steps:
s1: when a user registers, a system administrator node gives authority to each node according to user information, wherein the authority comprises a test officer authority and an examinee authority;
s2: when a user logs in, the user acquires a corresponding secret key according to the authority, and executes corresponding operation by utilizing the CP-ABE subsystem;
s3: the CP-ABE subsystem encrypts data according to the modification operation of the examinee authority and stores the data in the blockchain network;
s4: the CP-ABE subsystem calls the data in the blockchain network according to the authority of the examinee, decrypts the data, and encrypts and stores the data according to the modified data;
s5: the system manager node scores the modified data of the examinees through the intelligent contracts, and the examinees with corresponding authorities can check the scoring results.
Wherein, the examination right comprises a subject attribute and an examination right attribute; after the examination official node is endowed with the examination official authority, compiling test questions corresponding to the subjects, and encrypting and storing the test questions in a blockchain network by utilizing a CP-ABE subsystem; the right of the test officer does not have the attribute of accessing the CP-ABE encrypted data, and the record cannot be modified.
Wherein, the examinee rights comprise a subject attribute and an examinee attribute; after the examinee node is endowed with the examinee authority, the CP-ABE subsystem decrypts the corresponding objective test questions of the department by the blockchain network and sends the test questions to the examinee node; after the examinee node finishes the answer, the CP-ABE subsystem uses the new access tree to encrypt and endow the access authority to the system administrator node.
Wherein in said step S1, a system administrator node gives each node rights through said rights management unit.
In step S2, the user obtains the corresponding key through the permission determination unit.
In the step S3, the CP-ABE subsystem encrypts data through the data encryption unit, and the data interaction unit stores the encrypted data in the blockchain network.
Wherein, in the step S4, the CP-ABE subsystem calls the data in the blockchain network through the data interaction unit and decrypts the data by the data decryption unit.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
the invention provides an online examination management system based on a blockchain and a CP-ABE and an application method thereof, which utilize the inherent advantages of consistent data, difficult tampering and traceability of the data of the blockchain, combine a CP-ABE subsystem to encrypt the data, and only a user endowed with corresponding attributes by a system administrator node can successfully access the data, thereby effectively preventing test questions or achievements from being tampered maliciously and ensuring the stable performance of the online examination.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the present patent;
for the purpose of better illustrating the embodiments, certain elements of the drawings may be omitted, enlarged or reduced and do not represent the actual product dimensions;
it will be appreciated by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical scheme of the invention is further described below with reference to the accompanying drawings and examples.
Example 1
As shown in FIG. 1, the blockchain and CP-ABE based on-line examination management system comprises a data node 1, a right management unit 2, a CP-ABE subsystem 3 and a blockchain network 4; wherein:
the right management unit 2 distributes access and modification rights for the data node 1;
the right judging unit 3 is used for judging the access right of the data node 1;
the CP-ABE subsystem 3 is configured to encrypt, i.e. decrypt, data based on attributes, and write or read data in the blockchain network 4;
the data node 1 performs information interaction with the blockchain network 4 through the CP-ABE subsystem 3.
More specifically, the data node 1 includes an administrator node 11, an examinee node 12, and an examinee node 13; the administrator node 11 allocates access and modification rights to the candidate node 12 and the candidate node 13 through the rights management unit 2.
More specifically, the CP-ABE subsystem 3 includes a data encryption unit 31, a data decryption unit 32, and a data interaction unit 33; wherein:
the data encryption unit 31 encrypts the data according to the result of the authority judging unit 3 and writes the encrypted data into the blockchain network 4 through the data interaction unit 33;
the data decryption unit 32 obtains the encrypted information according to the result of the authority judgment unit 3, and obtains the encrypted data corresponding to the encrypted information in the blockchain network 4 through the data interaction unit 33 to decrypt.
In a specific implementation, each data node 1 in the system has different rights, and the system administrator node 11 generates a public key, a private key and an account using the personal information of the user. The system administrator node 11 assigns the "test" attribute to the test taker node 12, at which time the test taker may edit the test questions in the form of transactions in the system. After receiving the "test taker" attribute assigned by the system administrator node 11, the test taker node 13 may take an examination and then encrypt and store the data. Afterwards, the system administrator node 11 scores the answers through the intelligent contracts, and the examinees with the corresponding attributes can check the results.
In a specific implementation process, the system administrator node 11 gives authority to each node through the authority management unit 2; the user obtains the corresponding secret key through the authority judging unit 3; the CP-ABE subsystem 4 encrypts data through the data encryption unit 41 and is stored in the blockchain network 5 by the data interaction unit 43; the CP-ABE subsystem 4 invokes data in the blockchain network 5 through the data interaction unit 43 and is decrypted by the data decryption unit 42.
Example 2
More specifically, as shown in fig. 2, the application method of the online examination management system based on the blockchain and the CP-ABE comprises the following steps:
s1: when a user registers, a system administrator node 11 gives authority to each node according to user information, wherein the authority comprises a test officer authority and an examinee authority;
s2: when a user logs in, the user acquires a corresponding secret key according to the authority, and executes corresponding operation by utilizing the CP-ABE subsystem 4;
s3: the CP-ABE subsystem 4 encrypts data according to the modification operation of the examinee authority and stores the data in the blockchain network 5;
s4: the CP-ABE subsystem 4 calls the data in the blockchain network 5 according to the authority of the examinee, decrypts the data, and encrypts and stores the data according to the modified data;
s5: the system manager node 11 scores the modified data of the examinees through the intelligent contracts, and the examinees with corresponding authorities can check the scoring results.
More specifically, the examinee rights include a "subject" attribute and an "examinee" attribute; after the examination official node 12 is given the examination official authority, compiling test questions corresponding to the examination matters, and encrypting and storing the test questions in the blockchain network 5 by utilizing the CP-ABE subsystem 4; the right of the test officer does not have the attribute of accessing the CP-ABE encrypted data, and the record cannot be modified.
More specifically, the examinee rights include a subject attribute and an examinee attribute; after the examinee node 13 is given the examinee authority, the CP-ABE subsystem 4 decrypts the corresponding objective test questions by the blockchain network 5 and sends the test questions to the examinee node 13; after the examinee node 13 completes the answer, the CP-ABE subsystem 4 encrypts and gives access rights to the system administrator node 11 using the new access tree.
More specifically, in the step S1, the system administrator node 11 gives the authority to each node through the authority management unit 2.
More specifically, in the step S2, the user acquires the corresponding key through the right judgment unit 2.
More specifically, in the step S3, the CP-ABE subsystem 4 encrypts data through the data encryption unit 41 and stores the encrypted data in the blockchain network 5 through the data interaction unit 43.
More specifically, in the step S4, the CP-ABE subsystem 4 invokes the data in the blockchain network 5 through the data interaction unit 43 and is decrypted by the data decryption unit 42.
In the specific implementation process, the examinee enters the system by inputting an account number and a password, and meanwhile, the public key and the private key are issued. The system manager node 11 confirms the identity of the examinee through the authority judging unit 2 and gives the attribute of 'subject' and 'examinee' to the examinee; at this time, the test questions may be written by the test staff node, encrypted, and stored in the blockchain network 5; when the test questions are modified by the examinee, the record cannot be modified if the attributes required by the CP-ABE encrypted data are not accessed. In addition, when the test questions are modified, the administrator node 11 is required to open the authority and record the related modification information in the blockchain network 5.
In the specific implementation process, the examinee node 13 inputs an account number and a password into the system, and after the system administrator node confirms the examinee through the permission judging unit 2, the examinee node 13 will receive corresponding "subjects" and "examinee" attributes. When an examinee examines, the system administrator node 11 checks the latest version of test questions stored in the system and modifies the access tree for performing access authority control by attribute-based encryption, so that the examinee node without the corresponding attribute has no authority to perform the examination. After the test taker node 13 completes the answer, it encrypts it using the new access tree, allowing the system administrator to verify the answer.
In the specific implementation process, after the examination is finished, the system administrator node 11 checks the answer submitted by the examinee, takes the answer of the examinee as the input value of the intelligent contract function, and the output result is the score of the examinee. The result is stored in the blockchain network 5 by attribute-based encryption as the examinee account password and the 'examinee' attribute. Each examinee inquires the results through the corresponding account passwords and the attributes of the examinees.
In the specific implementation process, the advantages of consistent data, difficult tampering and traceability of the data inherent in the blockchain network 5 are utilized, the data are encrypted by combining the CP-ABE subsystem 4, and only users endowed with corresponding attributes by the system administrator node 11 can successfully access the data, so that the test questions or results are effectively prevented from being tampered maliciously, and the stable performance of the online test is ensured.
It is to be understood that the above examples of the present invention are provided by way of illustration only and not by way of limitation of the embodiments of the present invention. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the invention are desired to be protected by the following claims.