Skip to content

Instantly share code, notes, and snippets.

View alessiodionisi's full-sized avatar

Alessio Dionisi alessiodionisi

View GitHub Profile
@alessiodionisi
alessiodionisi / main.go
Created April 29, 2022 13:50
Elliptic-Curve Diffie-Hellman AES-GCM chat example
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"github.com/adnsio/ecdh/ecdh25519"

Keybase proof

I hereby claim:

  • I am adnsio on github.
  • I am adnsio (https://keybase.io/adnsio) on keybase.
  • I have a public key ASD4TYjBuqcRQGjttJTGWUqYgChRGBXV6JwtB73ghI5Upgo

To claim this, I am signing this object:

use std::io;
use std::io::prelude::*;
use std::net::{TcpListener, TcpStream};
use std::thread;
fn handle_connection(mut stream: TcpStream) {
let mut buffer = [0; 512];
loop {
stream.read(&mut buffer).unwrap();