cyphernet/lib.rs
1// Set of libraries for privacy-preserving networking apps
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Written in 2019-2023 by
6// Dr. Maxim Orlovsky <orlovsky@cyphernet.org>
7//
8// Copyright 2022-2023 Cyphernet DAO, Switzerland
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21
22#![cfg_attr(docsrs, feature(doc_auto_cfg))]
23
24//! Cyphernet is a set of libraries for privacy-preserving networking & internet
25//! applications.
26//!
27//! The set of libraries supports mix networks (Tor, I2P, Nym), proxies,
28//! end-to-end encryption without central authorities/PKI (Noise-based
29//! encryption protocols like lightning wire protocol, NTLS etc).
30//! The library provides three main components, structured as modules:
31//! - **Network addresses** (module `addr`), which allow simple use of
32//! - Tor, Nym, I2P and other mix networks and SOCKS proxies
33//! - P2P addresses with node public keys
34//! - May be used in a way that prevents using DNS names (outside mixnet scope).
35//! - **Noise protocol framework** (module `noise`) for end-to-end encrypted
36//! network communications.
37//!
38//! The library tries to minimize number of dependencies. Most of its
39//! functionality is available via non-default features, like:
40//! - `noise`: support for noise protocols
41//! - `mixnets`: supports for mixnet network addresses, including `tor`, `nym`, `i2p` (may require
42//! additional crypto libraries for parsing public keys)
43//! - `serde`: encoding for addresses types
44//! - `dns`: enable use of DNS names alongside IP addresses and mixnet names.
45//!
46//! Network addresses provided by the library include the following types:
47//! * [`addr::InetHost`] - IP addr or DNS name
48//! * [`addr::HostName`] - IP, DNS, Tor, I2P, Nym host name (no port or proxy information)
49//! * [`addr::NetAddr`] - any type of host name + port information
50//! * [`addr::PartialAddr`] - any type of host name + optional port, which defaults to generic const
51//! if not provided
52//! * [`addr::PeerAddr`] - any of the above addresses + node public key for authentication
53//! * [`addr::ProxiedHost`] - host name + proxy (there are IP/DNS w/o proxy and with proxy)
54//! * [`addr::ProxiedAddr`] - any of the above addresses + proxy (thus IP/DNS is always proxied)
55
56pub extern crate cypheraddr as addr;
57
58pub mod encrypt {
59 #[cfg(feature = "noise-framework")]
60 pub extern crate noise;
61}
62
63#[cfg(any(feature = "eidolon"))]
64pub mod auth {
65 #[cfg(feature = "eidolon")]
66 pub extern crate eidolon;
67}
68
69pub mod proxy {
70 pub extern crate socks5_client as socks5;
71}
72
73pub use cypher::*;