Exemple #1
0
        /// <summary>
        /// 对APDU指令读出来的结果,进行解密,拿到万通卡卡号
        /// </summary>
        /// <param name="cardNoSource"></param>
        /// <returns></returns>
        public string DecryptCardNo(string cardNoSource)
        {
            try
            {
                //准备解密
                byte[] cardNoArray = System.Text.Encoding.ASCII.GetBytes(cardNoSource.Substring(98, 48));

                //分散因子
                byte[] appgen = System.Text.Encoding.ASCII.GetBytes(cardNoSource.Substring(64, 16));

                //万通卡卡号解密

                StringBuilder cardNo = new StringBuilder(260);

                CRT310.F005(cardNoArray, cardNo, appgen);

                return(cardNo.ToString());
            }
            catch (Exception e) { return(null); }
        }