Skip to content

Secure filedrop #362

@tobiasKaminsky

Description

@tobiasKaminsky
  • create an encrypted folder
  • share it as "file drop only"
  • any user can drop a file into this folder via web ui
  • it will be encrypted with public key, so that only owner can decrypt it

Clients will re-encrypt metadata once they sync folder.

Details:

Web UI

Link creation

  • can be created in clients exclusively, not in web UI

Upload process in the files drop page

  • for each file to be uploaded:
  • lock folder using OCS endpoint (see docs)
  • encrypt file with asymmetric AES (https://github.com/nextcloud/end_to_end_encryption_rfc/blob/master/RFC.md#uploading-new-files)
  • upload the encrypted file: Webdav PUT to the files drop endpoint, use the string from the previous bullet point as file name
  • get the metadata file from the folder, or create if not exists (the file itself is not encrypted)
  • update metadata (currently https://github.com/nextcloud/end_to_end_encryption_rfc/blob/master/RFC.md#create-metadata-file)
    • "filesdrop" as array with each encrypted entry per file (we use a separate entry because in the future there will be different keys)
    • add to "filesdrop" new entry with (just like now)
      • use encryption RSA/ECB/OAEPWithSHA-256AndMGF1Padding algo
      • encrypted file name as index
      • key
      • filename
      • mimetype
      • version
      • "initializationVector"
      • "authenticationTag"
      • no need for other fields
    • retrieves public key
    • encrypt entry of "filesdrop" with public key
  • upload+overwrite metadata file (OCS specific endpoint)
  • unlock folder

Clients will do:

  • create secure fileshare link
    • this requires a new endpoint, please add (@CarlSchwan)
    • will be shown on any encrypted folder, also non-empty ones
  • upon refresh of encrypted folder
    • check for entries in "filesdrop"
    • if there is one
      • lock folder
      • update metadata: move all "filesdrop" entries to "files" entry
      • upload metadata file
      • unlock folder

ToDo:

  • write possible attack vector
    • rogue admin can remove entries

Server

Until 8.12:
App: @CarlSchwan

From 8.12 to 22.12:
Android: @tobiasKaminsky
iOS: @marinofaggiana
Desktop: @allexzander

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

☑️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions