Step 3: When Student A finishes his homework and final examination , he searches for the public key of Teacher B by , encrypts with the public key , generates , calculates , and uploads by invoking the chaincode WorkUpload. The chaincode is shown in Algorithm 4.