func DecryptKeyFile(path, auth string) (*Key, error) {
	ek, err := NewEncryptedKey(path)
	if err != nil {
		return nil, err
	}
	return ek.Decrypt(auth)
}
DecryptKeyFile decrypts the file and returns Key
package key
import (
	"bytes"
	"crypto/aes"
	"crypto/cipher"
	crand "crypto/rand"
	"crypto/sha256"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"github.com/zarbchain/zarb-go/crypto"
	"github.com/zarbchain/zarb-go/util"
	"golang.org/x/crypto/pbkdf2"
	"golang.org/x/crypto/scrypt"
)
const (
	keyHeaderKDF = "scrypt"
	scryptDKLen  = 32
	scryptN = 2
	scryptP = 1
	scryptR = 8
	version = 3
)
type EncryptedKey struct {
	Address    crypto.Address     `json:"address"`
	Crypto     *cryptoJSON        `json:"crypto,omitempty"`
	PrivateKey *crypto.PrivateKey `json:"privatekey,omitempty"`
	Label      string             `json:"label,omitempty"`
	Version    int                `json:"version"`
}
type cryptoJSON struct {
	Cipher       string                 `json:"cipher"`
	CipherText   string                 `json:"ciphertext"`
	CipherParams cipherparamsJSON       `json:"cipherparams"`
	KDF          string                 `json:"kdf"`
	KDFParams    map[string]interface{} `json:"kdfparams"`
	MAC          string                 `json:"mac"`
}
type cipherparamsJSON struct {
	IV string `json:"iv"`
}
func NewEncryptedKey(path string) (*EncryptedKey, error) {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return nil, err
	}
	ek := new(EncryptedKey)
	if err := json.Unmarshal(data, ek); err != nil {
		return nil, err
	}
	return ek, nil
}