Rocket.Chat.ReactNative/app/lib/encryption
Diego Mello fade17d0de
[IMPROVEMENT] Add `Change Encryption Password` and `Reset E2E Key` (#2542)
* init

* Basic tests passing

* Add SecurityPrivacyView

* List.Item

* section

* Start removing theme as prop

* Remove StatusBar theme prop

* SafeAreaView theme prop

* Minor fixes

* List.Container

* Add translateTitle and translateSubtitle props

* Storybook

* Show action indicator

* Header

* Info

* Theme stories

* FlatList

* DisplayName

* Fix settings

* FlatList tweaks

* ThemeView

* Screen Lock Config

* DefaultBrowserView

* PickerView and User Prefs

* Notification Prefs

* StatusView

* Auto Translate

* InviteUsersEdit

* Visitor

* Minor fixes

* Remove Separator

* Remove iteminfo

* Font scale

* Legal

* Jitsi and e2e

* Block

* search, star, etc

* auto translate and notifications

* RoomInfo

* Refactor RoomActions

* lint

* Remove DisclosureIndicator

* padding horizontal 12

* Detox

* Tests

* SecurityPrivacy

* E2E encryption sec view

* stash

* Reset own key

* Reset key

* Change password

* Hide content

* Small refactor

* Fix tests

* Tests passing

* Change test order

* add pt-br

* Address review comments

* tests

* Missing i18n ptbr

Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
2020-10-30 15:31:04 -03:00
..
README.md [NEW] E2E Encryption (#2394) 2020-09-11 11:31:38 -03:00
constants.js [NEW] E2E Encryption (#2394) 2020-09-11 11:31:38 -03:00
encryption.js [IMPROVEMENT] Add `Change Encryption Password` and `Reset E2E Key` (#2542) 2020-10-30 15:31:04 -03:00
index.js [NEW] E2E Encryption (#2394) 2020-09-11 11:31:38 -03:00
room.js [NEW] E2E Encryption push (iOS) (#2463) 2020-09-24 15:34:13 -03:00
utils.js [NEW] E2E Encryption (#2394) 2020-09-11 11:31:38 -03:00

README.md

Rocket.Chat Mobile

E2E Encryption

Note: This feature is currently in beta. Uploads will not be encrypted in this version. You can check this documentation for further information about the web client.

How it works

  • Each user has a public and private key (asymmetric cryptography).
  • The user private key is stored encrypted on the server and it can be decrypted on clients only using the user E2E encryption password.
  • A room key is generated using the public key of each room member (symmetric cryptography).
  • Users can decrypt the room key using their private key.
  • Each room has a unique identifier which make users able to request a room key.
  • The room unique identifier is called e2eKeyId and it's a property of the room collection.
  • The room key is called E2EKey and it's a property of the subscription collection.
  • After the room key is decrypted, the user is able to encrypt and decrypt messages of the room.

User keys

  • If the user doesn't have keys neither locally nor on the server, we create and encrypt them using a random password. These encrypted keys are sent to the server (so other clients can fetch) and saved locally.
  • If the user have keys stored on server, but doesn't have them stored locally, we fetch them from the server and request a password to decrypt the keys.

Room keys

  • If the room has a E2EKey, we decrypt it using the user key.
  • If the room doesn't have a E2EKey, but has a e2eKeyId, we emit an event on stream-notify-room-users sending the roomId and the e2eKeyId requesting the E2EKey from any online room member.
  • If the room have none of them, we create new ones and send them back to the server.