security

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PublicKeyStr = "3yUKKkTZq2wXqstDTiUo91+ahuvSkYCL9F5xfdlYTlY="

Variables

This section is empty.

Functions

func DecryptTime

func DecryptTime(encryptedStr string, machineID string) (int64, error)

DecryptTime decrypts the obfuscated time string.

func EncryptTime

func EncryptTime(ts int64, machineID string) string

EncryptTime encrypts a timestamp using the machineID as a salt. Format: Base64( XOR( timestamp_string, machineID_part ) )

func GetMachineID

func GetMachineID() (string, error)

GetMachineID generates a unique identifier for the machine Priority: UUID > CPU+Disk(Sorted) > Hostname

func SignLicense

func SignLicense(privateKeyBase64 string, machineID string) (string, error)

SignLicense is a helper for the pay server (though pay server is separate, having it here might be useful if we share code, but we likely won't link this package in pay server to avoid bloating it, but it's fine for reference). The pay server will likely implement its own signing using the private key.

func VerifyLicense

func VerifyLicense(licenseStr string, machineID string) bool

VerifyLicense checks if the license (signature) is valid for the given machineID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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