CN110430569A - A kind of remote write SIM card method based on Android system - Google Patents

A kind of remote write SIM card method based on Android system Download PDF

Info

Publication number
CN110430569A
CN110430569A CN201910732439.6A CN201910732439A CN110430569A CN 110430569 A CN110430569 A CN 110430569A CN 201910732439 A CN201910732439 A CN 201910732439A CN 110430569 A CN110430569 A CN 110430569A
Authority
CN
China
Prior art keywords
data
sim card
byte
imsi
android system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910732439.6A
Other languages
Chinese (zh)
Other versions
CN110430569B (en
Inventor
宋文韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201910732439.6A priority Critical patent/CN110430569B/en
Publication of CN110430569A publication Critical patent/CN110430569A/en
Application granted granted Critical
Publication of CN110430569B publication Critical patent/CN110430569B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/183Processing at user equipment or user record carrier
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/20Transfer of user or subscriber data
    • H04W8/205Transfer to or from user equipment or user record carrier

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The remote write SIM card method based on Android system that the invention discloses a kind of, the present invention is combined five yards of data, and encrypts to the data after combination;Encryption data is transferred to mobile phone by network;Channel is established using underlying protocol OpenMobile technology and SIM card piece using based on Android platform, then IMSI personalized instruction is transmitted, carries out the MCC number of cutting;Encryption data is decrypted in SIM card, is then registered in base station and is communicated.This method operation is convenient, it can be by remotely the SIM card in mobile phone being rewritten or being activated operation, avoid user that from must handling to business hall, save user time, in testing field, greatly reduce the deposit of entity card, reduces testing process bring time loss, testing efficiency is improved, testing cost is reduced.

Description

A kind of remote write SIM card method based on Android system
Technical field
The present invention relates to field of communication technology, specially a kind of remote write SIM card method based on Android system.
Background technique
Mobile phone has been increasingly becoming the life tool that people must can not need, and the SIM card in mobile phone is to be communicated, received The main component of short message.If SIM card damage or new purchase, the business hall for needing me to set to communication common carrier are gone to handle and be swashed Living, existing method by writer one is write data into SIM card, the second is the data of some complexity of user are given to, by User inputs on mobile phone, then carries out registration write-in;Existing way requires the participation of people or equipment, SIM card with Data correspond, and can not carry out from the number of moving and frequently rewriting SIM data, especially for the survey of some communication softwares or equipment Examination, it is cumbersome using card-reading mode, it is time-consuming and laborious.
Summary of the invention
In view of the problems of in the prior art, the invention discloses a kind of remote write SIM based on Android system Chucking method, comprising the following steps:
Step.1 is combined five yards of data: five yards of data include ICCID, IMSI, SMSP, R1-R5, Limit, Delta;
Step.2 encrypts data, comprising the following steps:
A) take 16 systems ' 0x00 ' of 8 bytes as initial value;
B) all initial data are grouped D1 according to every one group of 8 bytes, D2, D3, D4 ..., Dn;Such as source Data are not 8 integral multiples, then filled up after the data block value be 16 systems ' 0x80 ' byte, remaining word save 16 into The byte polishing for making ' 0x00 ' is 8 bytes;L calculates the data filled needed for MAC and is not included in the message data remittance actually transmitted Always, it is voluntarily filled when calculating MAC code according to data length by MAC value verification side;
C) these data blocks are encrypted using session key;Encryption Algorithm is encrypted using 3DES-CBC, is encrypted If method is the integral multiple that encryption data is 8, a 8 byte data block ' 0,x80 00 00 00 00 are added after data block 00 00 00';If initial data is not 8 integral multiple, the word that a value is 16 systems ' 0x80 ' is filled up after changing data block Section, the byte polishing that remaining word saves 16 systems ' 0x00 ' is 8 bytes;
D) finally obtain be 4 byte lengths obtained on the left of the calculated result MAC;
The transmitting of Step.3 data supports http agreement and https agreement to carry out data transmission;
The Step.4 number of cutting writes card: it is operated based on android system top layer OpenMobile agreement, steps are as follows:
Step 1: calling SEService, Reader, reader.openSession () in SimCardIOManager Method is initialized, and session is obtained
Step 2: calling getLogicChannelNum () method Channel in SimCardIOManager Channel=session.openLogicalChannel (aid) Acquisition channel;
Step 3: calling getLogicChannelNum () method byte [] rsp=in SimCardIOManager Channel.transmit (apduBytes) opens channel;
Step 4: being switched to the specified IMSI personal data SimOperator-- > switchIMSI () of ICCID;
Step 5: the IMSI data SimOperator-- > getActivedICCID () currently to come into force in inquirying card;
Step 6: IMSI data SimOperator-- > getAllICCIDs () all in inquirying card;
Step 7: closing passage SimCardIOManager-- > closeChannel;
Step 8: closing session SimCardIOManager-- > closeChannel;
Step.5 encryption data is decrypted in SIM card, is then registered in base station and is communicated.
Five yards of data ICCID in the Step.1: being then written if any data source, is not then sky;IMSI: last character It must be number;SMSP: it fills in short message centre number and combines;R1-R5:20132F495B;Limit:FFFFFFFFFFFF; Delta:000200000000。
The combined method of the SMSP are as follows: the number for obtaining sms center mends country code before number, if surprise after benefit Numerical digit then finally mends " F ", and even bit is not mended then;Number is mended into " 91 " according to forefront after every two bit reversals order, before " 91 " Length is filled, when total length is less than 12 bytes (24), mends FF afterwards.
Beneficial effects of the present invention: the present invention is combined five yards of data, and encrypts to the data after combination;It will Encryption data is transferred to mobile phone by network;Underlying protocol OpenMobile technology and SIM are used using based on Android platform Card establishes channel, then transmits IMSI personalized instruction, carries out the MCC number of cutting;Encryption data is solved in SIM card It is close, it is then registered in base station and is communicated.This method operation it is convenient, can by remotely to the SIM card in mobile phone carry out rewrite or Activation operation, avoids user that from must handling to business hall, saves user time in testing field and greatly reduces the storage of entity card It is standby, testing process bring time loss is reduced, testing efficiency is improved, reduces testing cost.
Detailed description of the invention
Fig. 1 is the number of cutting of the invention, writes card flow chart;
Fig. 2 is that data of the present invention combine encryption flow figure;
Specific embodiment
Embodiment 1
A kind of remote write SIM card method based on Android system of the present embodiment, including the following steps:
Step.1 is combined five yards of data: five yards of data include ICCID, IMSI, SMSP, R1-R5, Limit, Delta;
Step.2 encrypts data, comprising the following steps:
A) take 16 systems ' 0x00 ' of 8 bytes as initial value;
B) all initial data are grouped D1 according to every one group of 8 bytes, D2, D3, D4 ..., Dn;Such as source Data are not 8 integral multiples, then filled up after the data block value be 16 systems ' 0x80 ' byte, remaining word save 16 into The byte polishing for making ' 0x00 ' is 8 bytes;L calculates the data filled needed for MAC and is not included in the message data remittance actually transmitted Always, it is voluntarily filled when calculating MAC code according to data length by MAC value verification side;
C) these data blocks are encrypted using session key;Encryption Algorithm is encrypted using 3DES-CBC, is encrypted If method is the integral multiple that encryption data is 8, a 8 byte data block ' 0,x80 00 00 00 00 are added after data block 00 00 00';If initial data is not 8 integral multiple, the word that a value is 16 systems ' 0x80 ' is filled up after changing data block Section, the byte polishing that remaining word saves 16 systems ' 0x00 ' is 8 bytes;
D) finally obtain be 4 byte lengths obtained on the left of the calculated result MAC;
The transmitting of Step.3 data supports http agreement and https agreement to carry out data transmission;
The Step.4 number of cutting writes card: it is operated based on android system top layer OpenMobile agreement, steps are as follows:
Step 1: calling SEService, Reader, reader.openSession () in SimCardIOManager Method is initialized, and session is obtained
Step 2: calling getLogicChannelNum () method Channel in SimCardIOManager Channel=session.openLogicalChannel (aid) Acquisition channel;
Step 3: calling getLogicChannelNum () method byte [] rsp=in SimCardIOManager Channel.transmit (apduBytes) opens channel;
Step 4: being switched to the specified IMSI personal data SimOperator-- > switchIMSI () of ICCID;
Step 5: the IMSI data SimOperator-- > getActivedICCID () currently to come into force in inquirying card;
Step 6: IMSI data SimOperator-- > getAllICCIDs () all in inquirying card;
Step 7: closing passage SimCardIOManager-- > closeChannel;
Step 8: closing session SimCardIOManager-- > closeChannel;
The number of cutting, to write card process as shown in Figure 1.
Step.5 encryption data is decrypted in SIM card, is then registered in base station and is communicated.
By taking China Mobile as an example, SMSP can do following combination: Mobile SMS center: 13800100500, it is filled in the front Country code, China are " 86 " 8613800100500, mend " F " below when being odd bits, and even bit does not have to mend, and are obtained 8613800100500F, every two one reverse to obtain 683108100005F0, and mending " 91 " in front is 91683108100005F0, Length is added in front, sample length " 08 " obtains 0891683108100005F0, when total length is less than 12 bytes (24), after It mends FF and obtains 0891683108100005F0FFFFFF.
Encryption method citing: length+clear data:
67010001010A9868006601410540616314090849060025125698701502008016107E B661D5D8F6C86E539881B8955AA1CD170C0891683108504105F0FFFFFF18100A00B86C53BFDE 29B1092124AAF093E7240520132F495B2506FFFFFFFFFFFF2606000200000000
MAC is first calculated, to be filled, filled data are as follows:
67010001010A9868006601410540616314090849060025125698701502008016107E B661D5D8F6C86E539881B8955AA1CD170C0891683108504105F0FFFFFF18100A00B86C53BFDE 29B1092124AAF093E7240520132F495B2506FFFFFFFFFFFF2606000200000000800000000000 0000
3DES-CBC calculating is done to filled data:
6B60BDE565904DAF75F61EDE6E6B3FA976CC7266A4B6DA5113AE393BE8A0631A8AA8 2E722C53EBE8FE74965996E5F9DEA7E478E5A95DCE21B5AB01D3AA9EB8F34619D61502A14855 07A84CDA41F71293EA1F5AE39400708E10D0D548D087819DCFEC9F89DD8524C70C62EA905C60 AFC4
Intercept last 8 bytes: 0C62EA905C60AFC4
Take preceding 4 bytes of this 8 bytes as MAC:0C62EA90
Number after MAC is added to behind in plain text are as follows:
67010001010A9868006601410540616314090849060025125698701502008016107E B661D5D8F6C86E539881B8955AA1CD170C0891683108504105F0FFFFFF18100A00B86C53BFDE 29B1092124AAF093E7240520132F495B2506FFFFFFFFFFFF26060002000000000C62EA90
It is refilled with, filled data are as follows:
67010001010A9868006601410540616314090849060025125698701502008016107E B661D5D8F6C86E539881B8955AA1CD170C0891683108504105F0FFFFFF18100A00B86C53BFDE 29B1092124AAF093E7240520132F495B2506FFFFFFFFFFFF26060002000000000C62EA908000 0000
3DES-CBC calculating is done to filled value:
6B60BDE565904DAF75F61EDE6E6B3FA976CC7266A4B6DA5113AE393BE8A0631A8AA8 2E722C53EBE8FE74965996E5F9DEA7E478E5A95DCE21B5AB01D3AA9EB8F34619D61502A14855 07A84CDA41F71293EA1F5AE39400708E10D0D548D087819DCFEC9F89DD8524C75AF0011E5B22 C1D0.Data combined ciphering is as shown in Figure 2.
Although above-mentioned be explained in detail specific embodiments of the present invention, the present invention is not limited to above-mentioned implementations Example, within the knowledge of a person skilled in the art, can also do without departing from the purpose of the present invention Various change out, without having the modification of creative work or deformation still within protection scope of the present invention.

Claims (3)

1. a kind of remote write SIM card method based on Android system, it is characterised in that the following steps are included:
Step.1 is combined five yards of data: five yards of data include ICCID, IMSI, SMSP, R1-R5, Limit, Delta;
Step.2 encrypts data, comprising the following steps:
A) take 16 systems ' 0x00 ' of 8 bytes as initial value;
B) all initial data are grouped D1 according to every one group of 8 bytes, D2, D3, D4 ..., Dn;Such as source data It is not 8 integral multiple, then fills up the byte that a value is 16 systems ' 0x80 ' after the data block, remaining word saves 16 systems The byte polishing of ' 0x00 ' is 8 bytes;The data that l calculates filling needed for MAC are not included in the message data actually transmitted and summarize, It is voluntarily filled when calculating MAC code according to data length by MAC value verification side;
C) these data blocks are encrypted using session key;Encryption Algorithm is encrypted using 3DES-CBC, encryption method If for encryption data being 8 integral multiple, a 8 byte data block ' 0,x80 00 00 00 00 00 are added after data block 00 00';If initial data is not 8 integral multiple, the byte that a value is 16 systems ' 0x80 ' is filled up after changing data block, The byte polishing that remaining word saves 16 systems ' 0x00 ' is 8 bytes;
D) finally obtain be 4 byte lengths obtained on the left of the calculated result MAC;
The transmitting of Step.3 data supports http agreement and https agreement to carry out data transmission;
The Step.4 number of cutting writes card: it is operated based on android system top layer OpenMobile agreement, steps are as follows:
Step 1: the method for calling SEService, Reader, reader.openSession () in SimCardIOManager It is initialized, obtains session
Step 2: calling getLogicChannelNum () method Channel channel=in SimCardIOManager Session.openLogicalChannel (aid) Acquisition channel;
Step 3: calling getLogicChannelNum () method byte [] rsp=in SimCardIOManager Channel.transmit (apduBytes) opens channel;
Step 4: being switched to the specified IMSI personal data of ICCID
SimOperator-->switchIMSI();
Step 5: the IMSI data currently to come into force in inquirying card
SimOperator-->getActivedICCID();
Step 6: IMSI data all in inquirying card
SimOperator-->getAllICCIDs();
Step 7: closing passage SimCardIOManager-- > closeChannel;
Step 8: closing session SimCardIOManager-- > closeChannel;
Step.5 encryption data is decrypted in SIM card, is then registered in base station and is communicated.
2. a kind of remote write SIM card method based on Android system according to claim 1, it is characterised in that: described Five yards of data ICCID in Step.1: being then written if any data source, is not then sky;IMSI: last character must be several Word SMSP: it fills in short message centre number and combines;R1-R5:20132F495B;Limit:FFFFFFFFFFFF;Delta: 000200000000。
3. a kind of remote write SIM card method based on Android system according to claim 2, it is characterised in that: described The combined method of SMSP are as follows: the number for obtaining sms center is mended country code before number, then finally mended after benefit if odd bits " F ", even bit are not mended then;Number is mended into " 91 " according to forefront after every two bit reversals order, length is filled before " 91 ", when total When 12 byte of curtailment (24), FF is mended afterwards.
CN201910732439.6A 2019-08-12 2019-08-12 Android system-based method for remotely writing SIM card Active CN110430569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910732439.6A CN110430569B (en) 2019-08-12 2019-08-12 Android system-based method for remotely writing SIM card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910732439.6A CN110430569B (en) 2019-08-12 2019-08-12 Android system-based method for remotely writing SIM card

Publications (2)

Publication Number Publication Date
CN110430569A true CN110430569A (en) 2019-11-08
CN110430569B CN110430569B (en) 2022-11-15

Family

ID=68413418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910732439.6A Active CN110430569B (en) 2019-08-12 2019-08-12 Android system-based method for remotely writing SIM card

Country Status (1)

Country Link
CN (1) CN110430569B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471274A (en) * 2003-07-07 2004-01-28 江苏移动通信有限责任公司 Smart card remote card-issuing-writing system based on Internet
CN101217728A (en) * 2007-12-29 2008-07-09 北京握奇数据***有限公司 A blank card for wireless card writing, wireless card writing server and wireless card writing method
CN101547437A (en) * 2009-04-30 2009-09-30 东信和平智能卡股份有限公司 A telecom intelligent card, an air card writing system and an air card writing method
CN101667257A (en) * 2009-08-20 2010-03-10 北京握奇数据***有限公司 Empty card for wireless card writing, wireless card writing server and method
CN102480720A (en) * 2010-11-29 2012-05-30 中国电信股份有限公司 Aerial card writing method and system as well as subscriber identity identification card
CN103249033A (en) * 2013-05-10 2013-08-14 东信和平科技股份有限公司 Method and terminal for achieving self-help number changing of SIM card
CN103841552A (en) * 2012-11-26 2014-06-04 北京握奇数据***有限公司 Method and system for carrying out aerial card writing through mobile terminal and card reader
CN104185169A (en) * 2013-05-21 2014-12-03 ***通信集团公司 Stator synchronization method of air write card, device and system thereof

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1471274A (en) * 2003-07-07 2004-01-28 江苏移动通信有限责任公司 Smart card remote card-issuing-writing system based on Internet
CN101217728A (en) * 2007-12-29 2008-07-09 北京握奇数据***有限公司 A blank card for wireless card writing, wireless card writing server and wireless card writing method
CN101547437A (en) * 2009-04-30 2009-09-30 东信和平智能卡股份有限公司 A telecom intelligent card, an air card writing system and an air card writing method
CN101667257A (en) * 2009-08-20 2010-03-10 北京握奇数据***有限公司 Empty card for wireless card writing, wireless card writing server and method
CN102480720A (en) * 2010-11-29 2012-05-30 中国电信股份有限公司 Aerial card writing method and system as well as subscriber identity identification card
CN103841552A (en) * 2012-11-26 2014-06-04 北京握奇数据***有限公司 Method and system for carrying out aerial card writing through mobile terminal and card reader
CN103249033A (en) * 2013-05-10 2013-08-14 东信和平科技股份有限公司 Method and terminal for achieving self-help number changing of SIM card
CN104185169A (en) * 2013-05-21 2014-12-03 ***通信集团公司 Stator synchronization method of air write card, device and system thereof

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
叶辉 等: "一种基于通用手机的空中写卡方法", 《江苏通信》 *
黄海昆: "eSIM及其远程配置技术与应用", 《电信科学》 *

Also Published As

Publication number Publication date
CN110430569B (en) 2022-11-15

Similar Documents

Publication Publication Date Title
USRE49393E1 (en) Preventing shortened lifetimes of security keys in a wireless communications security system
CN102938696B (en) A kind of generation method of session key and module
MY192318A (en) Data sending method and apparatus
GB2387510B (en) Method for relocating SRNS in a mobile communication system
CN104660602A (en) Quantum key transmission control method and system
ATE476070T1 (en) MANAGE ANONYMOUS COMMUNICATION BETWEEN USERS BASED ON SHORT-RANGE WIRELESS CONNECTION IDENTIFIERS
CN104380773A (en) A virtual card download method, a terminal and intermediate equipment
CN101153910B (en) Method and system for safe transmission of GPS locating information and GPS receiver
CN109685499A (en) A kind of SIM card and implementation method of embedded digital wallet function
CN108028818A (en) The method and system that arbitrary data is transmitted with low delay is connected by bluetooth HFP audios
CN104955033A (en) Voice encryption communication method
CN104021470B (en) Wireless communication-based mobile payment system and mobile payment method
US10419212B2 (en) Methods, systems, apparatuses, and devices for securing network communications using multiple security protocols
CN103179559A (en) Safe communication method, device and system of terminal with low cost
ATE303699T1 (en) ENCRYPTION OF A COMPRESSED VIDEO STREAM
CN101841783A (en) Short message safety communication method, system and device based on STK (SIM Tool Kit) business
CN110430569A (en) A kind of remote write SIM card method based on Android system
CN105634729A (en) Mobile phone encryption and decryption method based on bluetooth equipment
CN104598782A (en) Data packaging and analysis method and device
CN103841552A (en) Method and system for carrying out aerial card writing through mobile terminal and card reader
CN103747019A (en) Data transmission method and device
CN104918230A (en) Card writing method, device and system
CN104243141A (en) Information segmented encryption communication method
US20050169480A1 (en) Fast ciphering key search for WLAN receivers
CN105228130B (en) Personal data method for down loading, terminal and Operator remote manage platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant