25.01.2015 Views

Download Full Issue in PDF - Academy Publisher

Download Full Issue in PDF - Academy Publisher

Download Full Issue in PDF - Academy Publisher

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1430 JOURNAL OF COMPUTERS, VOL. 8, NO. 6, JUNE 2013<br />

Algorithm 2: Data <strong>in</strong>sert<strong>in</strong>g algorithm<br />

Input: < key, value > //a new tuple that is <strong>in</strong>sert<strong>in</strong>g<br />

<strong>in</strong>to the database<br />

Output:<br />

1 //Insert a new tuple<br />

< Enc(key, pk owner ), Enc(key, pk owner ) > <strong>in</strong>to<br />

database.;<br />

2 T =< Enc(key, pk owner ), Enc(value, pk owner ) >;<br />

3 Attach<br />

T =< Enc(key, pk owner ), Enc(value, pk owner ) ><br />

to the end of ma<strong>in</strong> database file;<br />

4 //<strong>in</strong>dex ma<strong>in</strong>ta<strong>in</strong><strong>in</strong>g;<br />

5 for each <strong>in</strong>dex do<br />

6 Construct its new keys key ′ ;<br />

7 t =<<br />

Enc(key ′ , pk owner ), Enc(key, pk owner ) >;<br />

8 if the last data block of <strong>in</strong>dex file is not full then<br />

9 (c key , c value )= ciphertext of last block ;<br />

10 c key = c l+1<br />

key + Enc(key, pk owner) mod n 2 ;<br />

11 c value = c l+1<br />

value + Enc(value, pk owner)<br />

mod n 2 ;<br />

12 Write (c key , c value ) back to file;<br />

13 else<br />

14 Attach T =<<br />

Enc(key, pk owner ), Enc(value, pk owner ) ><br />

to the end of <strong>in</strong>dex file.<br />

15 Send the <strong>in</strong>dex back to sp and replace old one ;<br />

Algorithm 3: Data delet<strong>in</strong>g algorithm<br />

Input: t =<<br />

Enc(key, pk owner ), Enc(value, pk owner ) >,<br />

database(ma<strong>in</strong> file and <strong>in</strong>dices)<br />

Output: database(ma<strong>in</strong> file and <strong>in</strong>dices) after<br />

deletion<br />

1 Select<br />

t =< Enc(key, pk owner ), Enc(value, pk owner )) ><br />

<strong>in</strong> ma<strong>in</strong> file and <strong>in</strong>dices.;<br />

2 //delet<strong>in</strong>g from ma<strong>in</strong> database file, is done by sp;<br />

3 Select the last tuple of ma<strong>in</strong> database file as t 1 ;<br />

4 Replace t with t 1 ;<br />

5 //delet<strong>in</strong>g from <strong>in</strong>dex;<br />

6 for each <strong>in</strong>dex do<br />

7 Construct key key ′ ;<br />

8 Let t =<<br />

Enc(key ′ , pk owner ), Enc(key, pk owner ) >;<br />

9 F<strong>in</strong>d the block b t <strong>in</strong> which t is the ith key;<br />

10 F<strong>in</strong>d the last key block b l <strong>in</strong> <strong>in</strong> which key t l is<br />

<strong>in</strong> b l ;<br />

11 b t = b t /t i∗(l+1) ∗ t i∗(l+1)<br />

l<br />

mod n 2 ;<br />

12 b l = b l /t l mod n 2 ;<br />

13 Send the <strong>in</strong>dex file to sp and replace old one;<br />

Figure 3: An example of query<strong>in</strong>g<br />

We know, the query algorithm is oblivious for data user.<br />

The data user encrypted additive reverse of queried key<br />

at first, and send it to service provider. Then the service<br />

provider extends it <strong>in</strong>to queried block, and chooses proper<br />

<strong>in</strong>dex to multiple the queried block with a key block, and<br />

as follows, the product is sent to data owner one by one.<br />

When the data owner receives the product, it decrypts<br />

the cipher and decomposes the pla<strong>in</strong>text to f<strong>in</strong>d which<br />

one is 0, which means the accord<strong>in</strong>g key <strong>in</strong> the block<br />

is equal to queried key. The serial numbers of the key<br />

are sent back to the service provider, service provider<br />

can get the key <strong>in</strong> ma<strong>in</strong> data file and get queried data<br />

for the data owner. This process will term<strong>in</strong>ated when the<br />

queried key is found or all blocks <strong>in</strong> the <strong>in</strong>dex is searched.<br />

To database applications, query<strong>in</strong>g is the most common<br />

operation. In our solution, all of the three roles, service<br />

provider, data owner and data user must participant <strong>in</strong><br />

the query<strong>in</strong>g process. To preserve both data owner and<br />

user privacy, query<strong>in</strong>g process is more complex than <strong>in</strong><br />

traditional database system. Fig. 4 presents the query<strong>in</strong>g<br />

protocol <strong>in</strong> detail.<br />

D. Security analysis<br />

Figure 4: Query protocol<br />

In this protocol, data user prompts a query by encrypt<strong>in</strong>g<br />

additive <strong>in</strong>verse of queried key with public key of data<br />

owner and sends it to the service provider. The second<br />

step starts when the service provider receives a query<br />

request. The service provider chooses proper <strong>in</strong>dex, and<br />

then a 1024 bits big <strong>in</strong>teger M is composed by repeat<strong>in</strong>g<br />

the queried key several times. Then multiplies M by each<br />

key block respectively, and sends the results to data owner.<br />

When the data owner receives the products, he decrypts<br />

the cipher and decomposes the pla<strong>in</strong>text to f<strong>in</strong>d 0 <strong>in</strong> each<br />

© 2013 ACADEMY PUBLISHER

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!