Resident Identity Card
The Resident Identity Card () is an official identity document for personal identification in the People's Republic of China. According to the second chapter, tenth clause of the Resident Identity Card Law, residents are required to apply for resident identity cards from the local Public Security Bureau, sub-bureaus or local executive police stations.

History

Prior to 1984, citizens within the People's Republic of China were not required to obtain or carry identification in public. On April 6, 1984, the State Council of the People's Republic of China passed the Identity Card Provisional Bill (中华人民共和国居民身份证试行条例), commencing the process of gradual introduction of personal identification, in the footsteps of many developed countries at the time. The first generation identification cards were single paged cards made of polyester film. Between 1984 and 1991, trials for the new identity card system took place in Beijing, Shanghai and Tianjin. Shan Xiurong (单秀荣), a Chinese Opera performer and soprano from Beijing, was the first person to receive a first-generation identity card in China.

On September 6, 1985, the Standing Committee of the 12th National People's Congress passed the Identity Card Bill of the People's Republic of China, which regulated that all citizens over the age of 16 apply for identification cards. At that point, the Ministry of Public Security of the People's Republic of China created a unified authority responsible for the issuing and management of the ID cards. From 2003, it is reported that a total of 1.14 billion ID cards have been created in China, for a total of 960,000,000 holders. However, as a result of technological development and certain techniques made available to the civilian population, the existing cards became relatively easier to counterfeit, opening the increasing threat of false identification.

On June 1, 2003, the National People's Congress passed the new Resident Identity Card Law, which expanded the scope of documents issued, and allowed soldiers in the People's Liberation Army and members of the People's Armed Police to apply for special identity cards. Individuals under the age of 16 were also permitted to voluntarily apply for an identification card. The law also established the use of newer, second-generation cards, which are machine-readable and more difficult to forge.

Contents
The identity card contains basic information regarding the individual, such as the following:
Reverse side
Full name – in Chinese characters only. Non-Chinese ethnic names and foreign names are transliterated into Chinese. First-generation ID cards contained handwritten names for rare Chinese characters, whilst the second-generation cards exclusively used computer-printed text in a larger font compared to that of the first generation, and do not support rarer characters.
Gender – containing one character for either male (男) or female (女).
Ethnicity – as officially listed by the People's Republic of China.
Date of birth – listed in the Gregorian calendar format, in YYYY年MM月DD日 Big-endian (ISO 8601) order.
Domicile – the individual's permanent residence as dictated by the Identity Card Bill of the People's Republic of China.
Identification number
Photo of the individual
Obverse side
Issuing authority (first-generation cards utilised a stamp; second-generation cards display text only)
The limits to validity of the document (for individuals under 16 years of age: five years; for individuals between 16 and 25 years of age: ten years; for individuals between 26 and 45 years of age: twenty years; for individuals over 46 years of age: long-term)

Information stored in the identity database for second-generation ID cards includes work history, educational background, religion, ethnicity, police record, medical insurance status, landlord's phone number and personal reproductive history. In addition, more detailed personal information can be obtained by viewing hukou information from the card database. Starting on January 1, 2013, Beijing has started trials to include fingerprints in the ID cards, making it more difficult to forge ID cards or for people to use the ID cards of others.

In 1984, discussion over the contents of the identity card became controversial regarding whether to include details such as "marital status" and "occupation"; considering the actual situation of the People's Republic of China at the time, these details ultimately were not included in the ID card.

The first-generation ID cards contained a black-and-white photograph portrait of the individual; following the introduction of the second-generation cards, all identification portraits are printed in colour. From 1 January 2013 a mandatory switch to the second-generation cards came into force; all first-generation cards became void and unusable. If used, first-generation cards are treated as expired ID cards, and will not be accepted. It is a criminal offense to accept first-generation ID cards if the person who accepts it know that it is a first-generation card.

The dimensions of the second-generation cards are 85.725 mm × 53.975 mm × 0.900 mm, and the identity photo is sized at 358 × 441 pixels (width by height), printed at a resolution of 350dpi on RGB using 24-bit True Color, prepared using JPEG compression techniques in line with the requirements of ISO DIS 10918-1. The final image appears as a 26 mm × 32 mm portrait box in the top-right hand corner.

Identity cards in ethnic minority areas
Within the ethnic minority regions in China, identity cards possess corresponding text in the respective minority language for both first-generation and second-generation cards. For example, cards officially signed and issued in Guangxi all contain accompanying text in Zhuang, as well as Chinese characters. According to the fourth clause of the Resident Identity Card Law, "based on the de facto situation within the organs of self-government within autonomous ethnic regions, the content of the resident identity card can, alongside Chinese characters, be decided to include the text of the ethnic group exercising regional autonomy or choice of a local generic text". This law permits resident identity cards within designated ethnic minority regions to have bilingual text, and depending on region, cards may contain accompanying text in Zhuang, Uyghur, Yi, Tibetan, Mongolian or Korean.

Ethnic minority residents represented by the local autonomous region can apply to have an additional ethnic minority language displayed on their identity cards, whilst Han Chinese and other ethnic residents' cards only have Chinese characters displayed. Ethnic minorities within their representative autonomous regions can have their personal name displayed in both their native language and Chinese characters; for example, within Xinjiang Uyghur Autonomous Region, a card belonging to an Uyghur may display the cardholder's name as "" (Effendi Nasreddin), however ethnic Kazakhs and Xibe people living in Xinjiang may only have their names written in Chinese. The following table shows the languages used on identity cards within minority regions:

Identity card number

From October 1, 1999, the PRC State Council approved the establishment of a citizen identification number system, and currently consists of an 18-digit code. This number, to some extent, has a function similar to that of the social security number in the United States, and each citizen has a unique number that remains unchanged for their entire lifetime. An exception previously existed, however, in rare instances where the same ID number had been accidentally issued to two people before the system was digitalised.

Address code refers to the resident's location, where administrative divisions (including cities, banners, and districts) have their own specific codes. (For example, the code for Xicheng District in Beijing is 110102.) Change of address does not modify this code however, which means that the code therefore reflects one's birthplace or the location of one's first-time card issuance (in the case where people are born before the resident identity card system was introduced).
Date of Birth in the form YYYY-MM-DD.
Order code is the code used to disambiguate people with the same date of birth and address code. Men are assigned to odd numbers, women assigned to even numbers.
The Checksum is the final digit, which confirms the validity of the ID number from the first 17 digits, utilizing ISO 7064:1983, MOD 11-2. The checksum is obtained by:
Marking the Identity card number right-to-left ， for the parity-check codes;
Weight coefficient calculation ;

{| class="wikitable"
!i!!18!!17!!16!!15!!14!!13!!12!!11!!10!!9!!8!!7!!6!!5!!4!!3!!2!!1
|-
!Wi
|7||9||10||5||8||4||2||1||6||3||7||9||10||5||8||4||2||1
|}
Calculation of 

Checksum derivation process in Visual Basic
Dim a, w, s ,id
 msgbox "This procedure for checking the identity card number and or-bit",vbokonly+vbinformation,"identity check procedures"
 id=inputbox("Enter the ID number 15 or 18 before the identity card numbers of 17 or","ID","11010519491231002")
 if vartype(id) <> 0 then
'Test the legality of the importation of numbers
  l = 0
  do until l = 1
   l = 1
   p = ""
   if len(id) <> 17 then
     if len(id) <> 15 then
      l = 0
      p = "enter the median is not correct, please enter 15 or 17-digit."
     end if
   end if
   for i = 1 to len(id)
    a = mid(id, i, 1)
    if asc(a) < asc("0") or asc(a) > asc("9") then
     l = 0
     p = p & vbCrLf & vbCrLf & "Please enter the number, do not include the characters“" & a & "”。"
     exit for
    end if
   next
   if l = 0 then
    id = inputbox("illegal input" & vbCrLf  & vbCrLf & p, "input error", id)
   end if
  loop
'Will be number 15 or 17 places to number
  if len(id) = 15 then
   id = left(id, 6) & "19" & right(id, 9)
  end if
'Number 17 for the calculation of parity-check codes
  for i = 2 to 18
   a = mid(id, 19-i, 1)
   w = 2^(i-1) mod 11
   s = a * w + s
  next
  s = (12 - (s mod 11)) mod 11
  if s = 10 then s = "X"
'After checking the number of output
  inputbox "the identity card number of the parity-check codes for the“" & s & "”" & vbcrlf & vbcrlf & "by checking the ID card numbers are as follows:", "Check completed", id & s
 end if
Checksum derivation process in JavaScript
// Must input 17 bit string of RID from left to right
function calcChecksum(rid) {
    var workArr = rid.split('').reverse();
    function W(i) {
        return Math.pow(2, i - 1) % 11;
    }
    function S() {
        var sum = 0;
        for (var j=0; j<17; j++) {
            sum += workArr[j] * W(j + 2);
        }

        return sum;
    }

    return (12 - (S() % 11)) % 11;
}

// Test
alert(calcChecksum('63280119790817003')); // will alert 6
Checksum derivation process in Ruby
str = "34262219840209049" #身份证前17位 first 17 digits of ID number
wi = [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2] # Wis
s = 0 # S in the context
for i in 0..str.length-1
n = str[i].to_i-48
s = s + n * wi[i]
end
a1 = (12 - s % 11) % 11
puts a1 # checksum
Checksum derivation process in Python
>>> id_checksum = lambda s:(1 - 2 * int(s, 13)) % 11
>>> check('63280119790817003')
6L
>>> check('34052419800101001')
10L # according to the standard, this means 'X'
Checksum derivation process in PHP
/**
 *身份证验证，传入身份证，返回true即为正确。 ID number validation, pass in ID number, return true if success.
 *只能传入字符串，传入参数必须加引号。 can only pass in strings, parameter should be surrounded by quote marks.
 **/
function check_id_number($id)
{
    if (strlen($id) != 18) {
        return false;
    }

    $temp = (str_split($id));
    $temp[17] == 'x'|| $temp[17] == 'X' ? $check = 10 : $check = $temp[17];
    array_pop($temp);
    $temp = array_reverse($temp);

    $sum = 0;
    foreach ($temp as $key => $value) {
        $w = pow(2, $key+1) % 11;
        $sum += $value * $w;
    }

    if ((12 - $sum % 11) % 11 != $check) {
        return false;
    }
    return true;
}
Checksum derivation process in R
> checkCode
function(ID) {
  stopifnot(length(grep('^[0-9]{17}$', ID)) != 0)
  code <- (12 - sum( (2^(17:1))%%11 * as.integer(strsplit(ID, split=NULL)[[1]]) )) %% 11
}
> print(checkCode('34262219840209049'))
[1] 10

Usage of identification

The identity card is the only acceptable legal document used to obtain resident permits or driving licenses, open bank accounts, register for mobile phone numbers, apply for tertiary education and technical college for mainland Chinese citizens, and is one of the acceptable legal documents used to buy train tickets and pass through security checkpoints within domestic terminals at airports in mainland China. Documentation is also required for marriages, household registrations and legal cases.

Recently, there have been more services that require the display of Resident Identity Cards, such as at Internet cafes and certain stores.

Police are required to inspect identification documents where:
 Criminal suspects need to be identified;
 To inspect those related to personnel involved in an incident;
 In the occurrence of a serious security emergency, and there is a requirement to obtain the identity of a person at the scene;
 If the law requires so during a case.

Anti-counterfeiting measures

First generation identity card
Polyester plastic film, which utilizes an anti-counterfeit laser logo.

Second generation identity card
Second-generation identity cards contain a non-contact IC chip card, a directional holographic "Great Wall" image, an anti-counterfeiting film made of green multi-layer polyester (PETG) composite material, optical variable optical storage containing the text "中国CHINA" situated on the card, and a microfilm string generating the letters "JMSFZ" (initials for the Pinyin of "Jumin Shenfenzheng"), and a "Great Wall" logo revealed by ultraviolet light.

Security and criticism
Unlike the biometric identity cards in EU countries which comply with ICAO standards, the second-generation ID card imposes older technologies similar to MIFARE used on public transportation systems, which, unlike its ICAO-compliant counterparts, lacks the proper encryption of personal data such as BAC control, thus making the information stored on the chip openly accessible to any ID card readers at a near enough distance. Strangely, the document's validity period is not recorded on the IC chip, therefore one can only tell the validity of the document by physically examining the dates printed on the back of the card. Also, because identity cards lacks a different numbering scheme from the citizen's identity number for Chinese nationals, there's currently no way to deregister a lost ID card completely even when the loss of the identity card is reported to the police. The above characteristics have made identity cards vulnerable to identification theft, which is overwhelmingly common in China, with stolen ID cards retailing for over 200 yuan each on the black market. Despite the criticism from public, Ministry of Public Security has yet to announce any changes apart from the addition of fingerprint data on the already-insecure chip. On 2019, Ministry of Public Security announced that they would move forward resigning fingerprint data

See also 
 Residence Permit for Hong Kong, Macao, and Taiwan Residents
 Taiwanese identity card
 Indian identity card
 Hong Kong identity card
 Macau identity card
 Singaporean identity card
 Identity document

References

External links 

 PRC Resident Identity Card law
 Identity law issues – XINHUA
 History of identification
 Concerns regarding second-generation cards
 Mobile phones, identity cards and individual positioning

Government of China
China
People's Republic of China society