def METHOD_NAME(self, pk, M, attr_list):   
    if debug: print('Encryption Algorithm...')    
    # s will hold secret
    t = group.init(ZR, 0)
    s = group.random(); sx = [s]
    for i in range(len(attr_list)):
        sx.append(group.random(ZR))
        sx[0] -= sx[i]
    E3 = {}
    #E4, E5 = {}, {}
    for i in range(len(attr_list)):
        attr = attr_list[i]
        E3[attr] = group.hash(attr, G1) ** s
        #E4[attr] = pk['g_G1_b'] ** sx[i]
        #E5[attr] = (pk['g_G1_b2'] ** (sx[i] * group.hash(attr))) * (pk['h_G1_b'] ** sx[i])
    E1 = (pk['e(gg)_alpha'] ** s) * M
    E2 = pk['g_G2'] ** s
    return {'E1':E1, 'E2':E2, 'E3':E3, 'attributes':attr_list }