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,
dataPKandkeywordPK. - The client decides a name of the initial directory
initDirand encrypts its file path/'initDir'with thedataPKandkeywordPK, which results in the PKE and PKSE ciphertextsdataCTandkeywordCT. - The client posts the
dataPK,keywordPK,dataCT, andkeywordCTto 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
userIdinto the Path table, where apermissionHashis derived fromuserIdand a root file path/by the remote server. - The remote server returns
userIdto the client. - The client derives
permissionHashfrom the returneduserIdand/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
sharedKeyand encrypts it withdataPK, which results in the shared key encryptionsharedKeyCT. - The client posts the
pathIdandsharedKeyCTto the remote server. - The remote server inserts the provided
pathIdandsharedKeyCTinto the Shared key table. - The client constructs a bit string called
contentsDataas the following table: - The client encrypts the
contentsDatawith thesharedKey, which results incontentsCT. - The client computes the hash value
sharedKeyHashand postscontentsCTandsharedKeyHashto the remote server. - The remote server inserts the provided
contentsCTandsharedKeyHashinto 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 pathIds 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
permissionHashfrom theuserIdand 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
dataCTand find thepathIdwhose 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
sharedKeyfrom thesharedKeyCTin the returned record. - The client requests the record in the Contents table where a value of the SharedKeyHash column is equal to
sharedKeyHashderived fromsharedKey. - The remote server returns the requested record in the Contents table.
- The client decrypts the
contentsCTin 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
permissionHashfrom theuserIdand thefilePathand 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
filePathas 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
contentsDatalocated inParent(filePath)in the same way as the file/directory retrieve process. - The client parse the
contentsDataas(isFile, numReadableUsers, readableUserPathIds, fileBytes). - The client generates a fresh shared key
sharedKeyand derives its hashsharedKeyHash. - For each
pathIdin 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
usedIdfrom 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
dataPKandkeywordPKfrom the returned record and encrypts thefilePathwith these keys, which results in thedataCTandkeywordCT, respectively. - The client also derives the
permissionHashfrom theuserIdand theParent(filePath)and posts theuserId,permissionHash,dataCT, andkeywordCTto the remote server. - The remote server inserts the provided data into the Path table and returns a new
pathId. - The client encrypts the
sharedKeywith thedataPK, which results in thesharedKeyCT. - The client posts the
pathIdandsharedKeyCTto 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
contentsDataas the following table and encrypts it with thesharedKey, which results in thecontentsCT. - The client posts the
sharedKeyHashandcontentsCTto 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
contentsDatalocated inParent(filePath)in the same way as the file/directory retrieve process. - The client parse the
contentsDataas(isFile, numReadableUsers, readableUserPathIds, fileBytes). - The client generates a fresh shared key
sharedKeyand derives its hashsharedKeyHash. - For each
pathIdin 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
usedIdfrom 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
dataPKandkeywordPKfrom the returned record and encrypts thefilePathwith these keys, which results in thedataCTandkeywordCT, respectively. - The client also derives the
permissionHashfrom theuserIdand theParent(filePath)and posts theuserId,permissionHash,dataCT, andkeywordCTto the remote server. - The remote server inserts the provided data into the Path table and returns a new
pathId. - The client encrypts the
sharedKeywith thedataPK, which results in thesharedKeyCT. - The client posts the
pathIdandsharedKeyCTto 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
contentsDataas the following table and encrypts it with thesharedKey, which results in thecontentsCT. - The client posts the
sharedKeyHashandcontentsCTto 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
contentsDataandsharedKeyof the file located infilePathin the same way as the file/directory retrieve process. - The client parse the
contentsDataas(isFile, numReadableUsers, readableUserPathIds, fileBytes). - The client constructs a new
contentsDataas the following table and encrypts it with thesharedKey, which results in thecontentsCT. - The client posts the
sharedKeyHashandcontentsCTto 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.