Skip to content

Simple but handy wrappers around AES crypto methods

License

Notifications You must be signed in to change notification settings

Djarvur/go-aescrypt

Repository files navigation

go-aescrypt GoDoc Build Status Coverage Status

Simple but handy wrappers around AES crypto methods, hiding the boilerplate code around crypto/aes and crypto/cipher

Example

	var (
		data = []byte("some sencitive data has to be protected with AES")
		key  = []byte("0123456789ABCDEF")
		iv   = []byte("qwertyuiodfghjkm")
	)

	encData, err := aescrypt.EncryptAESCBCPadded(data, key, iv)
	if err != nil {
		t.Fatal(err)
	}

	decData, err := aescrypt.DecryptAESCBCPadded(encData, key, iv)
	if err != nil {
		t.Fatal(err)
	}

	if !bytes.Equal(data, decData) {
		t.Error("decrypted data is not equal to original")
	}

About

Simple but handy wrappers around AES crypto methods

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages