Skip to content

zeroxv6/kotlin-mls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kotlin MLS

A Messaging Layer Security (MLS) library for Android, built with Rust and Kotlin using OpenMLS.

Maven Central License: MIT

Features

  • End-to-end encrypted group messaging
  • Built on the MLS protocol (RFC 9420)
  • Native performance with Rust backend
  • Simple Kotlin API for Android

Installation

Add to your build.gradle.kts:

dependencies {
    implementation("space.zeroxv6:kotlin-mls:1.1.0")
}

Usage

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)

Requirements

  • Android API 26+
  • NDK 29.0.14206865

Building

# Build the library
./gradlew :app:assembleRelease

# Run tests
./gradlew :app:test
./gradlew :app:connectedAndroidTest

Architecture

  • Rust Layer: Core MLS implementation using OpenMLS
  • UniFFI: Automatic Kotlin bindings generation
  • Android Library: Kotlin wrapper with Android-friendly API

Security Warning

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.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Author

Raman Mann (aka zeroxv6)

About

A Kotlin wrapper for the OpenMLS Rust, generated via UniFFI. This library provides a high-performance, memory-safe implementation of the Messaging Layer Security (MLS) protocol for secure group messaging in Android applications.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors