The Python Double Ratchet CLI tool provides an easy-to-use command-line interface for encrypting payloads using the Double Ratchet algorithm.
Follow these steps to set up and run the Python Double Ratchet CLI tool:
Ensure you have the required system packages installed:
sudo apt update
sudo apt install libsqlcipher-dev build-essential git cmake libsqlite3-dev
-
Clone the Repository:
git clone https://github.com/smswithoutborders/py_double_ratchet_cli.git cd py_double_ratchet_cli
-
Set Up a Virtual Environment:
Create a virtual environment in your project directory to isolate dependencies:
python3 -m venv venv
-
Activate the Virtual Environment:
source venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-c
,--content
(required): The content to encrypt.-p
,--phone_number
(required): The phone number associated with the encryption state.-s
,--sk
(required): The base64 encoded secret key for encryption.-k
,--ppk
(required): The base64 encoded public key for encryption.-b
,--base_dir
(optional): Base directory for state storage. If not provided, the default path used is$HOME/.local/share/relaysms/storage
.
-
Encrypting Content:
python3 cli.py -c "Hello, World!" -p "+1234567890" -s "bXlzZWNyZXRrZXkxMjM0NQ==" -k "bXlzZWNyZXRrZXkxMjM0NQ=="
This command will encrypt the content
"Hello, World!"
using the specified secret key and public key, associating the encryption state with the phone number+1234567890
. -
Specifying a Base Directory:
python3 cli.py -c "Sensitive Data" -p "+1234567890" -s "bXlzZWNyZXRrZXkxMjM0NQ==" -k "bXlzZWNyZXRrZXkxMjM0NQ==" -b "/path/to/base/dir"
This command specifies a custom base directory for storing the encryption state. If
-b
is not provided, the default path used is$HOME/.local/share/relaysms/storage
.
Feel free to contribute to this project by submitting issues or pull requests. Please follow the project's code style and provide clear descriptions of your changes.