A Messaging Layer Security (MLS) library for Android, built with Rust and Kotlin using OpenMLS.
- End-to-end encrypted group messaging
- Built on the MLS protocol (RFC 9420)
- Native performance with Rust backend
- Simple Kotlin API for Android
Add to your build.gradle.kts:
dependencies {
implementation("space.zeroxv6:kotlin-mls:1.1.0")
}import space.zeroxv6.kotlin_mls.MlsService
// Initialize
val mlsService = MlsService(context)
// Create a group
val groupId = mlsService.createGroup()
// Generate key package
val keyPackage = mlsService.generateKeyPackage()
// Add member
mlsService.addMember(groupId, keyPackage)
// Send encrypted message
val ciphertext = mlsService.sendMessage(groupId, "Hello, MLS!")
// Receive and decrypt
val plaintext = mlsService.receiveMessage(groupId, ciphertext)- Android API 26+
- NDK 29.0.14206865
# Build the library
./gradlew :app:assembleRelease
# Run tests
./gradlew :app:test
./gradlew :app:connectedAndroidTest- Rust Layer: Core MLS implementation using OpenMLS
- UniFFI: Automatic Kotlin bindings generation
- Android Library: Kotlin wrapper with Android-friendly API
This library has not undergone a formal security audit. While care has been taken to implement the MLS protocol correctly and securely, it may contain undiscovered vulnerabilities. If you plan to use this library in a production or security-critical context, proceed with caution and consider conducting an independent security review.
MIT License - see LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Raman Mann (aka zeroxv6)
- GitHub: @zeroxv6
- Email: raman.mann.205@gmail.com