ccrypto

package
v0.0.0-...-36fb464 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ChiselKeyPrefix = "ck-"
View Source
const DetermRandIter = 2048

Variables

This section is empty.

Functions

func ChiselKey2PEM

func ChiselKey2PEM(chiselKey []byte) ([]byte, error)

func FingerprintKey

func FingerprintKey(k ssh.PublicKey) string

FingerprintKey calculates the SHA256 hash of an SSH public key

func GenerateKey

func GenerateKey(seed string) ([]byte, error)

GenerateKey generates a PEM key

func GenerateKeyFile

func GenerateKeyFile(keyFilePath, seed string) error

GenerateKeyFile generates an ChiselKey

func GenerateKeyGo119

func GenerateKeyGo119(c elliptic.Curve, rand io.Reader) (*ecdsa.PrivateKey, error)

This function is copied from ecdsa.GenerateKey() of Go 1.19

func IsChiselKey

func IsChiselKey(chiselKey []byte) bool

func NewDetermRand

func NewDetermRand(seed []byte) io.Reader

func Seed2PEM

func Seed2PEM(seed string) ([]byte, error)

Types

type Argon2idHash

type Argon2idHash struct {
	// contains filtered or unexported fields
}

func NewArgon2idHash

func NewArgon2idHash(time, saltLen uint32, memory uint32, threads uint8, keyLen uint32) *Argon2idHash

NewArgon2idHash constructor function for Argon2idHash.

func (*Argon2idHash) GenerateHash

func (a *Argon2idHash) GenerateHash(password []byte) (*HashSalt, error)

GenerateHash using the password and provided salt. If not salt value provided fallback to random value generated of a given length.

type HashSalt

type HashSalt struct {
	Hash []byte
	Salt []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL