A simple Encrypted GO Chat Client and Server.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
basic_chat/make_a_key.go

19 lines
327 B

package main
import (
"crypto/rand"
"fmt"
)
func main() {
// Generate a secure random key
key := make([]byte, 16)
_, err := rand.Read(key)
if err != nil {
fmt.Println("Error generating random key:", err)
return
}
// Print the raw 32-byte key as a hexadecimal string
fmt.Printf("32-byte key (hex): %x\n", key)
}