社保卡圈存初始化

來源:互聯網
上載者:User

 

文法環境是公司自己做的,但大概思路可以看得出來,是同行有錯誤的地方請指證.!

 

RESET

;KID—金鑰索引
<--! %kid = 05
;type—交易類型
<--! %ltype = 31
;posid—終端機編號
<--! %posid = 00 11 22 33 44 55
;time—交易時間(主機)
<--! %time = 20 06 08 08 00 00 00
;money—交易金額
<--! %money =  12345678
;DLK分散密鑰
<--! %dlk= 28191D25B26E0227BB2DFAC41A1C9FA0
;選擇DF04
00a4000002df04
;選擇EF06
00a4020002ef06
;verify PIN
0020 000002 1234

;初始化
b02800010b   %kid %money %posid

<--! %status = @getresp()
<-- ! %balance=@strmid(%status,00,08)
echo %balance
<--! %tradenum = @strmid(%status,08,04)
echo %tradenum
<--! %icc=@strmid(%status,10,08)
echo %icc
<-- !%mac1=@strmid(%status,18,08)
echo %mac1

<--! %data = %icc >< %tradenum >< 8000
<--! %seslk = @dea(%dlk,%data,0)
<--! %mactemp=@sbmac(%seslk,%balance><%money><%ltype><%posid)
if %mactemp==%mac1

statuscmptxt 9000

messagebox 認證 成功
beep
else
 messagebox 失敗
endif
 
;算MAC2

<--! %tradenum=%tradenum+1
<--! %c=%money><%ltype><%posid><%time
<--! %maclast=@sbmac(%seslk,%c)

b02a00000b %time %maclast 04
;驗證 PIN
0020000002 1234
;查詢餘額
b0 2600 0104

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.