Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
libsignal — 这里是 Signal Protocol 以及其他使 Signal 得以实现的加密原语的所在地。 | Kitploit
工具/GitHubGitHub/signalapp/libsignal
加密/解密工具身份管理密码学隐私保护硬件安全
GitHubsignalapp/libsignal

libsignal

这里是 Signal Protocol 以及其他使 Signal 得以实现的加密原语的所在地。

查看仓库
5.9k7681294天前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

概述

libsignal 包含官方 Signal 客户端和服务器所使用的平台无关 API,以 Java、Swift 或 TypeScript 库的形式对外提供。底层实现使用 Rust 编写:

  • libsignal-protocol:实现 Signal 协议,包括 Double Ratchet 算法。是 libsignal-protocol-java 和 libsignal-metadata-java 的替代品。
  • signal-crypto:诸如 AES-GCM 之类的密码学原语。在可能的情况下我们使用 RustCrypto 的实现,但有时会有不同的需求。
  • device-transfer:Signal 设备到设备传输功能的支持逻辑。
  • attest:SGX enclave 和服务器端 HSM 远程证明的功能。
  • zkgroup:零知识群组 以及 Signal 中相关功能的功能实现。
  • zkcredential:对 zkgroup 所使用的那类零知识凭证的抽象,基于 Chase、Perrin 和 Zaverucha 的论文《The Signal Private Group System》。
  • poksho:用于实现零知识证明(例如 zkgroup 所使用的那些)的工具;代表“proof-of-knowledge, stateful-hash-object”。
  • account-keys:在 Signal 的 Secure Value Recovery 系统中一致地将 PIN 用作密码的功能,以及其他账户级密钥操作。
  • usernames:用户名生成、哈希和证明的功能。
  • media:用于处理媒体的工具。

本仓库被 Signal 客户端应用(Android、iOS 和 Desktop)以及服务器端使用。不支持在 Signal 之外使用。特别是,本仓库的产物是封装底层 Rust 实现的 Java、Swift 和 TypeScript 库。所有 API 和实现均可能在不另行通知的情况下变更,JNI、C 和 Node 插件“桥接”层也是如此。不过,对 Java、Swift、TypeScript 以及非桥接 Rust API 的不向后兼容变更将尽最大努力反映在版本号中,包括提高最低支持工具版本。

构建

工具链安装

要构建本仓库中的任何内容,你必须安装 Rust,以及较新版本的 Clang、libclang、CMake、Make、protoc、Python(3.9+)和 git。

Linux/Debian

在类 Debian 系统上,你可以通过 apt 获取这些额外依赖:

$ apt-get install clang libclang-dev cmake make protobuf-compiler libprotobuf-dev python3 git

macOS

在 macOS 上,我们有一个尽力维护的脚本来设置 Rust 工具链,你可以通过以下方式运行:

$ bin/mac_setup.sh

Rust

首次构建与测试

当前构建使用特定版本的 Rust 稳定编译器, cargo 会自动下载该版本。要构建并测试基础协议 库:

$ cargo build
...
$ cargo test
...

其他 Rust 工具

上述基本工具应能满足大多数 libsignal Rust 开发的需求。

最终,你可能会发现需要一些额外的 Rust 工具,例如用于代码格式化的 taplo。

对于任何可能影响构建的 Rust 工具,你应始终通过 cargo 安装,而不是从系统包管理器(例如 apt 或 brew)安装。包管理器有时会包含这些工具的过时版本,可能因不兼容问题导致构建失败。

要安装与我们使用的版本匹配的主要 Rust 额外依赖项,可以运行以下命令:

$ cargo +stable install --version "$(cat acknowledgments/cargo-about-version)" --locked cargo-about
$ cargo +stable install --version "$(cat .taplo-cli-version)" --locked taplo-cli
$ cargo +stable install cargo-fuzz

Java/Android

工具链设置 / 配置

要为 Android 构建,你必须安装几个额外的软件包,包括 JDK、 Android NDK/SDK,并将 Android 目标添加到 Rust 编译器,使用

rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android

Our officially supported JDK version for Android builds is JDK 21, so be sure to install e.g. OpenJDK 21, and then point JAVA_HOME to it.

You can easily do this on macOS via:

export JAVA_HOME=$(/usr/libexec/java_home -v 21)

On Linux, the way you do this varies by distribution. For Debian based distributions like Ubuntu, you can use:

sudo update-alternatives --config java

We also check-in a .tools_version file for use with runtime version managers.

Building and Testing

To build the Java/Android jar and aar, and run the tests:

$ cd java
$ ./gradlew test
$ ./gradlew build # 如果需要 AAR 输出

You can pass -P debugLevelLogs to Gradle to build without filtering out debug- and verbose-level logs from Rust, and -P jniTypeTagging to enable additional checks in the Rust JNI bridging code.

Alternately, a build system using Docker is available:

$ cd java
$ make

When exposing new APIs to Java, you will need to run cargo run -p libsignal-jni-native_kt (or just generate-jni) in addition to rebuilding.

Use as a library

Signal publishes Java packages for its own use, under the names org.signal:libsignal-server, org.signal:libsignal-client, and org.signal:libsignal-android. libsignal-client and libsignal-server contain native libraries for Debian-flavored x86_64 Linux as well as Windows (x86_64) and macOS (x86_64 and arm64). libsignal-android contains native libraries for armeabi-v7a, arm64-v8a, x86, and x86_64 Android. These are located in a Maven repository at https://build-artifacts.signal.org/libraries/maven/; for use from Gradle, add the following to your repositories block:

maven {
  name = "SignalBuildArtifacts"
  // "uri()" 部分仅对 Kotlin Gradle 必要;Groovy Gradle 在此处接受裸字符串。
  url = uri("https://build-artifacts.signal.org/libraries/maven/")
}

Older builds were published to Maven Central instead.

When building for Android you need both libsignal-android and libsignal-client, but the Windows and macOS libraries in libsignal-client won't automatically be excluded from your final app. You can explicitly exclude them using packaging:

android {
  // ...
  packaging {
    resources {
      excludes += setOf("libsignal_jni*.dylib", "signal_jni*.dll")
    }
  }
  // ...
}

You can additionally exclude libsignal_jni_testing.so if you do not plan to use any of the APIs intended for client testing.

Testing a local build with Signal-Android

The Signal-Android gradle.properties file has a commented-out line to include libsignal as part of the build. Uncomment that and adjust the path; optionally, you can restrict the architectures you want to build for by adding androidArchs=aarch64 to libsignal's gradle.properties. (The set of recognized architectures is in java/build_jni.sh.) If you're using an IDE, you'll need to re-import the Gradle structure at this point. When you're done, revert the changes to the Android app's gradle.properties and re-import once more.

Note that this does not import the Rust parts of the project into the IDE. Doing that in a multi-language IDE like IDEA is possible, but finicky; as of 2025 the most reliable way to do it is to open the Android project first, add the libsignal repo root directory as a Rust project second (only including the top-level directory), and only then make the changes to gradle.properties.

Swift

To learn about the Swift build process see swift/README.md

Node

You'll need Node installed to build. If you have nvm, you can run nvm use to select an appropriate version automatically.

We use npm as our package manager, and a Python script to control building the Rust library, accessible as npm run build.

$ cd node
$ nvm use
$ npm install
$ npm run build
$ npm run tsc
$ npm run test

When testing changes locally, you can use npm run build to do an incremental rebuild of the Rust library. Alternately, npm run build-with-debug-level-logs will rebuild without filtering out debug- and verbose-level logs.

When exposing new APIs to Node, you will need to run just generate-node in addition to rebuilding.

NPM

Signal publishes the NPM package @signalapp/libsignal-client for its own use, including native libraries for Windows, macOS, and Debian-flavored Linux. Both x64 and arm64 builds are included for all three platforms, but the arm64 builds for Windows and Linux are considered experimental, since there are no official builds of Signal for those architectures.

Testing a local build with Signal-Desktop

下载工具