crypter
Simple go funcs to crypt data
Examples
import "github.com/dlampsi/crypter"
Entrypt and decrypt secret string
// Set secret
secret := "MySecretPassword556"
// Generate secret salt key 32 symbols
salt := GenerateRandString(32)
// Encrypt secret
encrypted, err := Encrypt([]byte(secret), []byte(salt))
if err != nil {
// Handle error
}
fmt.Printf("Enrcypted: %s\n", string(encrypted))
// Decrypt secret
decrypted, err := err := Decrypt(encrypted, []byte(salt))
if err != nil {
// Handle error
}
fmt.Printf("Decrypted: %s\n", string(decrypted))