Let's start with the main thing. What is a SIM card?
A SIM card is a contact smart card with its own processor , capable of registering with a mobile network. "Simka" can find the nearest transmitting station and store information: numbers, SMS and other data.
The SIM card has permanent (non-volatile) and RAM memory. There is also a hardware encryption module and a hardware random number generator.
The SIM card processor operates at up to 10 MHz .
The permanent memory is divided into areas: approximately 60% is occupied by operator data, 20% by the operating system, and the rest by user data.
How are SIM cards made?
It all starts with chip production. Among the most famous manufacturers are Samsung, ST Microelectronics, Infinion.
Then the chips are placed on the contact pads - assembly is performed. This results in a tape like this:
After this, the modules are removed from the tapes and attached to a plastic base. After that, each module is loaded with an operating system and applications.
The final step is flashing unique data for each card. These are ICCID and PIN codes, keys, identifiers, etc.
What types of SIM cards are there?
A standard (large) SIM card is actually a MiniSIM . Its dimensions are 15x25 mm. The standard was approved in 1996. Such cards support 2G and 3G, but do not work with 4G/LTE.
Before this, SIM cards were gigantic - 85.6x53.98 mm. Like credit cards. They appeared in 1991.
The third generation, MicroSIM , was introduced in 2003. We owe the distribution of 12x15 mm cards to Apple and the iPhone 4.
But this turned out to be a lot. In 2012, nanoSIM with dimensions of 8.8x12.3 mm was launched. By the way, they are thinner than other cards - 0.67 mm versus 0.76 mm.
And this is also the merit of Apple: by removing the edges of the MicroSIM, the company offered the most convenient option, compatible with previous generations. In fact, for the first time nanoSIM was widely used in the iPhone 5.
Why doesn't a SIM card break if it is cut?
Because you cut the plastic , but the chip and contact pad remain in place.
Typically, SIM cards are cut with a special cutter, similar to a stapler. If you put a card in it crookedly, you can hit the contacts or chip.
The most difficult thing is to cut the SIM card to nanoSIM size. The corner there is cut off almost “on the spot”. It is very easy to damage the chip, especially if you cut it with scissors or a drywall knife.
It’s easier to get a new SIM card of the required size with the old number from the operator’s salon. Just don’t forget your passport or power of attorney.
The replacement price depends on the operator. With Beeline it costs 30 rubles, with Megafon it’s free, with Tele2 too, as well as with MTS.
Let's go to the workshop
The dimensions of a microSIM card from a miniSIM are quite easy to obtain, since they do not differ in the size of the chip, but only in the amount of plastic around it. Today, almost every smartphone store and mobile equipment repair shop has a special stapler for cutting SIM cards. This procedure is quick and quite simple.
Most likely, you will be offered to cut the card immediately after purchase, as soon as a format discrepancy is discovered, or you can go to the nearest repair shop if you discover this problem already at home. The only disadvantage of this solution is that this procedure is still not free and in most cases they will charge you about 150 rubles. Plus, you must trust a stranger, because if you handle the stapler carelessly, the SIM card can be damaged.
What is eSIM
This is a chip (embedded SIM - built-in SIM) that is installed inside a smartphone or other device. You can record the same information on it as on a regular SIM card.
To connect an eSIM to the operator’s network, you need to receive a set of encrypted data from it and save it.
eSIM saves space inside the smartphone. The chip can be installed anywhere, and since you don’t need to take it out, there won’t be a hole for a “clip” in the case. Protection from dust and moisture is easier to organize.
In addition, to change the operator, you do not need . You can even connect to several operators - save different profiles with your own settings.
People started talking about eSIM when Apple released the iPhone XS/XR/XS Max. Previously, built-in SIM cards were used in the 2021 Samsung Gear S2 3G smartwatch and Apple Watch 3/4. Received eSIM support and Google Pixel 2 smartphone.
The problem is that not all operators support the technology. And in some countries (including the Russian Federation) eSIM is generally illegal .
Firstly, writing data to an eSIM is equivalent to copying a SIM card. This is a fraud.
Secondly, with eSIM you can switch to a new operator without notifying your previous one. This is a violation of the terms of the contract.
In general, for now eSIM can only be used in certain countries. And not all operators.
Read in our other article all the details about eSIM, as well as about the differences between eSIM and a regular SIM card.
ICCID encoding
The abbreviation ICCID refers directly to the SIM card, literally meaning “Integrated Circuit Card ID”. This is a block of 19 or 20 digits, which contains information about where and for whom the SIM card was issued (country, manufacturer, release date, operator), provides its individual internal number and indicates the control value of the encoding.
Since SIM card numbers should not be repeated even by chance, the rules provided for by the international technical standard ITU-T E.118 are applied to generate ICCID.
- the first two digits are MII (Major Industry Identifier), an industry identifier according to the ISO/IEC 7812-1 standard. The main industry code used for telecommunications purposes is 89. That is, all SIM cards always have a serial number starting with 89.
- characters from the third to the fourth (or fifth) are the telephone country code according to the E.164 recommendation. This technical standard specifies the general international telecommunications numbering plan and number format used in telephone networks. For any region of the Russian Federation - value 7.
- the next four (or five) digits identify the organization that issued the card. The numbers are indicated that are issued by the international telecommunications divisions of ITU-T to each telecom operator that issues SIM cards. For example, for a Beeline subscriber in the federal GSM-900 network, the encoding will be 01 99.
- numbers starting from 18th (or 19th) are the internal identifier of the SIM card. The organization providing communication services determines this code not according to a general standard, but in accordance with its regulations. In this way, each physical piece of plastic is linked to the provider’s software identifier.
- one character (last) - control ratio of the serial number (Parity). This is a number (sometimes a letter), which is calculated from all other ICCID numbers using a special Luhn algorithm. The algorithm is simple and is not a cryptographic tool. “Control” indicates that there was no unintentional distortion of data when encoding in the international SIM card identifier.
The unique serial number of a SIM card is a set of numbers grouped into three miniblocks ICCID = (IE) + (IR) + (P) .
Comments on decoding ICCID using the example: 89 7 01 99 1111XXXX607 3
IE (IIN) – issuer identification number (Issuer Identification Number). Taken together, the first three encoding fields (from the 1st to the 7th digit in total): 89 – fixed digits for all SIM cards; 7 – Russia; 01 – federal network of GSM-900 standard; 99 – telecom operator Beeline.
IR (IID) – SIM card identifier (Individual ID). A block of 11 subsequent digits (from 8th to 18th) is an internal number encoded by the telecom operator. In this case: 1111XXXX607 in Beeline format .
P (P) – control ratio in encoding numbers (Parity). The last character in a sequence of 19 or 20 characters. In the example given: 3 .
In practice, GSM SIM cards, depending on the manufacturer, use both 19-bit (18 encoding digits + 1 control value) and 20-bit (19 encoding digits + 1 control value) ICCIDs. However, each issuer always uses the same code size for its ICCIDs.
What data is stored on the SIM card?
The SIM card stores KI and IMSI , as well as other information. It looks something like this:
IMSI (International Mobile Subscriber Identity) – international mobile subscriber number. It is forwarded to the network, but only upon authentication. Whenever possible, instead of IMSI, the smartphone sends TMSI - a temporary identifier generated based on IMSI.
KI (Key Identification) – a unique 128-bit user authentication key. It is also needed for authorization on the network. KI is generated using the A8 algorithm, authentication takes place using the A3 algorithm.
Python problems with solutions
SIM (Subscriber Identity Module) - to give a simple definition, is a chip into which a subscriber number is stitched. We will look at why this device is needed in this article.
When registering a phone on the network, it is registered in the subscriber database. At the dawn of the mobile era, unique numbers were used as a phone identifier, which were “stitched” during the manufacturing process of the phone. To be precise, they used ESN (Electronic Serial Number) - the same number in electronic form. It was the ESN that was used at the time of making calls and to register the phone on the network. At first this was quite enough. There were not many varieties of manufacturing companies. And more often than not, one company supplied both network equipment and mobile phones. In this case, telephones were often registered on the network directly at the factory, at the end of the production stage. With the increase in phone brands, the process of registering a phone has become much more complicated. At that time, there was no uniform standard for recording ESN. The greatest inconvenience was that when registering a phone on the network (when purchasing or changing a phone), the subscriber had to come to the telecom operator’s office.
This continued until the early 90s. It was during these years that the GSM standard began to operate. The developers of the new standard were tasked with eliminating the above inconveniences. The problem was solved by separating the identification of the telephone set and the subscriber. Each mobile phone has its own unique IMEI number (International Mobile Equipment Identifier). The 15-digit number can be seen on the box and on the phone itself. All subscriber data was located in a replaceable chip - SIM (Sibscriber Identity Module). Initially, the purpose of IMEI was only to check whether the phone was legal. If the IMEI was on the blacklist, the operator’s network did not register the device on its network.
But it is immediately worth noting that this technology was poorly established. Many cellular operators do not check IMEI at all. That is why the market for illegal phones has reached considerable sales volumes. True, the situation is beginning to change. Increasingly, there are news reports about attempts to create a separate database of stolen phones (within a separate country) and simplify access to this database for ordinary citizens.
All data that is necessary to identify the subscriber is in the SIM. The chips are flashed in advance, which greatly simplifies the procedure for registering a phone on the network - there is no need to contact a telecom operator. There is no need to perform any unnecessary manipulations when changing a telephone set.
Despite the external simplicity of the SIM card, it has many functions. Functions such as encryption of conversations and authentication of the card itself are also implemented in it. The contents of a modern sim are also impressive. In addition to reprogrammable (EEPROM), read-only memory (ROM) and random access memory (RAM), there are also input-output nodes and an 8-bit processor. All this is controlled by its own operating system. All this miracle of technology can easily compete in power with computers of the 80s. Initially, the cards used an operating voltage of 5.5 V. Currently it is 3.3 V.
Expanding the functionality of the SIM card became possible thanks to STK (SIM Application Toolkit) technology. This technology is a set of commands and procedures written on the sim and designed for advanced SMS exchange capabilities. The last sentence, of course, turned out to be a little unclear. Simply put, this innovation looks like a separate menu item on the phone (usually in “tools”) - weather, news, exchange rates, dating (probably the most frequently used), etc. The entire wide range of functions is implemented according to one principle - the phone generates an SMS request, the result is also returned in the form of a message.
From a physical point of view, a SIM card is a modification of a smart card, which is widely used in payment systems. Thanks to this, SIM is less susceptible to external influences (electrical, magnetic, mechanical, etc.). Often problems with the card are associated with banal bad contacts. During operation, several rules should be followed. Firstly, you should not put much effort into the SIM card because... it does not have a body as such. Secondly, you should be careful when handling gold-plated contacts. If the coating is damaged, further oxidation is inevitable.
A separate group includes phones that are popularly called “locked”, from the name “locked” (SIM-lock). In this case, the phone works only with one mobile operator. This limitation is implemented programmatically. There are quite a lot of ways. The most common method is where operator codes (NCC) are written into the mobile phone software. When you turn on the phone, similar codes are read from the SIM card. If the codes match, the phone is working. Practice has shown that it is quite easy to do. Flashing a phone is not something special these days.
Initially, SIM cards had a credit card format - this was the result of an attempt to make them possible to use in payphones. The inappropriateness of this format was determined quite quickly. The mini format was introduced (currently in use). For quite a long time, format compatibility was resolved in the following way (surely many still remember this procedure) - the card was supplied in a large format and the mini-format card was broken off from it.
One cannot ignore such a parameter as the resistance of cards against hacking. Such things are always relevant. We will not go into details - this deserves a separate article. The purpose of hacking a SIM card is to extract the following data:
- IMSI (International Mobile Subscriber Identity) – subscriber identification number
- Ki – individual IMSI encryption key
- cryptographic algorithm program In modern SIM cards, the internal structure does not allow external reading of this data - only the internal processor has access to it. Hacking is only possible by searching through the required numbers, which takes a decent amount of time. To counter this hacking method, cards have a limit on the maximum allowed number of accesses to the card (with normal use, this limit cannot be reached). It is worth noting that this method is not 100% hack-proof. The most effective method of protection for any method of illegal SIM copying is not to leave the card with strangers for a long time (although you shouldn’t leave it for a short time either - in case a stranger runs quickly).
In conclusion, I note that the technology implemented in the manufacture of SIM cards is used not only in GSM networks. It is also used in satellite communications, CDMA standard, Wi-Fi terminals, etc.
Related topics:
- Message map entry macros. Deleting entries...
- Disk storage device
- Inductive definitions of operations and predicates,…
- The principle of “divide and conquer”
How do criminals steal data from a SIM card?
To obtain data from a card, SIM scanners or SIM cloners . You can buy them for 150 rubles or even cheaper.
More or less legal scanners do not read KI, so as not to allow scammers to clone a SIM card and use it to hack accounts. In fact, the SIM card processor works directly with KI, and there is no need to transmit the identifier to the external network .
KI is stored in a read-protected memory area. But if you repeatedly run the A3 algorithm on the scanner and enter a random RAND password, then cryptographic methods for analyzing the SRES response will allow you to calculate KI. It takes less than a minute .
However, SIM cards have a kind of self-destruct timer . After a certain number of runs of the A3 algorithm, the SIM card processor stops calculating SRES and generally responding to requests.
But crypto methods only work effectively with older versions of the A3 algorithm - COMP128v1. Operators use it extremely rarely. COMP128v2 and COMP128v3 simply will not allow you to calculate RAND-SRES and KI. At least quickly and for sure.
So if you want to buy a scanner that hacks everything, or download a program that will pull out KI from any card, most likely you will be scammed . And they will also give you a Trojan to get your data.
The problem is that the fraudster has access to the operator's database and can obtain a set of keys for a large number of SIM cards. If hackers have at their disposal a table of correspondence between SIM cards and KI, which the manufacturer transfers to the operator with the next batch, the data will also be at risk.
But this is rather a theoretical possibility. As well as the transfer of keys over the air of a mobile operator. KI is not broadcast, so it is impossible to intercept it directly.
How to change SIM card in your phone
There are a great many different phone models, and for each model it is impossible to describe the entire process of inserting and replacing a SIM card. But this process is very simple, and all gadgets can be divided into 2 groups:
- Telephone with SIM slot and special card holder (latest models).
- A phone with a SIM slot in the case behind the battery (old or budget phones are not smartphones).
For the first type, you can insert and remove the SIM in this way:
1) We take out the holder for the SIM using a special device in the form of a sharp tip, for this tip there is a special connector in the holder, insert the tip into this hole.
2) Take out the SIM holder.
3) Change the SIM card.
4) Insert the holder back into the phone.
It is worth noting that most new smartphone models have slots for two SIM cards, and they are of different sizes, and some have a slot for a memory card (micro-SD). But on the phone box or on a sticker it will be displayed: which SIM cards should be inserted and where.
Installing a SIM card for old type phones (with a removable battery and cover) will be as follows:
- Turn off your phone.
- Take out the back panel.
- Remove the battery.
- Find the SIM card slot. They have the shape of a SIM card and usually have a picture next to it showing how to insert the card.
- Reinstall the battery.
- Secure the back cover until it clicks.
But what if you need to insert an already cropped or reduced SIM card into a phone with a regular enlarged connector or turn it from a nano-SIM into a micro-SIM?
The easiest way would be to buy a frame for the SIM or special molds. Perhaps this was preserved when you bought an old card.
If you can’t purchase it, you can make this frame yourself:
- Take a regular size SIM card.
- Place it on cardboard the thickness of a SIM card.
- The map is drawn on cardboard along the outside and cut out.
- A micro or mini card is placed on the cut out cardboard, the contacts are aligned and outlined.
- A place is cut out of the cardboard for a small SIM card on the inside.
- The SIM card is inserted into the finished cardboard form, then, holding it from falling, we insert it into the SIM card slot in the phone.
In this case, the cardboard form is needed only to limit the movement of the SIM card so that it does not lose contact with the phone.
How are SIM cards cloned?
Initially, SIM cards were cloned in order to use several phone numbers from one smartphone. The card data was combined into a MultiSIM - a card with increased memory capacity. The next number could be accessed after simulating a smartphone reboot.
Later, when banks and payment services began to link accounts to mobile numbers, scammers became interested in cloning. When the clone entered the network, the original SIM card lost connection.
All calls and messages were sent to the clone number. This made it possible to intercept access to accounts, mobile banking, etc. The clone operated until the registration of the original number on the network was updated.
The operators stopped this scheme. Most often, the protection works if the SIM card is re-registered far enough from the previous point of entry into the network.
Here we talked about how SIM cards are stolen and money is stolen by requesting a duplicate card from the operator. If you make a clone, the possibilities are the same.
How is data on SIM cards protected?
By and large, SIM cards are protected only by PIN and PUK codes. Cybersecurity experts recommend keeping PIN code protection active at all times and, of course, changing the traditional four zeros in the code to something more complex.
Otherwise, the security of using SIM cards is ensured by the developers of mobile applications - banking, etc.
For example, if you replace your SIM card, the banking application will see that you have the same phone number, but the IMSI number has changed , and will block receiving codes to confirm transactions. To restore access, you will have to contact support and confirm your identity.
Sim tool kit
Modern SIM cards may come pre-installed with applications provided by the operator. To use applications on a SIM card, your phone must support the SIM Tool Kit (STK) standard. Applications on the SIM card using STK can use various functions of the cell phone, including the user interface, communication module, etc., which allows for a fairly wide range of functionality.
STK applications are under the full control of the operator and are considered the most secure, as they can use the encryption module built into the card, which makes them extremely attractive for the implementation of financial services, such as telebanking or payment authentication.
It is also possible for the operator to download and update these applications directly using the cellular network. The disadvantage of such applications is that their use requires issuing a card that supports the SIM Tool Kit with a sufficient amount of memory and transferring it to the subscriber, which is quite difficult from an organizational point of view.
STK is often used to implement the SIM menu service, which is available with most Russian operators. To interact with the operator, this application uses SMS, USSD or CB messages hidden from the subscriber.
There are known cases of cellular operators implementing advertising on smartphones using STK dialog boxes (for example, T-mobile in some regions), while the only way to completely disable it may be to disable or delete the STK system application.
Is it true that a SIM card can become demagnetized?
No . Although operators love this fairy tale.
A SIM card is a miniature computer, a printed circuit board with contacts. It has a processor, RAM and permanent memory, and auxiliary elements.
But there is nothing . You can’t demagnetize the processor in a computer or smartphone, right? Try it, of course, what if...
But the SIM card can be damaged. For example, if it is bent or wet and not properly dried.
Theoretically, the card could fail due to static voltage. If you rub it on a synthetic suit, for example. But why?
Finally, any memory chip has a resource of rewrite cycles. At a certain point, memory cells will simply stop changing state.
But all this has nothing to do with demagnetization. Not at all .