func Decrypt(data, key []byte) ([]byte, error) {
	if len(data) <= AesGcmNonceSize {
		return nil, errors.New("error decrpyting AES-GCM - message is too short")
	}

	c, err := aes.NewCipher(key)
	if err != nil {
		return nil, err
	}

	gcm, err := cipher.NewGCM(c)
	if err != nil {
		return nil, err
	}

	nonce := make([]byte, AesGcmNonceSize)
	copy(nonce, data)

	result, err := gcm.Open(nil, nonce, data[AesGcmNonceSize:], nil)
	if err != nil {
		return nil, err
	}

	return result, nil
}
// Decrypt AES-GCM encrypted message
Decrypt AES-GCM encrypted message
// Decrypt AES - GCM encrypted message
func Decrypt(data, key []byte) ([]byte, error) {
	if len(data) <= AesGcmNonceSize {
		return nil, errors.New("error decrpyting AES-GCM - message is too short")
	}
	c, err := aes.NewCipher(key)
	if err != nil {
		return nil, err
	}
	gcm, err := cipher.NewGCM(c)
	if err != nil {
		return nil, err
	}
	nonce := make([]byte, AesGcmNonceSize)
	copy(nonce, data)
	result, err := gcm.Open(nil, nonce, data[AesGcmNonceSize:], nil)
	if err != nil {
		return nil, err
	}
	return result, nil
}
func Decrypt ( data , key [ ] byte ) ( [ ] byte , error ) { if len ( data ) <= AesGcmNonceSize { return nil , errors . New ( " " ) } c , err := aes . NewCipher ( key ) if err != nil { return nil , err } gcm , err := cipher . NewGCM ( c ) if err != nil { return nil , err } nonce := make ( [ ] byte , AesGcmNonceSize ) copy ( nonce , data ) result , err := gcm . Open ( nil , nonce , data [ AesGcmNonceSize : ] , nil ) if err != nil { return nil , err } return result , nil }
Decrypt AES-GCM encrypted message
Decrypt AES - GCM encrypted message