Skip to content

31core/STProto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

STProto

Introduction

STProto (Secure Transport Protocol) is an End-to-End Encryption network protocol. Like OpenSSL, it's a Session Layer Protocol, it focuses on secure transport bitween server and client, and provides a universal API which is similar to socket.

Language bindings

Language Interface
Rust Native
C Shared Library

Supported ciphers

STProto supports these symmatric ciphers.

  • AES-128-GCM
  • AES-256-GCM
  • ChaCha20-Poly1305
  • AES-128-CCM
  • AES-256-CCM

Get start

With STProto, you can write a simple server and client like this.

server.rs:

use std::io::*;
use stproto::connection::*;

fn main() -> std::io::Result<()> {
    let mut server = STServer::bind("localhost", 5000)?;
    server.listen()?;
    let client = server.accept();
    let mut data = Vec::new();
    client.read_to_end(&mut data)?;
    println!("{:?}", data);
    Ok(())
}

client.rs:

use std::io::*;
use stproto::connection::*;

fn main() -> std::io::Result<()> {
    let mut client = STClient::connect("localhost", 5000)?;
    client.write_all(b"test")?;
    Ok(())
}

If it runs properly, you will get:

$ ./server
[116, 101, 115, 116]

Bugs & Reports

You can report a bug through email [email protected].

About

Secure Transport Protocol

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published