A LibP2P Stream Security protocol
Noise is a connection security protocol. It provides a secure transport channel for swift-libp2p based on the Noise Protocol Framework. Following an initial plaintext handshake, all data exchanged between peers using swift-libp2p-noise is encrypted and protected from eavesdropping.
This package has NOT been extensively tested in real world applications and should NOT be used in production environments. Although the actual cryptography is handled by swift-crypto, the handshake logic could, and probably does, contain a myriad of bugs. Please feel free to look over the code and submit improvements where you see fit.
- For more information check out the LibP2P Noise Spec
- For more information check out the Noise Protocol Spec
Include the following dependency in your Package.swift file
let package = Package(
...
dependencies: [
...
.package(name: "LibP2PNoise", url: "https://github.com/swift-libp2p/swift-libp2p-noise.git", .upToNextMajor(from: "0.1.0"))
],
...
.target(
...
dependencies: [
...
.product(name: "LibP2PNoise", package: "swift-libp2p-noise"),
]),
...
)
import LibP2PNoise
/// Tell libp2p that it can use noise to secure connections...
app.security.use( .noise )
Not Applicable
Contributions are welcomed! This code is very much a proof of concept. I can guarantee you there's a better / safer way to accomplish the same results. Any suggestions, improvements, or even just critques, are welcome!
Let's make this code better together! 🤝
MIT © 2022 Breth Inc.