This guide is intended for developers who want to contribute to the project. It is not intended for users who want to use the project.
Clone the cloak repository:
git clone https://github.com/cloak-dev/cloak
Clone the docs repository:
git clone https://github.com/cloak-dev/docs
Any modern browser should work. In particular, the WebCrypto API must be available.
Read our blog post on how end-to-end encryption works.
The core of Cloak is the E2EE
class, which is responsible for maintaing key-pairs, and provides methods to perform ECDH, as well as AES-CTR encryption and decryption.
The Cloak
class is then responsible for hooking into the chat application, and using the E2EE
class to encrypt and decrypt messages.
Hooking into the chat application goes two ways:
Hooking into the “send” button, and encrypting the message before it is sent.
Hooking into the websocket connection, and decrypting the message before it is displayed.
You may ask, how does key exchange happen? Do the users need to do it manually out of band?
No! The key exchange is handled by cloak itself using the message hooking mechanism itself. This is received by the cloak instance in the receivers end, and the key exchange is completed.
If you want to contribute to the project, you can do so by:
To add support for a new chat application, you need to do the following:
scripts
directory, and name it after the chat application. For example, if you are adding support for Discord, you would name the file discord.js
.E2EE
class. You can use the scripts/basic.js
file as a reference.E2EE
class. You can use the scripts/basic.js
file as a reference.The core of Cloak is closed to contributions. This is because we want to ensure that the core of Cloak is secure, and we don’t want to compromise on that. However, we are open to contributions to the chat application hooks, and the documentation.