What cryptographic protocol or algorithm I can use to encrypt/decrypt a subset of columns of a database table for each user?
For example say I have a database table with 50 columns
col1, col2, col3, col4......col50
Now I want to reveal the data such that
user1 can see (have access to) col15 and col17 only at time t1 and
user2 can see (have access to) col7, col9 and col20 only at time t1
user3 and user4 can both see data only in col40 at time t1.
user1 can see (have access to) col24 only (which means access to previously assigned col15 and col17 will be disabled) at time t2
user1 can have access to additional column say col 42 at time t3. so At time t3 user1 has access to both col24 and col42
I am thinking if I can issue tokens to users such that each token would hold access to set of columns in a database table or something like that.
What kind of efficient protocol or algorithm I can use to construct such scheme ?
My scalability requirements
At most I will have is probably 1000 columns (maximum) I can have millions or billions of users. Algorithms than can scale for millions is also ok