Skip to content

A libp2p (in)security module that performs plaintext faux-cryption

Notifications You must be signed in to change notification settings

swift-libp2p/swift-libp2p-plaintext

Repository files navigation

LibP2PPlaintext

Swift Package Manager compatible Build & Test (macos and linux)

A LibP2P Stream Faux-Cryption protocol

Table of Contents

Overview

⚠️ Plaintext is intended only for debugging and interoperability testing purposes. ⚠️

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.

Note:

Install

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"),
            ]),
    ...
)

Usage

Example

import LibP2PPlaintext

/// Tell libp2p that it can use plaintext...
app.security.use( .plaintext )

API

Not Applicable

Contributing

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! 🤝

Credits

License

MIT © 2022 Breth Inc.

About

A libp2p (in)security module that performs plaintext faux-cryption

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages