Research Article

Blockchain-Based Privacy Protection Scheme for IoT-Assisted Educational Big Data Management

Algorithm 1

Data center control utilities.
1: Initialization: Synchronize the blockchain object bc with blockchain nodes to get the newest state of the access model. Connect to the MongoDB database and get an object .
2: // verify the permission of an access request
3: function VERIFY(uid, hash, sig)
4:  // check if the user is offering correct signature to be identified as user uid
5:  if.verifySignature(uid, sig) == falsethen
6:    return false
7:  end if
8:  role = bc.getRole(uid)
9:  tags = bc.getTags(hash)
10:  fortagin tags do
11:   if.findState(role, tag) == falsethen
12:    return false
13:   end if
14:  end for
15:  fortag in tagsdo
16:   if.findState(role, tag) == truethen
17:    return true
18:   end if
19:  end for
20:  return false
21: end function
22: function RUNSERVER
23:  whiletruedo
24:    uid, hash, sig, addrFrom = getRequestParams()
25:    if verify(uid, hash, sig) == false then
26:     sendMessage("Authorization failed.")
27:    else
28:     sendMessage("Authorization suceed.")
29:     data =.getData(hash)
30:     sendData(addrFrom, data)
31:    end if
32:   end while
33: end function