A package that provides a cryptographic algorithms and protocols in Go, including support for encryption, decryption, signing, and verification
This GoCrypto package provides a simple and secure way to encrypt and decrypt sensitive information in a Go program using the AES-GCM encryption algorithm. It allows developers to protect confidential data while it is stored or transmitted over insecure channels, which helps to prevent unauthorized access, tampering, or eavesdropping. This package can be useful in various scenarios such as securing passwords, credit card numbers, personal identification information, and other sensitive data that need to be protected from prying eyes.
- Import the package:
import "github.com/example/gocrypto"
- Create an instance of GoCrypto with an encryption key:
key := []byte("my-secret-key")
g := gocrypto.NewGoCrypto(key)
- Encrypt a plaintext message:
plaintext := "my sensitive information"
ciphertext, err := g.Encrypt(plaintext)
if err != nil {
// handle error
}
- Decrypt a ciphertext message:
ciphertext := "encrypted message"
plaintext, err := g.Decrypt(ciphertext)
if err != nil {
// handle error
}
This package is licensed under the MIT License. See the LICENSE file for more details.