Initiliazation

This commit is contained in:
2025-12-22 16:23:48 +01:00
parent 7a8b6d451d
commit b29e6179f3
165 changed files with 28070 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
package cryptmeow
import (
"angel_server/consts"
"crypto/rand"
"golang.org/x/crypto/curve25519"
)
func Gen_keypair() (publicKey [32]byte, privateKey [32]byte) {
consts.Logger.Warn("Generating ephemeral keys for SSH authetification.")
_, err := rand.Read(privateKey[:])
if err != nil {
consts.Logger.Error("Failed to generate private key: " + err.Error())
}
curve25519.ScalarBaseMult(&publicKey, &privateKey)
return publicKey, privateKey
}
var ControllerPublicKey, ControllerPrivateKey [32]byte = Gen_keypair()