func encrypt(block cipher.Block, value []byte) ([]byte, error) {
	iv := generateRandomKey(block.BlockSize())
	if iv == nil {
		return nil, errors.New("encrypt: failed to generate random iv")
	}
	// Encrypt it.
	stream := cipher.NewCTR(block, iv)
	stream.XORKeyStream(value, value)
	// Return iv + ciphertext.
	return append(iv, value...), nil
}
// encrypt encrypts a value using the given block in counter mode.
//
// A random initialization vector (http://goo.gl/zF67k) with the length of the
// block size is prepended to the resulting ciphertext.
encrypt encrypts a value using the given block in counter mode.

A random initialization vector  with the length of the
block size is prepended to the resulting ciphertext.
// encrypt encrypts a value using the given block in counter mode . // // A random initialization vector ( http : // goo . gl / zF67k ) with the length of the // block size is prepended to the resulting ciphertext .
func encrypt(block cipher.Block, value []byte) ([]byte, error) {
	iv := generateRandomKey(block.BlockSize())
	if iv == nil {
		return nil, errors.New("encrypt: failed to generate random iv")
	}
	stream := cipher.NewCTR(block, iv)
	stream.XORKeyStream(value, value)
	return append(iv, value...), nil
}
func encrypt ( block cipher . Block , value [ ] byte ) ( [ ] byte , error ) { iv := generateRandomKey ( block . BlockSize ( ) ) if iv == nil { return nil , errors . New ( " " ) } stream := cipher . NewCTR ( block , iv ) stream . XORKeyStream ( value , value ) return append ( iv , value ... ) , nil }
encrypt encrypts a value using the given block in counter mode.
encrypt encrypts a value using the given block in counter mode .
// Encrypt it. // Return iv + ciphertext.