security

package
v0.0.0-...-087e01a Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptString

func DecryptString(ciphertext string) (string, error)

DecryptString расшифровывает строку формата "v1:"+base64(nonce||ciphertext).

func EncryptString

func EncryptString(plaintext string) (string, error)

EncryptString шифрует строку AES-GCM, формат: "v1:" + base64(nonce||ciphertext).

func HashPassword

func HashPassword(password string) (string, error)

HashPassword возвращает sha256(password + salt).

func SetAESKeyFromPassphrase

func SetAESKeyFromPassphrase(pass string) error

SetAESKeyFromPassphrase принимает любую строку и производит из неё 32-байтный ключ (sha256).

func SetAESKeyRaw

func SetAESKeyRaw(key []byte) error

SetAESKeyRaw задаёт ключ ровно 16/24/32 байта (AES-128/192/256).

func SetPasswordSalt

func SetPasswordSalt(salt string)

SetPasswordSalt инициализирует глобальную соль (pepper).

Types

This section is empty.

Jump to

Keyboard shortcuts

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