| Crates.io | fynx-proto |
| lib.rs | fynx-proto |
| version | 0.1.0-alpha.3 |
| created_at | 2025-10-23 13:18:11.353715+00 |
| updated_at | 2025-11-02 03:33:00.309212+00 |
| description | Production-ready SSH and IPSec/IKEv2 protocol implementations with comprehensive testing and high-level APIs |
| homepage | https://github.com/Rx947getrexp/fynx |
| repository | https://github.com/Rx947getrexp/fynx |
| max_upload_size | |
| id | 1897105 |
| size | 1,436,972 |
Production-ready SSH and IPSec protocol implementations in Rust, designed for the Fynx security ecosystem.
Complete SSH protocol implementation with modern cryptography:
Enterprise-grade VPN protocol with comprehensive features:
Add to your Cargo.toml:
[dependencies]
fynx-proto = { version = "0.1.0-alpha.2", features = ["ssh"] }
tokio = { version = "1.35", features = ["full"] }
Connect to an SSH server:
use fynx_proto::ssh::client::SshClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Connect and authenticate
let mut client = SshClient::connect("127.0.0.1:22").await?;
client.authenticate_password("username", "password").await?;
// Execute command
let output = client.execute("whoami").await?;
println!("Output: {}", String::from_utf8_lossy(&output));
Ok(())
}
Add to your Cargo.toml:
[dependencies]
fynx-proto = { version = "0.1.0-alpha.2", features = ["ipsec"] }
tokio = { version = "1.35", features = ["full"] }
Create a VPN connection:
use fynx_proto::ipsec::{IpsecClient, ClientConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Configure client
let config = ClientConfig::builder()
.with_local_id("client@example.com")
.with_remote_id("server@example.com")
.with_psk(b"my-secret-key")
.build()?;
// Connect to VPN server
let mut client = IpsecClient::new(config);
client.connect("10.0.0.1:500".parse()?).await?;
// Send encrypted data
client.send_packet(b"Hello, VPN!").await?;
let response = client.recv_packet().await?;
println!("Received: {:?}", response);
// Graceful shutdown
client.shutdown().await?;
Ok(())
}
fynx-proto/
โโโ src/
โ โโโ ssh/ # SSH Protocol (178 tests)
โ โ โโโ client.rs # SSH client with host key verification
โ โ โโโ server.rs # SSH server with authentication
โ โ โโโ transport.rs # Transport layer state machine
โ โ โโโ kex.rs # Key exchange (Curve25519, DH)
โ โ โโโ hostkey.rs # Host keys (Ed25519, RSA, ECDSA)
โ โ โโโ auth.rs # Authentication (password, pubkey)
โ โ โโโ privatekey.rs # Private key loading
โ โ โโโ known_hosts.rs # known_hosts file management
โ โ โโโ authorized_keys.rs # authorized_keys parsing
โ โ โโโ crypto.rs # Cryptographic primitives
โ โ
โ โโโ ipsec/ # IPSec Protocol (567 tests)
โ โโโ client.rs # High-level IpsecClient API
โ โโโ server.rs # High-level IpsecServer API
โ โโโ config.rs # Configuration builders
โ โโโ ikev2/ # IKEv2 protocol implementation
โ โโโ esp/ # ESP protocol implementation
โ โโโ crypto/ # AEAD ciphers, key derivation
โ โโโ logging.rs # Structured logging
โ โโโ metrics.rs # Performance metrics
โ
โโโ tests/
โ โโโ ssh_integration.rs # SSH integration tests (6 tests)
โ โโโ ipsec_integration.rs # IPSec integration tests (25 tests)
โ โโโ ipsec_client_server.rs # API tests (6 tests)
โ โโโ interop_strongswan.rs # strongSwan interop (10 tests, ignored)
โ
โโโ benches/
โ โโโ ipsec_bench.rs # IPSec benchmarks (12 benchmarks)
โ
โโโ docs/
โโโ ssh/ # SSH documentation
โโโ ipsec/ # IPSec documentation
Comprehensive test coverage with 745+ tests:
# Run all tests
cargo test --all-features
# SSH tests (178 passing)
cargo test --features ssh
# IPSec tests (567 passing)
cargo test --features ipsec
# Run benchmarks
cargo bench --features ipsec
# With output
cargo test -- --nocapture
| Category | Tests | Status |
|---|---|---|
| SSH Unit Tests | 172 | โ 100% |
| SSH Integration | 6 | โ 100% |
| IPSec Unit Tests | 536 | โ 100% |
| IPSec Integration | 25 | โ 100% |
| IPSec API Tests | 6 | โ 100% |
| Total Library Tests | 745 | โ 100% |
| IPSec Benchmarks | 12+ | โ Running |
| Interop Tests | 10 | ๐ Framework ready |
ring for cryptographic randomnessexamples/ directoryRun examples with:
# SSH client example
cargo run --example simple_client --features ssh
# IPSec client example
cargo run --example ipsec_client --features ipsec -- 10.0.0.1:500 client@example.com server@example.com "my-secret-key"
# IPSec server example (requires root/administrator for port 500)
cargo run --example ipsec_server --features ipsec -- 0.0.0.0:500 server@example.com "my-secret-key"
[features]
default = ["ssh"]
# SSH protocol support (RFC 4253/4252/4254)
# - 178 tests, production-ready
# - Client, server, authentication
ssh = []
# IPSec/IKEv2 VPN protocol (RFC 7296, RFC 4303)
# - 567 tests, production-ready
# - IKEv2 key exchange, ESP encryption
# - High-level APIs, metrics, logging
ipsec = []
# DTLS protocol (planned)
dtls = []
# TTY password input for SSH
tty-password = ["rpassword"]
Run with: cargo bench --features ipsec --bench ipsec_bench
bytes crateContributions are welcome! Please see CONTRIBUTING.md for guidelines.
# Clone repository
git clone https://github.com/Rx947getrexp/fynx
cd fynx/crates/proto
# Build
cargo build --all-features
# Run tests
cargo test --all-features
# Run specific protocol tests
cargo test --features ssh
cargo test --features ipsec
# Run clippy
cargo clippy --all-features
# Format code
cargo fmt
# Generate documentation
cargo doc --all-features --open
Dual-licensed under MIT or Apache-2.0.
Note: This is an alpha release. While extensively tested, please conduct security audits before production deployment.