Documentation
¶
Index ¶
- Constants
- func DecryptAES(encryptedData []byte, password string) ([]byte, error)
- func DeriveKey(password string, salt []byte) ([]byte, error)
- func EncryptAES(data []byte, password string) ([]byte, error)
- func GenerateRandomBytes(length int) ([]byte, error)
- func GenerateSalt() ([]byte, error)
- func HashPassword(password string) (string, error)
- func VerifyPassword(password, hash string) bool
Constants ¶
View Source
const ( // SaltLength is the length of salt used for key derivation SaltLength = 16 // KeyLength is the length of derived keys (AES-256) KeyLength = 32 // NonceLength is the length of nonce used for AES-GCM NonceLength = 12 // PBKDF2Iterations is the number of iterations for PBKDF2 PBKDF2Iterations = 100000 )
Variables ¶
This section is empty.
Functions ¶
func DecryptAES ¶
DecryptAES decrypts data using AES-256-GCM with a password-derived key
func EncryptAES ¶
EncryptAES encrypts data using AES-256-GCM with a password-derived key
func GenerateRandomBytes ¶
GenerateRandomBytes generates random bytes of specified length
func HashPassword ¶
HashPassword hashes a password using bcrypt
func VerifyPassword ¶
VerifyPassword verifies a password against its hash
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.