Client Specification
Author: Sora Suegami
A client of Sommelier Drive can manage files on the remote server in a similar manner to Unix file systems. It performs each operation in the background as below.
User registration
- A client generates new pairs of private and public keys of the PKE and PKSE schemes,
dataPK
andkeywordPK
. - The client decides a name of the initial directory
initDir
and encrypts its file path/'initDir'
with thedataPK
andkeywordPK
, which results in the PKE and PKSE ciphertextsdataCT
andkeywordCT
. - The client posts the
dataPK
,keywordPK
,dataCT
, andkeywordCT
to a remote server. - The remote server inserts the provided data into the User table and makes a new
userId
. - The remote server also inserts the provided ciphertexts and
userId
into the Path table, where apermissionHash
is derived fromuserId
and a root file path/
by the remote server. - The remote server returns
userId
to the client. - The client derives
permissionHash
from the returneduserId
and/
and requests the records in the Path table where a value of PermissionHash column is equal topermissionHash
. - The remote server returns the requested record in the Path table, which includes the id of the file path
pathId
. - The client generates a fresh shared key
sharedKey
and encrypts it withdataPK
, which results in the shared key encryptionsharedKeyCT
. - The client posts the
pathId
andsharedKeyCT
to the remote server. - The remote server inserts the provided
pathId
andsharedKeyCT
into the Shared key table. - The client constructs a bit string called
contentsData
as the following table: - The client encrypts the
contentsData
with thesharedKey
, which results incontentsCT
. - The client computes the hash value
sharedKeyHash
and postscontentsCT
andsharedKeyHash
to the remote server. - The remote server inserts the provided
contentsCT
andsharedKeyHash
into the Contents table.
Field Name | Bit Size | Description |
---|---|---|
isFile |
1 | 1 for a file, 0 for a directory. |
numReadableUsers |
64 | A big-endian integer of the number of users with read permission. |
readableUserPathIds |
64 * numReadableUsers |
A vector of pathId s corresponding to this contents. |
fileBytes |
variable | A byte string of the contents of the file for a file, an empty byte string for a directory. |
File retrieve (cat)
A client with the userId
will retrieve the contents of the file located in the filePath
as below.
- The client derives a
permissionHash
from theuserId
and the parent directory file pathParent(filePath)
and requests the records in the Path table where a value of PermissionHash column is equal topermissionHash
. - The remote server returns the requested records in the Path table.
- For each returned record, the client decrypts its
dataCT
and find thepathId
whose corresponding file path is equal to thefilePath
. - The client requests the record in the Shared key table where a value of the PathID column is equal to
pathId
. - The remote server returns the requested record in the Shared key table.
- The client recovers the
sharedKey
from thesharedKeyCT
in the returned record. - The client requests the record in the Contents table where a value of the SharedKeyHash column is equal to
sharedKeyHash
derived fromsharedKey
. - The remote server returns the requested record in the Contents table.
- The client decrypts the
contentsCT
in the returned record with thesharedKey
, which results in the desiredcontentsData
.
Children file paths retrieve (ls)
A client with the userId
will retrieve the children file paths under the filePath
as below.
- The client derives a
permissionHash
from theuserId
and thefilePath
and requests the records in the Path table where a value of PermissionHash column is equal topermissionHash
. - The remote server returns the requested records in the Path table.
- For each returned record, the client decrypts its
dataCT
. These recovered file paths are the children file paths under thefilePath
.
Descendant file paths retrieve (find)
A client with the userId
will retrieve the descendant file paths under the filePath
as below.
- The client generates a trapdoor with the PKSE private key for strings with
filePath
as prefix and requests the records in the Path table where a value of KeywordCT column matches the trapdoor. - The remote server returns the requested records in the Path table.
- For each returned record, the client decrypts its
dataCT
. These recovered file paths are the descendant file paths under thefilePath
.
File creation (touch)
A client with the userId
will locate a new file whose contents bytes are bytes
in the filePath
.
- The client retrieves the
contentsData
located inParent(filePath)
in the same way as the file/directory retrieve process. - The client parse the
contentsData
as(isFile, numReadableUsers, readableUserPathIds, fileBytes)
. - The client generates a fresh shared key
sharedKey
and derives its hashsharedKeyHash
. - For each
pathId
in thereadableUserPathIds
, the client and the remote server performs the following process:- The client requests the records in the Path table where a value of PathID column is equal to the
pathId
. - The remote server returns the requested record in the Path table.
- The client retrieves the
usedId
from the returned record and requests the records in the User table where a value of UserID column is equal to theuserId
. - The remote server returns the requested record in the User table.
- The client retrieves the
dataPK
andkeywordPK
from the returned record and encrypts thefilePath
with these keys, which results in thedataCT
andkeywordCT
, respectively. - The client also derives the
permissionHash
from theuserId
and theParent(filePath)
and posts theuserId
,permissionHash
,dataCT
, andkeywordCT
to the remote server. - The remote server inserts the provided data into the Path table and returns a new
pathId
. - The client encrypts the
sharedKey
with thedataPK
, which results in thesharedKeyCT
. - The client posts the
pathId
andsharedKeyCT
to the remote server. - The remote server inserts the provided data into the Shared key table.
- The client requests the records in the Path table where a value of PathID column is equal to the
- The client constructs a new
contentsData
as the following table and encrypts it with thesharedKey
, which results in thecontentsCT
. - The client posts the
sharedKeyHash
andcontentsCT
to the remote server. - The remote server inserts the provided data into the Contents table.
Field Name | Bit Size | Value |
---|---|---|
isFile |
1 | 1 |
numReadableUsers |
64 | numReadableUsers in Step 2. |
readableUserPathIds |
64 * numReadableUsers |
readableUserPathIds in Step 2. |
fileBytes |
variable | bytes |
Directory creation (mkdir)
A client with the userId
will locate a new directory in the filePath
.
- The client retrieves the
contentsData
located inParent(filePath)
in the same way as the file/directory retrieve process. - The client parse the
contentsData
as(isFile, numReadableUsers, readableUserPathIds, fileBytes)
. - The client generates a fresh shared key
sharedKey
and derives its hashsharedKeyHash
. - For each
pathId
in thereadableUserPathIds
, the client and the remote server performs the following process:- The client requests the records in the Path table where a value of PathID column is equal to the
pathId
. - The remote server returns the requested record in the Path table.
- The client retrieves the
usedId
from the returned record and requests the records in the User table where a value of UserID column is equal to theuserId
. - The remote server returns the requested record in the User table.
- The client retrieves the
dataPK
andkeywordPK
from the returned record and encrypts thefilePath
with these keys, which results in thedataCT
andkeywordCT
, respectively. - The client also derives the
permissionHash
from theuserId
and theParent(filePath)
and posts theuserId
,permissionHash
,dataCT
, andkeywordCT
to the remote server. - The remote server inserts the provided data into the Path table and returns a new
pathId
. - The client encrypts the
sharedKey
with thedataPK
, which results in thesharedKeyCT
. - The client posts the
pathId
andsharedKeyCT
to the remote server. - The remote server inserts the provided data into the Shared key table.
- The client requests the records in the Path table where a value of PathID column is equal to the
- The client constructs a new
contentsData
as the following table and encrypts it with thesharedKey
, which results in thecontentsCT
. - The client posts the
sharedKeyHash
andcontentsCT
to the remote server. - The remote server inserts the provided data into the Contents table.
Field Name | Bit Size | Value |
---|---|---|
isFile |
1 | 0 |
numReadableUsers |
64 | numReadableUsers in Step 2. |
readableUserPathIds |
64 * numReadableUsers |
readableUserPathIds in Step 2. |
fileBytes |
variable | Empty bytes |
File Modification
A client with the userId
will modify a file located in the filePath
with the bytes newBytes
.
- The client retrieves the
contentsData
andsharedKey
of the file located infilePath
in the same way as the file/directory retrieve process. - The client parse the
contentsData
as(isFile, numReadableUsers, readableUserPathIds, fileBytes)
. - The client constructs a new
contentsData
as the following table and encrypts it with thesharedKey
, which results in thecontentsCT
. - The client posts the
sharedKeyHash
andcontentsCT
to the remote server. - The remote server inserts the provided data into the Contents table.
Field Name | Bit Size | Value |
---|---|---|
isFile |
1 | 1 |
numReadableUsers |
64 | numReadableUsers in Step 2. |
readableUserPathIds |
64 * numReadableUsers |
readableUserPathIds in Step 2. |
fileBytes |
variable | newBytes |
Note that the other operations, e.g., file deletion, are not supported in the current implementation.