Skip to content
This repository has been archived by the owner on Apr 12, 2018. It is now read-only.

Cryptography details

Paul Feuvraux edited this page Dec 30, 2017 · 39 revisions

Crypto

Library

Key derivation

Encryption/Decryption

Auth

  • GMAC

Tag length (authentication data)

  • 128 only

Process

Registration

  • The passphrase is defined by the user
  • A random string is generated, let's call it CEK
  • The CEK is encrypted under the passphrase
  • The CEK is stored in the database

Connection

  • The user types his passphrase
  • Get the CEK
  • Try to decrypt the CEK under the passphrase
  • if fail --> bad passphrase
  • if success --> store it locally

Encryption & Decryption

Key derivation

  • Check if the CEK is stored locally (if not, log out the user)
  • Generate salt on 128 bits
  • Proceed to a key derivation under PBKDF2 with the CEK and the salt (strengthen by a factor of 7000 and 256 bits key size)

Encryption process

  • Generate the initialization vector on 128 bits for every chunk
  • Generate authentication data on 128 bits
  • Use GCM, encrypt the chunk
  • Encapsulate the auth' data + salt + initialization vector + encrypted content (=chunk)

Decryption

  • Do the inverse processs

"Passphrase" change

  • Check if the CEK is stored locally (if not, log out the user)
  • Encrypt the CEK under the new re-defined typed by the user
  • Send the CEK to the servers to store it in the database

Reset the CEK and the passphrase

  • Delete all the files and folders of the user
  • Generate a new CEK
  • Encrypt the CEK under the passphrase
  • Send the CEK to the servers to store it in the database

File Sharing

~~ coming soon ~~