Core cryptographic library for Pars Messenger - Built on pars.network
Pars LibSession is the core C++ library that handles Session protocol operations for Pars Messenger apps. It provides:
- Configuration management
- Post-quantum encryption/decryption
- Network communication (onion requests)
- Protocol encoding/decoding
Integration Status: Needs Modification
This library contains hardcoded network endpoints for the Session/Oxen network. To enable Pars Network connectivity, the following modifications are needed.
-
Network Configuration (
src/session_network.cpp)- Make seed node URLs configurable
- Add runtime network selection
- Support environment-based configuration
-
File Server (
src/session_network.cpp:250)// Current: hardcoded constexpr auto file_server = "filev2.getsession.org"sv; // Needed: configurable std::string file_server = get_config("PARS_FILE_SERVER", "files.pars.network");
-
Protocol URLs (
src/session_protocol.cpp)- Update hardcoded getsession.org URLs
- Make URLs configurable or update to pars.network equivalents
# Configure the build
cmake -G Ninja -S . -B Build
# Options:
# -D ENABLE_ONIONREQ # Enable onion request APIs
# -D PARS_NETWORK=1 # Enable Pars network configuration (TODO)
# Regenerate protobuf files
cmake --build Build --target regen-protobuf --parallel --verbose
# Build
cmake --build Build --parallel --verbosepars-libsession/
├── include/session/ # Public headers
│ ├── session_encrypt.h # Encryption APIs
│ ├── session_network.h # Network APIs
│ └── config/ # Configuration handling
├── src/
│ ├── session_network.cpp # Network implementation (needs modification)
│ ├── session_protocol.cpp # Protocol constants
│ └── ...
├── proto/ # Protobuf definitions
└── external/ # Dependencies
#include <session/session_encrypt.h>
// Encrypt a message
session_encrypt(...);#include <session/session_encrypt.hpp>
// Use session utilities
session::encrypt(...);This library is used by:
- parsdao/pars-ios - iOS app (Swift/ObjC bindings)
- parsdao/pars-android - Android app (JNI bindings)
- parsdao/pars-desktop - Desktop app (Node.js bindings)
| Repository | Description |
|---|---|
| parsdao/pars-libsession | Native crypto library (this repo) |
| parsdao/pars-desktop | Desktop client |
| parsdao/pars-ios | iOS mobile client |
| parsdao/pars-android | Android mobile client |
| parsdao/node | Pars blockchain node |
Pars LibSession implements FIPS-compliant post-quantum cryptography:
| Algorithm | Standard | Purpose |
|---|---|---|
| ML-KEM-768 | FIPS 203 | Key encapsulation |
| ML-DSA-65 | FIPS 204 | Digital signatures |
| XChaCha20-Poly1305 | - | Symmetric encryption (AEAD) |
| Blake2b-256 | - | Session ID derivation |
Session ID format: 07 + hex(Blake2b-256(KEM_pk || DSA_pk)) = 66 characters
- Fork this repository
- Create a feature branch
- Make your changes
- Submit a pull request
- Website: pars.network
- Documentation: docs.pars.network
- PIPs: github.com/parsdao/pips
GPL-3.0 - See LICENSE
- Fork of libsession-util
- Built on Lux Network technology