func (ec *Cipher) EncryptByte(byteData []byte) (encryptedByte []byte, err error) {
	if len(byteData) == 0 {
		return nil, errors.New("input of encryptbyte is empty")
	}
	hashByte, err := ec.createHashByte()
	if err != nil {
		log.Println(err)
		return nil, err
	}
	block, _ := aes.NewCipher(hashByte)
	gcm, err := cipher.NewGCM(block)
	if err != nil {
		return
	}
	nonce := make([]byte, gcm.NonceSize())
	if _, err = io.ReadFull(rand.Reader, nonce); err != nil {
		return
	}
	encryptedByte = gcm.Seal(nonce, nonce, byteData, nil)
	return
}
EncryptByte encrypts from []byte to []byte
package sha256
import (
	"crypto/aes"
	"crypto/cipher"
	"crypto/rand"
	"crypto/sha256"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"github.com/lf-edge/edge-home-orchestration-go/internal/common/logmgr"
	c "github.com/lf-edge/edge-home-orchestration-go/internal/restinterface/cipher"
)
type Cipher struct {
	passphrase []byte
}
var (
	log = logmgr.GetInstance()
)
func GetCipher(cipherKeyFilePath string) c.IEdgeCipherer {
	sHA256Cipher := new(Cipher)
	passphrase, err := ioutil.ReadFile(cipherKeyFilePath)
	if err != nil {
		sHA256Cipher.passphrase = []byte{}
		log.Println("len :", len(sHA256Cipher.passphrase))
		log.Println("can't read passphrase key from keyFilePath - ", err)
	} else {
		sHA256Cipher.passphrase = passphrase
	}
	return sHA256Cipher
}