[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5654":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":29,"discoverSource":30},5654,"libsignal","signalapp\u002Flibsignal","signalapp","Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.","",null,"Rust",5814,733,88,13,0,2,14,70,10,82.6,"GNU Affero General Public License v3.0",false,"main",[],"2026-06-12 04:00:26","# Overview\n\nlibsignal contains platform-agnostic APIs used by the official Signal clients and servers, exposed\nas a Java, Swift, or TypeScript library. The underlying implementations are written in Rust:\n\n- libsignal-protocol: Implements the Signal protocol, including the [Double Ratchet algorithm][]. A\n  replacement for [libsignal-protocol-java][] and [libsignal-metadata-java][].\n- signal-crypto: Cryptographic primitives such as AES-GCM. We use [RustCrypto][]'s where we can\n  but sometimes have differing needs.\n- device-transfer: Support logic for Signal's device-to-device transfer feature.\n- attest: Functionality for remote attestation of [SGX enclaves][] and server-side [HSMs][].\n- zkgroup: Functionality for [zero-knowledge groups][] and related features available in Signal.\n- zkcredential: An abstraction for the sort of zero-knowledge credentials used by zkgroup, based on the paper \"[The Signal Private Group System][]\" by Chase, Perrin, and Zaverucha.\n- poksho: Utilities for implementing zero-knowledge proofs (such as those used by zkgroup); stands for \"proof-of-knowledge, stateful-hash-object\".\n- account-keys: Functionality for consistently using [PINs][] as passwords in Signal's Secure Value Recovery system, as well as other account-wide key operations.\n- usernames: Functionality for username generation, hashing, and proofs.\n- media: Utilities for manipulating media.\n\nThis repository is used by the Signal client apps ([Android][], [iOS][], and [Desktop][]) as well as\nserver-side. Use outside of Signal is unsupported. In particular, the products of this repository\nare the Java, Swift, and TypeScript libraries that wrap the underlying Rust implementations. All\nAPIs and implementations are subject to change without notice, as are the JNI, C, and Node add-on\n\"bridge\" layers. However, backwards-incompatible changes to the Java, Swift, TypeScript, and\nnon-bridge Rust APIs will be reflected in the version number on a best-effort basis, including\nincreases to the minimum supported tools versions.\n\n[Double Ratchet algorithm]: https:\u002F\u002Fsignal.org\u002Fdocs\u002F\n[libsignal-protocol-java]: https:\u002F\u002Fgithub.com\u002Fsignalapp\u002Flibsignal-protocol-java\n[libsignal-metadata-java]: https:\u002F\u002Fgithub.com\u002Fsignalapp\u002Flibsignal-metadata-java\n[RustCrypto]: https:\u002F\u002Fgithub.com\u002FRustCrypto\n[Noise protocol]: http:\u002F\u002Fnoiseprotocol.org\u002F\n[SGX enclaves]: https:\u002F\u002Fwww.intel.com\u002Fcontent\u002Fwww\u002Fus\u002Fen\u002Farchitecture-and-technology\u002Fsoftware-guard-extensions.html\n[HSMs]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FHardware_security_module\n[zero-knowledge groups]: https:\u002F\u002Fsignal.org\u002Fblog\u002Fsignal-private-group-system\u002F\n[The Signal Private Group System]: https:\u002F\u002Feprint.iacr.org\u002F2019\u002F1416.pdf\n[PINs]: https:\u002F\u002Fsignal.org\u002Fblog\u002Fsignal-pins\u002F\n[Android]: https:\u002F\u002Fgithub.com\u002Fsignalapp\u002FSignal-Android\n[iOS]: https:\u002F\u002Fgithub.com\u002Fsignalapp\u002FSignal-iOS\n[Desktop]: https:\u002F\u002Fgithub.com\u002Fsignalapp\u002FSignal-Desktop\n\n\n# Building\n\n### Toolchain Installation\n\nTo build anything in this repository you must have [Rust](https:\u002F\u002Frust-lang.org) installed, as well\nas recent versions of Clang, libclang, [CMake](https:\u002F\u002Fcmake.org), Make, protoc, Python (3.9+), and git.\n\n#### Linux\u002FDebian\n\nOn a Debian-like system, you can get these extra dependencies through `apt`:\n\n```shell\n$ apt-get install clang libclang-dev cmake make protobuf-compiler libprotobuf-dev python3 git\n```\n\n#### macOS\n\nOn macOS, we have a best-effort maintained script to set up the Rust toolchain you can run by:\n\n```shell\n$ bin\u002Fmac_setup.sh\n```\n\n## Rust\n\n### First Build and Test\n\nThe build currently uses a specific version of the Rust nightly compiler, which\nwill be downloaded automatically by cargo. To build and test the basic protocol\nlibraries:\n\n```shell\n$ cargo build\n...\n$ cargo test\n...\n```\n\n### Additional Rust Tools\n\nThe basic tools above should get you set up for most libsignal Rust development. \n\nEventually, you may find that you need some additional Rust tools like `cbindgen` to modify the bridges to the \nclient libraries or `taplo` for code formatting. \n\nYou should always install any Rust tools you need that may affect the build from cargo rather than from your system\npackage manager (e.g. `apt` or `brew`). Package managers sometimes contain outdated versions of these tools that can break\nthe build with incompatibility issues (especially cbindgen).\n\nTo install the main Rust extra dependencies matching the versions we use, you can run the following commands:\n\n```shell\n$ cargo +stable install --version \"$(cat .cbindgen-version)\" --locked cbindgen\n$ cargo +stable install --version \"$(cat acknowledgments\u002Fcargo-about-version)\" --locked cargo-about\n$ cargo +stable install --version \"$(cat .taplo-cli-version)\" --locked taplo-cli\n$ cargo +stable install cargo-fuzz\n```\n\n## Java\u002FAndroid\n\n### Toolchain Setup \u002F Configuration\n\nTo build for Android you must install several additional packages including a JDK,\nthe Android NDK\u002FSDK, and add the Android targets to the Rust compiler, using\n\n```rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android```\n\nOur officially supported JDK version for Android builds is JDK 17, so be sure to install e.g. OpenJDK 17, and then point JAVA_HOME to it.\n\nYou can easily do this on macOS via:\n\n```shell\nexport JAVA_HOME=$(\u002Fusr\u002Flibexec\u002Fjava_home -v 17)\n```\n\nOn Linux, the way you do this varies by distribution. For Debian based distributions like Ubuntu, you can use:\n\n```shell\nsudo update-alternatives --config java\n```\n\nWe also check-in a `.tools_version` file for use with runtime version managers.\n\n### Building and Testing\n\nTo build the Java\u002FAndroid ``jar`` and ``aar``, and run the tests:\n\n```shell\n$ cd java\n$ .\u002Fgradlew test\n$ .\u002Fgradlew build # if you need AAR outputs\n```\n\nYou can pass `-P debugLevelLogs` to Gradle to build without filtering out debug- and verbose-level\nlogs from Rust, and `-P jniTypeTagging` to enable additional checks in the Rust JNI bridging code.\n\nAlternately, a build system using Docker is available:\n\n```shell\n$ cd java\n$ make\n```\n\nWhen exposing new APIs to Java, you will need to run `rust\u002Fbridge\u002Fjni\u002Fbin\u002Fgen_java_decl.py` in\naddition to rebuilding. This requires installing the `cbindgen` Rust tool, as detailed above. \n\n### Use as a library\n\nSignal publishes Java packages for its own use, under the names org.signal:libsignal-server,\norg.signal:libsignal-client, and org.signal:libsignal-android. libsignal-client and libsignal-server\ncontain native libraries for Debian-flavored x86_64 Linux as well as Windows (x86_64) and macOS\n(x86_64 and arm64). libsignal-android contains native libraries for armeabi-v7a, arm64-v8a, x86, and\nx86_64 Android. These are located in a Maven repository at\nhttps:\u002F\u002Fbuild-artifacts.signal.org\u002Flibraries\u002Fmaven\u002F; for use from Gradle, add the following to your\n`repositories` block:\n\n```\nmaven {\n  name = \"SignalBuildArtifacts\"\n  \u002F\u002F The \"uri()\" part is only necessary for Kotlin Gradle; Groovy Gradle accepts a bare string here.\n  url = uri(\"https:\u002F\u002Fbuild-artifacts.signal.org\u002Flibraries\u002Fmaven\u002F\")\n}\n```\n\nOlder builds were published to [Maven Central](https:\u002F\u002Fcentral.sonatype.org) instead.\n\nWhen building for Android you need *both* libsignal-android and libsignal-client, but the Windows\nand macOS libraries in libsignal-client won't automatically be excluded from your final app. You can\nexplicitly exclude them using `packaging`:\n\n```\nandroid {\n  \u002F\u002F ...\n  packaging {\n    resources {\n      excludes += setOf(\"libsignal_jni*.dylib\", \"signal_jni*.dll\")\n    }\n  }\n  \u002F\u002F ...\n}\n```\n\nYou can additionally exclude `libsignal_jni_testing.so` if you do not plan to use any of the APIs\nintended for client testing.\n\n### Testing a local build with Signal-Android\n\nThe 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\u002Fbuild_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.\n\nNote 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.\n\n\n## Swift\n\nTo learn about the Swift build process see [``swift\u002FREADME.md``](swift\u002F)\n\n\n## Node\n\nYou'll need Node installed to build. If you have [nvm][], you can run `nvm use` to select an\nappropriate version automatically.\n\nWe use `npm` as our package manager, and a Python script to control building the Rust library, accessible as `npm run build`.\n\n```shell\n$ cd node\n$ nvm use\n$ npm install\n$ npm run build\n$ npm run tsc\n$ npm run test\n```\n\nWhen 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.\n\nWhen exposing new APIs to Node, you will need to run `rust\u002Fbridge\u002Fnode\u002Fbin\u002Fgen_ts_decl.py` in\naddition to rebuilding.\n\n[nvm]: https:\u002F\u002Fgithub.com\u002Fnvm-sh\u002Fnvm\n\n### NPM\n\nSignal publishes the NPM package `@signalapp\u002Flibsignal-client` for its own use, including native\nlibraries for Windows, macOS, and Debian-flavored Linux. Both x64 and arm64 builds are included for\nall three platforms, but the arm64 builds for Windows and Linux are considered experimental, since\nthere are no official builds of Signal for those architectures.\n\n### Testing a local build with Signal-Desktop\n\nAfter running all the build commands above, adjust the `@signalapp\u002Flibsignal-client` dependency in the Desktop app's package.json to \"link:path\u002Fto\u002Flibsignal\u002Fnode\" and run `pnpm install`. When you're done, revert the changes to package.json and run `pnpm install` again.\n\n\n# Contributions\n\nSignal does accept external contributions to this project. However unless the change is\nsimple and easily understood, for example fixing a bug or portability issue, adding a new\ntest, or improving performance, first open an issue to discuss your intended change as not\nall changes can be accepted.\n\nContributions that will not be used directly by one of Signal's official client apps may still be\nconsidered, but only if they do not pose an undue maintenance burden or conflict with the goals of\nthe project.\n\nSigning a [CLA (Contributor License Agreement)](https:\u002F\u002Fsignal.org\u002Fcla\u002F) is required for all contributions.\n\n## Code Formatting and Acknowledgments\n\nYou can run the styler on the entire project by running:\n\n```shell\njust format-all\n```\n\nYou can run more extensive tests as well as linters and clippy by running:\n\n```shell\njust check-pre-commit\n```\n\nWhen making a PR that adjusts dependencies, you'll need to regenerate our acknowledgments files. See [``acknowledgments\u002FREADME.md``](acknowledgments\u002F).\n\n# Legal things\n## Cryptography Notice\n\nThis distribution includes cryptographic software. The country in which you currently reside may have restrictions on\nthe import, possession, use, and\u002For re-export to another country, of encryption software.  BEFORE using any encryption\nsoftware, please check your country's laws, regulations and policies concerning the import, possession, or use, and\nre-export of encryption software, to see if this is permitted.  See \u003Chttp:\u002F\u002Fwww.wassenaar.org\u002F> for more information.\n\nThe U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as\nExport Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing\ncryptographic functions with asymmetric algorithms.  The form and manner of this distribution makes it eligible for\nexport under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export\nAdministration Regulations, Section 740.13) for both object code and source code.\n\n## License\n\nCopyright 2020-2026 Signal Messenger, LLC\n\nLicensed under the GNU AGPLv3: https:\u002F\u002Fwww.gnu.org\u002Flicenses\u002Fagpl-3.0.html\n","signalapp\u002Flibsignal 是一个为Signal应用提供加密协议和相关密码学原语的项目。它实现了Signal协议，包括双棘轮算法，并提供了如AES-GCM等加密工具。此外，该项目还支持设备间传输、远程证明SGX飞地及HSM、零知识群组等功能。使用Rust语言编写，通过Java、Swift或TypeScript库的形式对外提供平台无关的API接口。此项目主要用于Signal客户端（Android、iOS、桌面版）及其服务器端，不支持外部使用。适用于需要高级别安全通信的应用场景。","2026-06-11 03:04:34","top_language"]