A LibP2P Stream Faux-Cryption protocol
Secure communications are a key feature of libp2p, and encrypted transport is configured by default in libp2p implementations to encourage security for all production traffic. However, there are some use cases such as testing in which encryption is unnecessary. For such cases, the plaintext "security" protocol can be used. By conforming to the same interface as real security adapters like SECIO and TLS, the plaintext module can be used as a drop-in replacement when encryption is not needed.
- For more information check out the Plaintext Spec
Include the following dependency in your Package.swift file
let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/swift-libp2p/swift-libp2p-plaintext.git", .upToNextMajor(from: "0.1.0"))
],
...
.target(
...
dependencies: [
...
.product(name: "LibP2PPlaintext", package: "swift-libp2p-plaintext"),
]),
...
)
import LibP2PPlaintext
/// Tell libp2p that it can use plaintext...
app.security.use( .plaintext )
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.