This project focuses on encrypting Personally Identifiable Information (PII) using the Go programming language.
- Encryption and decryption of PII data
- Easy integration with go applications
To give Git credentials, you’ll need to have a .netrc that includes gitlab.playcourt.id in your home directory.
go get github.com/dyaksa/encryption-pii@latest
go get github.com/dyaksa/encryption-pii@v.1.0.0
CRYPTO_AES_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXX
CRYPTO_HMAC_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX
CRYPTO_HEAP_DB_HOST=localhost
CRYPTO_HEAP_DB_PORT=5432
CRYPTO_HEAP_DB_USER=admin
CRYPTO_HEAP_DB_PASSWORD=password
CRYPTO_HEAP_DB_NAME=sandbox_pii
Import library
We need to create a new object by calling the crypto.New
func main() {
crypto, err := crypto.New(
crypto.Aes256KeySize,
crypto.WithInitHeapConnection(),
)
}
type Profile struct {
Name types.AESCipher
Nik types.AESCipher
Phone types.AESCipher
Email types.AESCipher
}
func main() {
crypto, err := crypto.New(crypto.Aes256KeySize)
profile := Profile {
Name: crypto.Encrypt("test", aesx.AesCBC)
Nik: crypto.Encrypt("123455", aesx.AesCBC)
Phone crypto.Encrypt("123455", aesx.AesCBC)
Email crypto.Encrypt("123455", aesx.AesCBC)
}
}
for reference to the use of pii implementation can check (Example)
Dyaksa Jauharuddin Nour (Github)