您的位置:首页 > 大数据 > 人工智能

实现playfair(多字母替代密码)加密与解密程序

2012-03-12 21:28 791 查看
 Playfair密码(英文:Playfair cipher 或 Playfair square)是一种替换密码,1854年由查尔斯·惠斯通(Charles Wheatstone)的英国人发明。经莱昂·普莱费尔提倡在英国军地和政府使用。 

  它有一些不太明显的特征:密文的字母数一定是偶数;任意两个同组的字母都不会相同,如果出现这种字符必是乱码和虚码。 

  它使用方便而且可以让频度分析法变成瞎子,在1854到1855年的克里米亚战争和1899年的布尔战争中有广泛应用。但在1915年的一战中被破译了。 

  编写分三步:1.编制密码表 2.整理明文 3.编写密文 构成部分:1.密钥 2.明文3.密文4.注明的某个字母代替的另一个字母

代码实现:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char playfair_table[5][5];
void CreateTable (char *in_key)
{
int i = 0, j, k;
int hash[26]={0};
char key[26] = {0};
int key_len;
strcpy (key, in_key);
key_len = strlen (key);
//一次遍历,处理密钥
while (1)
{
if (i == key_len)
break;
//转换成大写
if(key[i]>='a'&&key[i]<='z')
{
key[i]+='A'-'a';
}
//去除非法字符
if (!(key[i]<='Z'&&key[i]>='A'))
{
for (j = i; j < key_len - 1; ++j)
key[j] = key[j + 1];
key_len--;
continue;
}
if(key[i]=='J')
{
//I和J视为相同
key[i]='I';
}
if(hash[key[i]-'A']==0)
{
hash[key[i]-'A']=1;
}
else //去除重复
{
for (j = i; j < key_len - 1; ++j)
key[j] = key[j + 1];
key_len--;
continue;
}
i++;
}
//此时,密钥长度必然小于26,长度不够需补全
if(key_len<25)
{
for(i=0;i<26;i++)
{
if(key_len==25)
{
break;
}
if(i+'A'=='J')
continue;
if(hash[i]==0)
{
hash[i]=1;
key[key_len]=i+'A';
key_len++;
}
}
}
for (i = 0; i < 5;i++)
{
for (j = 0; j < 5; j++)
playfair_table[i][j] = key[5 * i + j];
}
}

void PrintTable ()
{
int i, j;
printf ("Playfair Table:\n");
for (i = 0; i < 5; ++i)
{
printf ("\t");
for (j = 0; j < 5; ++j)
{
printf ("%c ", playfair_table[i][j]);
}
puts("\n");
}

}

void GetPosition (char c, int *x, int *y)
{
int i, j;
if(c>='a')
{
c+=-'a'+'A';
}
for (i = 0; i < 5; ++i)
{
for (j = 0; j < 5; ++j)
{
if (playfair_table[i][j] == c)
{
*x = i; *y = j;
return;
}
}
}
}

char GetKey (int x, int y,char type)
{
if (x < 0)
x += 5;
if (y < 0)
y += 5;
if(type<'a')
{
return playfair_table[x % 5][y % 5];
}
else
{
return (playfair_table[x % 5][y % 5]+'a'-'A');
}
}

int Encrypt (char *input, char *output)
{
int length = strlen (input);
int i = 0, j=-1,find;
int ax, ay, bx, by;
int pair[2]={-1,-1};
//for(i=0;i<length;i++)
//{
//	if(input[i]>='A'&&input[i]<='Z')
//	{
//		input[i]-='A'-'a';//全部转化成小写
//	}
//}
while(1)
{
char between[1000]={0};
int betweenlength=-1;
find=0;
//找寻成对出现的第一个字符所在位置
for(i=pair[1]+1;i<length;i++)
{
if((input[i]>='a'&&input[i]<='z')||(input[i]>='A'&&input[i]<='Z'))
{
pair[0]=i;
pair[1]=i+1;
find=1;
break;
}
else
{
output[++j]=input[i];
}
}
if(find==0)
{
break;
}
//找寻成对出现的第二个字符所在位置
find=0;
for(i=pair[1];i<length;i++)
{
if((input[i]>='a'&&input[i]<='z')||(input[i]>='A'&&input[i]<='Z'))
{
pair[1]=i;
find=1;
break;
}
else
{
between[++betweenlength]=input[i];
}
}
if(find==0)
{
input[length]='Q';//代表最后一位的填充
pair[1]=length;
length++;
}
//开始加密过程
if(input[pair[1]]==input[pair[0]])
{
if(input[pair[0]]!='X')//放置连续的xx影响结果
{
//属于相同对中的重复的明文字母将用一个填充字母进行分隔(如x)
for(i=length;i>=pair[1];i--)
{
input[i+1]=input[i];
}
length++;
input[pair[1]]='X';
}
}
GetPosition(input[pair[0]],&ax,&ay);
GetPosition(input[pair[1]],&bx,&by);
//若p1 p2在同一行,对应密文c1 c2分别是紧靠p1 p2 右端的字母。其中第一列被看做是最后一列的右方。
if(ax==bx)
{
output[++j]=GetKey(ax,ay+1,input[pair[0]]);
for(i=0;i<=betweenlength;i++)
{
output[++j]=between[i];
}
output[++j]=GetKey(bx,by+1,input[pair[1]]);
}
//若p1 p2在同一列,对应密文c1 c2分别是紧靠p1 p2 下方的字母。其中第一行被看做是最后一行的下方。
else if(ay==by)
{
output[++j]=GetKey(ax+1,ay,input[pair[0]]);
for(i=0;i<=betweenlength;i++)
{
output[++j]=between[i];
}
output[++j]=GetKey(bx+1,by,input[pair[1]]);
}
//若p1 p2不在同一行,不在同一列,则c1 c2是由p1 p2确定的矩形的其他两角的字母,并且c1和p1, c2和p2同行。
else
{
output[++j]=GetKey(ax,by,input[pair[0]]);
for(i=0;i<=betweenlength;i++)
{
output[++j]=between[i];
}
output[++j]=GetKey(bx,ay,input[pair[1]]);
}
}
return length;
}

int Decrypt (char *input, char *output)
{
int length = strlen (input);
int i = 0, j=-1,find;
int ax, ay, bx, by;
int pair[2]={-1,-1};
while(1)
{
char between[1000]={0};
int betweenlength=-1;
find=0;
//找寻成对出现的第一个字符所在位置
for(i=pair[1]+1;i<length;i++)
{
if((input[i]>='a'&&input[i]<='z')||(input[i]>='A'&&input[i]<='Z'))
{
pair[0]=i;
pair[1]=i+1;
find=1;
break;
}
else
{
output[++j]=input[i];
}
}
if(find==0)
{
break;
}
//找寻成对出现的第二个字符所在位置
find=0;
for(i=pair[1];i<length;i++)
{
if((input[i]>='a'&&input[i]<='z')||(input[i]>='A'&&input[i]<='Z'))
{
pair[1]=i;
find=1;
break;
}
else
{
between[++betweenlength]=input[i];
}
}
if(find==0)
{
input[length]='Q';//代表最后一位的填充
pair[1]=length;
length++;
}
//开始解密过程
//if(input[pair[1]]==input[pair[0]])
//{
//	if(input[pair[0]]!='x')//放置连续的xx影响结果
//	{
//		//属于相同对中的重复的明文字母将用一个填充字母进行分隔(如x)
//		for(i=length;i>=pair[1];i--)
//		{
//			input[i+1]=input[i];
//		}
//		length++;
//		input[pair[1]]='x';
//	}
//}
GetPosition(input[pair[0]],&ax,&ay);
GetPosition(input[pair[1]],&bx,&by);
//若p1 p2在同一行,对应密文c1 c2分别是紧靠p1 p2 右端的字母。其中第一列被看做是最后一列的右方。
if(ax==bx)
{
output[++j]=GetKey(ax,ay-1,input[pair[0]]);
for(i=0;i<=betweenlength;i++)
{
output[++j]=between[i];
}
output[++j]=GetKey(bx,by-1,input[pair[1]]);
}
//若p1 p2在同一列,对应密文c1 c2分别是紧靠p1 p2 下方的字母。其中第一行被看做是最后一行的下方。
else if(ay==by)
{
output[++j]=GetKey(ax-1,ay,input[pair[0]]);
for(i=0;i<=betweenlength;i++)
{
output[++j]=between[i];
}
output[++j]=GetKey(bx-1,by,input[pair[1]]);
}
//若p1 p2不在同一行,不在同一列,则c1 c2是由p1 p2确定的矩形的其他两角的字母,并且c1和p1, c2和p2同行。
else
{
output[++j]=GetKey(ax,by,input[pair[0]]);
for(i=0;i<=betweenlength;i++)
{
output[++j]=between[i];
}
output[++j]=GetKey(bx,ay,input[pair[1]]);
}
}
for(i=1;output[i]!='\0';i++)
{
if(output[i]=='X')
{
int m=0,s=-1,e=-1;
for(m=i-1;m>=0;m--)
{
if((output[m]>='a'&&output[m]<='z')||(output[m]>='A'&&output[m]<='Z'))
{
s=m;
break;
}
}
for(m=i+1;output[m]!='\0';m++)
{
if((output[m]>='a'&&output[m]<='z')||(output[m]>='A'&&output[m]<='Z'))
{
e=m;
break;
}
}
if(s!=-1&&e!=-1&&(output[s]==output[e]||output[s]-output[e]=='A'-'a'||output[s]-output[e]=='a'-'A'))
{
for(m=i;output[m]!='\0';m++)
{
output[m]=output[m+1];
}
}
}
}
if(output[i-1]=='Q')//去除最后一位填充
{
output[i-1]='\0';
}
return length;
}

char inputstr[10000],yuanstr[10000],outputstr[20000],returnstr[20000];

int main ()
{
char key[26] = {0},c;
int si=0;
memset(outputstr,0,sizeof(outputstr));
memset(inputstr,0,sizeof(inputstr));
memset(returnstr,0,sizeof(returnstr));
printf ("输入密钥内容(i,j视为相同):");
scanf ("%s", key);
CreateTable (key);
PrintTable ();
FILE *fp1,*fp2;
if ((fp1=fopen("input.txt", "r")) ==NULL )
{
printf("cannot open file\n");
exit(0);
}
if ((fp2=fopen("output.txt", "w+")) ==NULL )
{
printf("cannot write file\n");
exit(0);
}
while(fscanf(fp1,"%c",&c)!=EOF)
{
yuanstr[si]=c;
si++;
}
memcpy(inputstr,yuanstr,10000);
fprintf (fp2,"原文内容:\n%s\n", inputstr);
Encrypt (inputstr, outputstr);
fprintf (fp2,"加密后内容:\n%s\n", outputstr);
Decrypt (outputstr, returnstr);
fprintf (fp2,"解密后内容:\n%s\n", returnstr);

int in[26]={0},out[26]={0},ret[26]={0};
int i,in_count,out_count,ret_count;
for(i=0;yuanstr[i]!='\0';i++)
{
if(yuanstr[i]>='A'&&yuanstr[i]<='Z')
{
in[yuanstr[i]-'A']+=1;
}
else if(yuanstr[i]>='a'&&yuanstr[i]<='z')
{
in[yuanstr[i]-'a']+=1;
}
}
in_count=i;
for(i=0;outputstr[i]!='\0';i++)
{
if(outputstr[i]>='A'&&outputstr[i]<='Z')
{
out[outputstr[i]-'A']+=1;
}
else if(outputstr[i]>='a'&&outputstr[i]<='z')
{
out[outputstr[i]-'a']+=1;
}
}
out_count=i;
for(i=0;returnstr[i]!='\0';i++)
{
if(returnstr[i]>='A'&&returnstr[i]<='Z')
{
ret[returnstr[i]-'A']+=1;
}
else if(returnstr[i]>='a'&&returnstr[i]<='z')
{
ret[returnstr[i]-'a']+=1;
}
}
ret_count=i;
fprintf(fp2,"统计信息:\n");
fprintf(fp2,"%6s","数据源");
fprintf(fp2,"%6s","英文字符");
for(i=0;i<26;i++)
{
fprintf(fp2," --%c--",'a'+i);
}
fprintf(fp2,"\n");
fprintf(fp2,"%6s","加密前");
fprintf(fp2,"%6d",in_count);
for(i=0;i<26;i++)
{
fprintf(fp2,"%5.2f%%",100.0*in[i]/in_count);
}
fprintf(fp2,"\n");
fprintf(fp2,"%6s","加密后");
fprintf(fp2,"%6d",out_count);
for(i=0;i<26;i++)
{
fprintf(fp2,"%5.2f%%",100.0*out[i]/out_count);
}
fprintf(fp2,"\n");
fprintf(fp2,"%6s","解密后");
fprintf(fp2,"%6d",ret_count);
for(i=0;i<26;i++)
{
fprintf(fp2,"%5.2f%%",100.0*ret[i]/ret_count);
}
fprintf(fp2,"\n");
return 0;
}


测试数据:

China amends law for human rights protection
(People's Daily Overseas Edition)
试一试
17:10, March 12, 2012
Edited and translated by People's Daily Online

Human rights protection was written into the Constitution in 2004, which attracted widespread attention. Eight years later, The National People’s Congress amends the Criminal Procedure Law and once again highlights the principle of protecting human rights.

The criminal litigation system closely relates with citizens' personal freedom and other fundamental rights. Writing human rights protection into the law can not only show the socialist nature of China's judicial system, but also better follow the principle of respecting and protecting human rights in criminal proceedings.

The human rights legal system of socialism with Chinese characteristics should provide comprehensive and systematic legal guarantees for respecting and safeguarding human rights, serving people's livelihood and protecting the legitimate rights and interests of citizens.

China's constitution has not only clearly defined the basic principle of "the state respects and safeguards human rights" but also provided more than 20 fundamental rights. China's laws, including the constitution, civil law, commercial law, administrative law, economic law and social law, specify citizens' political rights, economic rights, social rights, cultural rights and other human rights from different angles and at different levels to ensure that citizens enjoy extensive, actual and universal human rights and fundamental freedoms through law and system. Now, "to respect and protect human rights" has been written into the Code of Criminal Procedure, which makes the legal protection of human rights even more solid and perfect.

The legal system of socialism with Chinese characteristics should put people first. In a people-oriented law, rule of law is not the measure of control but a lifestyle shared by all the people. No matter in the process of legislation or in the specific provisions, a country should adhere to the principle of keep "people-oriented".

Law has been and will continue to be the main regulator of modern social relations. Laws are made to maintain social stability, safeguard and promote social development. And laws are the synonym of fairness and justice, which makes the realization of rule of law a process of recognizing and protecting human rights. Rule of law is always centered on protection of human rights.

Writing human rights protection into the law should clarify what are human rights first. The concept of “human right” proposed during the bourgeois revolution period in the 17th century and 18th century was mainly used to fight against the feudal theocracy, monarchical power and aristocratic privilege.

After the World War II, the Charter of the United Nations learned the painful lesson from the fact that fascists trampled human rights, began to emphasize the protection of human rights, then issued a Universal Declaration of Human Rights later and developed International Covenant on Civil and Political Rights and the International Covenant on Economic Social and Cultural Rights, reflecting the international demands for the protection of human rights.

In the past half a century, the concept of human rights is also expanding with great political and economic changes in the world, for example, the human right values of the developing countries now pays more attention to right to subsistence, right to development and environmental right while continuing to emphasize the traditional protection of human rights.

Therefore, only by fully establishing the socialist rule of law, taking democracy, freedom, human rights, fairness, justice, rule by law, administration according to the law, impartial administration of justice, equality before the law, the openness, stability, and authority of the law, law of non- retroactivity and no crime without a law as the principles of socialist rule of law, cultivating culture of socialist rule of law and improving the legal awareness of the whole people, can "write human rights into the law" be truly implemented.
x


程序输出:

原文内容:
China amends law for human rights protection (People's Daily Overseas Edition) 试一试 17:10, March 12, 2012 Edited and translated by People's Daily Online Human rights protection was written into the Constitution in 2004, which attracted widespread attention. Eight years later, The National People’s Congress amends the Criminal Procedure Law and once again highlights the principle of protecting human rights. The criminal litigation system closely relates with citizens' personal freedom and other fundamental rights. Writing human rights protection into the law can not only show the socialist nature of China's judicial system, but also better follow the principle of respecting and protecting human rights in criminal proceedings. The human rights legal system of socialism with Chinese characteristics should provide comprehensive and systematic legal guarantees for respecting and safeguarding human rights, serving people's livelihood and protecting the legitimate rights and interests of citizens. China's constitution has not only clearly defined the basic principle of "the state respects and safeguards human rights" but also provided more than 20 fundamental rights. China's laws, including the constitution, civil law, commercial law, administrative law, economic law and social law, specify citizens' political rights, economic rights, social rights, cultural rights and other human rights from different angles and at different levels to ensure that citizens enjoy extensive, actual and universal human rights and fundamental freedoms through law and system. Now, "to respect and protect human rights" has been written into the Code of Criminal Procedure, which makes the legal protection of human rights even more solid and perfect. The legal system of socialism with Chinese characteristics should put people first. In a people-oriented law, rule of law is not the measure of control but a lifestyle shared by all the people. No matter in the process of legislation or in the specific provisions, a country should adhere to the principle of keep "people-oriented". Law has been and will continue to be the main regulator of modern social relations. Laws are made to maintain social stability, safeguard and promote social development. And laws are the synonym of fairness and justice, which makes the realization of rule of law a process of recognizing and protecting human rights. Rule of law is always centered on protection of human rights. Writing human rights protection into the law should clarify what are human rights first. The concept of “human right” proposed during the bourgeois revolution period in the 17th century and 18th century was mainly used to fight against the feudal theocracy, monarchical power and aristocratic privilege. After the World War II, the Charter of the United Nations learned the painful lesson from the fact that fascists trampled human rights, began to emphasize the protection of human rights, then issued a Universal Declaration of Human Rights later and developed International Covenant on Civil and Political Rights and the International Covenant on Economic Social and Cultural Rights, reflecting the international demands for the protection of human rights. In the past half a century, the concept of human rights is also expanding with great political and economic changes in the world, for example, the human right values of the developing countries now pays more attention to right to subsistence, right to development and environmental right while continuing to emphasize the traditional protection of human rights. Therefore, only by fully establishing the socialist rule of law, taking democracy, freedom, human rights, fairness, justice, rule by law, administration according to the law, impartial administration of justice, equality before the law, the openness, stability, and authority of the law, law of non- retroactivity and no crime without a law as the principles of socialist rule of law, cultivating culture of socialist rule of law and improving the legal awareness of the whole people, can "write human rights into the law" be truly implemented. x
加密后内容:
Dbkif Aslhkcd qfx ept bzlsm tmbnzv rtpphdoouk
(Tbpqkg'v Cskmu Rekygfvv Gcnonti)
试一试
17:10, Lsosb 12, 2012
Fcnphc sth otdlamdqhv gu Wkpqkf'd Cclmx Timkkh

Bzlsm tmbnzv rtpphdoouk zsd ypnophi ktzp obf Bumdonozonti ki 2004, zeobf dqZotsvphv zncgvqtfvc sqZphtzouk. Hmbnz wgsqa mdqgp, Znh Kdqouldk Qbpqkg’v BumhpgaYd skgthd rbf Soknkifq Qtubhvyof Kvx dlc tidf vfski bnhbmkhbrd znk womidkokf qb qtpobvonmh bzlsm tmbnzd.

Rbf soknkifq mkonfsonti gsdrgk aircfks yfkdqgv ukzn boonwhmd' wkygtifq gqfWhvri dlc tzngp bxthslhkqdm qmbnzv. Yomonmh bzlsm tmbnzv rtpphdooui ktzp obf qfu vdl ito pims gbtz pbf crbofqmcz tdqyob pb Abnld'd szcoblcm asgphi, gzo fqcr efqZphq gqiiqz pbf qtkiboqkb pg qgvwkdokif sth qtpobvonmh bzlsm tmbnzc mi domnkldk qtpvbhvkimg.

Znf byidl omhbrd kffsm asgphi rg aublcmkgr ukzn Dbkigvb vfdqsdogpmconvd dgucna qtpcncb vriqtfbhkcmek dlc dsgphlsona ifhfq bysqdlphgv bqq Ypgvrbvonmh dlc dflfhxctskih byidl omhbrd, vgpskie rbpqkg'v mkekmkbttc dlv ttpphdokih rbf kfbmonlsph omhbrd dlc ntzgpgvrd qb boonwhmd.

Dbkis'd bumdonozonti fdd mpo timx aifvqmz sfgkihv znf esdob qtkiboqkb ph "qbf drdqg pgvwkdod sth dsgfbysqcd bzlsm tmbnzc" gzo fqcr qtpcnchv irpg zndl 20 bxthslhkqdm qmbnzd. Vbnld'a mvxc, midixcnmh znb vtidrnozooui, dkckm qfu, vrikgoslcq Aqfx, vsnkimcotdqkcf kvx, bvtiriob qfx vth crbofq qfy, vwkbogx boonwhmd' qpmkonvsm qmbnzv, gbuitnks ombnza, Ycrbofq omhbrd, bcnqyofq omhbrd dlc tzngp bzlsm tmbnza gtpn slbgfpgtz dlfmgv dlc sz hlbgfpgtz kfekma op hkcypg zndq boonwhmd hkbpw gzqhkcmek, svozfq dlc zikekygfq bzlsm tmbnzd sth bxthslhkqdq lpghvrid rgtuchb qfx vth gsdrgk. Itz, "pp tgvwkdo dlv ttpphdo bzlsm tmbnzd" gsd efhk ypnophi ktzp obf Buvh qb Soknkifq Qtubhvyok, vbndb lspkd rbf kffsk qtpphdooui tg byidl omhbrd kehk irpg crmkc sth wkqgbvo.

Obf kffsm asgphi rg aublcmkgr ukzn Dbkigvb vfdqsdogpmconvd dgucna owo qbpqkf gmodr. Ki v qbpqkb-pomhkpha nvx, oykf qb qfu kd mpo zng kfvcypg qb butztpi fzo f qlbgvrzkf dgsqhv gu fqn qbf wkpqkf. It lsqZpho mt zbf qtubgvc rl qfhmcqfonti pt ki zng vwkboblv otpckcmtid, s buziots gbtxic shngph pp obf qtkiboqkb pe lfWkw "wkpqkf-ptkbtzhv".

Qfz esd efhk dlv zkmi ationizh pu ih pbf lski pgbyqfopt pg ltcgpm dublcm qfkdqoumd. Qfyv sqg ksch pr icltzclm dublcm aqdiomkrz, dsgfbysqc sth qtripog vublcn akefkpqkgtz. Dla nvxd spg zng vzmtisr qb lfmokhaYd sth izdrobk, vbndb lspkd rbf pgfqnudqoui tg qxib pl qvx v qtpvbaYc rg qbvrbikunmh dlv ttpphdokih byidl omhbrd. Oykf qb qfu kd skxsxd vhkphpgc tk ttpphdooui tg byidl omhbrd.

Ypnokih byidl omhbrd qtpobvonti kiop znf kvx dgucna aisqlbz xfdq dpg bzlsm tmbnza gmodr. Znb vtivbqo qb “bzlsm tmbnz” qtpqrchv czommh znf eucymbpmc pgcpixonti wkomtc ki znh 17pb dhkozys dlh 18zb dhkozys xvg rclimz wvgh zq bmbnz sfclmdq Zznf gbwcsn qbfubqssu, irldosbnvsk qpugp dlc somdrubqsonv oomckkfhf.

Flpht obf Upqmv Zsq LUN, obf Dbsqpht ph qbf Zinohv Ldontia mfvtmhv znk wcllhxi kfaYcrl htpn rbf lfdo zndq lfdvmcrd otslqkhv bzlsm tmbnzc, gfhdl op gktesdnuh pbf qtpobvonti qb bzlsm tmbnzd, rbfi kaYcyhv c Xikekygfq Vhaisqdqoui tg Byidl Omhbrd qfphq sth vhekiqwkc Ntzgpldontifq Buekldtz ti Bockq fth Qpmkonvsm Qmbnzd sth znb Ktzgpldontifq Buekldtz ti Bvtiriob Crbofq dlc Vxiozqsm Qmbnzg, yfgkfdokih rbf kiphtmdqouldn agkdlcd bqt obf qtpobvonti qb bzlsm tmbnzc.

Mt zbf qvdr fdql s vhkozys, znb vtivbqo qb bzlsm tmbnzc md smap bwqdlcnmh ukzn myfvo qqinoobfq dlv hbuitnka Udbdlhfc mt zbf upqma, hpt fwslqkh, pbf bzlsm tmbnz asixgv qb znh vkefkpqkib suctzomgv itv wsxg rptf vqZphtzout zp tmbnz op cygcmcphidg, pmbnz op vhekiqrkhkq dth hkcktpinhkqdm qmbnz zekmb vtionizkih rp bkrfdcmwh znh pqscnontifq qtpobvonti qb bzlsm tmbnzd.

Rbfpgbqpg, timx gu bxqAmx gvqdfimcbnmh zng vublcmkdr oykf qb qfz, pvlkih sgkubqssu, gqfWhvri, bzlsm tmbnza, gcltmgvd, dyconvb, oykf gu qfx, vsnkimcotdqoul daUbutskih rp obf qfu, kkrsqonfq scnkikdrqsonti qb ucdrobf, Wfpxcmkrz efbqpg znf kvx, znb pwklZkhaYa, Ydrcfkmnox, sth cxznptnou rh qbf qfx, kvx qb itm- thptpsvonckrz dlh tu bomkg ukznucq d qfx vd rbf qtkiboqkgv qb crbofqmco txib pl qvx, bcnqkcdqkib sxiozpg qb crbofqmco txib pl qvx dlc nkrtpckmh znf kfhfq vxsqhkgvc rh qbf zeqik wbpqkb, vdl "ypnof byidl omhbrd kiop znf kvx" ef otxiu mkrkfkgtzhv.
aX
解密后内容:
China amends law for human rights protection
(People's Daily Overseas Edition)
试一试
17:10, March 12, 2012
Edited and translated by People's Daily Online

Human rights protection was written into the Constitution in 2004, which attracted widespread attention. Eight years later, The National People’s Congress amends the Criminal Procedure Law and once again highlights the principle of protecting human rights.

The criminal litigation system closely relates with citizens' personal freedom and other fundamental rights. Writing human rights protection into the law can not only show the socialist nature of China's audicial system, but also better follow the principle of respecting and protecting human rights in criminal proceedings.

The human rights legal system of socialism with Chinese characteristics should provide comprehensive and systematic legal guarantees for respecting and safeguarding human rights, serving people's livelihood and protecting the legitimate rights and interests of citizens.

China's constitution has not only clearly defined the basic principle of "the state respects and safeguards human rights" but also provided more than 20 fundamental rights. China's laws, including the constitution, civil law, commercial law, administrative law, economic law and social law, specify citizens' political rights, economic rights, social rights, cultural rights and other human rights from different angles and at different levels to ensure that citizens eneoy extensive, actual and universal human rights and fundamental freedoms through law and system. Now, "to respect and protect human rights" has been written into the Code of Criminal Procedure, which makes the legal protection of human rights even more solid and perfect.

The legal system of socialism with Chinese characteristics should put people first. In a people-oriented law, rule of law is not the measure of control but a lifestyle shared by all the people. No matter in the process of legislation or in the specific provisions, a country should adhere to the principle of keep "people-oriented".

Law has been and will continue to be the main regulator of modern social relations. Laws are made to maintain social stability, safeguard and promote social development. And laws are the synonym of fairness and nustice, which makes the realization of rule of law a process of recognizing and protecting human rights. Rule of law is always centered on protection of human rights.

Writing human rights protection into the law should clarify what are human rights first. The concept of “human right” proposed during the bourgeois revolution period in the 17th century and 18th century was mainly used to fight against the feudal theocracy, monarchical power and aristocratic privilege.

After the World War II, the Charter of the United Nations learned the painful lesson from the fact that fascists trampled human rights, began to emphasize the protection of human rights, then issued a Universal Declaration of Human Rights later and developed International Covenant on Civil and Political Rights and the International Covenant on Economic Social and Cultural Rights, reflecting the international demands for the protection of human rights.

In the past half a century, the concept of human rights is also expanding with great political and economic changes in the world, for example, the human right values of the developing countries now pays more attention to right to subsistence, right to development and environmental right while continuing to emphasize the traditional protection of human rights.

Therefore, only by fully establishing the socialist rule of law, taking democracy, freedom, human rights, fairness, sustice, rule by law, administration according to the law, impartial administration of oustice, equality before the law, the openness, stability, and authority of the law, law of non- retroactivity and no crime without a law as the principles of socialist rule of law, cultivating culture of socialist rule of law and improving the legal awareness of the whole people, can "write human rights into the law" be truly implemented.
x
统计信息:
数据源英文字符 --a-- --b-- --c-- --d-- --e-- --f-- --g-- --h-- --i-- --j-- --k-- --l-- --m-- --n-- --o-- --p-- --q-- --r-- --s-- --t-- --u-- --v-- --w-- --x-- --y-- --z--
加密前 4151 6.77% 0.48% 3.44% 2.55% 8.38% 1.88% 2.14% 4.26% 7.13% 0.12% 0.10% 4.38% 2.14% 6.41% 5.78% 2.14% 0.02% 5.03% 4.89% 7.90% 2.29% 0.67% 1.40% 0.10% 0.96% 0.19%
加密后 4178 1.08% 6.27% 2.99% 4.64% 0.69% 4.12% 3.16% 3.85% 3.57% 0.00% 5.17% 2.82% 4.09% 3.73% 4.74% 3.93% 5.07% 2.18% 3.14% 4.33% 1.80% 3.35% 0.81% 1.22% 1.24% 3.71%
解密后 4151 6.79% 0.48% 3.44% 2.55% 8.41% 1.88% 2.14% 4.26% 7.13% 0.00% 0.10% 4.38% 2.14% 6.43% 5.81% 2.14% 0.02% 5.03% 4.91% 7.90% 2.29% 0.67% 1.40% 0.10% 0.96% 0.19%


结果分析:差异原因是将j直接转换成为i
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: