public static string getKVCCheckFull(byte[] KVC)
        {
            string keyValue;

            byte[] zeroArray  = { 0, 0, 0, 0, 0, 0, 0, 0 };
            byte[] dataOutput = new byte[8];
            dataOutput = TripleDesOFB.OFBCrypt(zeroArray, KVC);
            keyValue   = BitConverter.ToString(dataOutput).Replace("-", "");
            return(keyValue);
        }
        public static string encodeFieldEncrypt(string unEncryptedField, byte[] KVC)
        {
            if (KVC == null)
            {
                return(unEncryptedField);
            }
            string dataField = unEncryptedField.Substring(12, unEncryptedField.Length - (3 + 12));

            byte[] dataArray       = Encoding.Default.GetBytes(ConvertToHex(dataField));
            byte[] dataArrayOutput = new byte[dataArray.Length]; // OFP = same length as input array
            //HICAPS3Des.CallEncryptData(dataArray, dataArray.Length, KVC, dataArrayOutput);
            dataArrayOutput = TripleDesOFB.OFBCrypt(dataArray, KVC);
            return(unEncryptedField.Substring(0, 12) + BitConverter.ToString(dataArrayOutput).Replace("-", " ") + " 1C");
        }
        /// <summary>
        /// Decrypt a field
        /// </summary>
        /// <param name="fieldValue"></param>
        /// <param name="KVC"></param>
        /// <returns></returns>
        internal static string decodeAlphaEncrypt(string fieldValue, byte[] KVC)
        {
            if (string.IsNullOrEmpty(fieldValue))
            {
                return(fieldValue);
            }
            if (KVC == null)
            {
                return(fieldValue);
            }

            byte[] dataArray       = Encoding.Default.GetBytes(fieldValue);
            byte[] dataArrayOutput = new byte[dataArray.Length]; // OFP = same length as input array
            dataArrayOutput = TripleDesOFB.OFBCrypt(dataArray, KVC);
            return(Encoding.Default.GetString(dataArrayOutput));
        }