Introduction of this project

This project aims to enhance the performance of encryption in Joplin across all platforms.
The current encryption implementation in Joplin is based on sjcl, which is a pure Javascript library without any performance optimization at the hardware level. By migrating to native crypto libraries, users can expect faster speeds and improved user experience, particularly on mobile platforms.

Project Goals

  1. Migrate to better encryption algorithms and faster/native crypto libraries
    • Use AES-GCM mode.
    • For desktop clients, use the crypto library in Node.js
    • For mobile clients, find a faster and reliable React Native library with the support of AES-GCM mode.
    • If no proper crypto library for React Native is found, implement the cipher with native code and create a React Native library as a wrapper for it.
      • For Android: Use javax.crypto
      • For iOS: Use Common Crypto library or OpenSSL
    • The key size could be 128, 192 or 256 bits, depending on the performance of the final implementation.
  2. Re-implement the encryption/decryption in sjcl with faster crypto libraries (optional)
    • Implement AES-CCM mode.
    • For desktop clients, use the crypto library in Node.js
    • For mobile clients, find a faster and reliable React Native library with the support of AES-CCM mode. (We plan to use react-native-quick-crypto but the OpenSSL binaries in it don't support CCM mode)
    • If no proper crypto library for React Native is found, implement the cipher with native code and create a React Native library as a wrapper for it.
      • For Android: Use javax.crypto (Doesn't support CCM mode)
      • For iOS: Use OpenSSL
  3. Reduce the size of encrypted notes (optional)
    • Investigate if it's possible to save the encrypted notes in binary format rather than base64 encoded text.
    • Refactor EncryptionService and related code in Joplin, to support encrypted notes with binary format.
    • Use the low-level encrypt/decrypt function in sjcl library to test the refactored EncryptionService.
    • Replace sjcl with the crypto libraries in Goal #1

Note: These goals don't come in a specific order. I might process them in parallel and evaluate if the optional goals are feasible based on the progress.

Link

GSoC project page

8 Likes