19 bit; Y=1111 1000 0010 1101 11 01 01  22 bit; Z=01001 11 1010 0011 0000 1011




Download 2,29 Mb.
bet3/3
Sana09.07.2024
Hajmi2,29 Mb.
#267172
1   2   3
Bog'liq
Shoxzamon

01 110 19 bit;
Y=1111 1000 0010 1101 11 01 01  22 bit;
Z=01001 11 1010 0011 0000 1011 23 bit;
Majority m =maj(x8,y10,z10)=(0,1,0)=0;
1)X8=1 m ga teng o’zgarmaydi;
2) Y10=0 m ga teng o’zgarmaydi;
3)Z10=0m ga teng o’zgaradi:
tx=x13x16x17x18=0111=1;
ty=y20y21­;
tz=z7z20z21z22=1101=1;
KALIT  K=x18y21z22=011=0 K24=0;
25* * X=100 1110 0000 0010 01 11 19 bit;
Y=1111 1000 0010 1101 11 01 01  22 bit;
Z=101001 11 1010 0011 0000 101 23 bit;
Majority m =maj(x8,y10,z10)=(0,1,1)=1;
1)X8=0 m ga teng o’zgarmaydi;
2) Y10=1 m ga teng o’zgaradi;
3)Z10=1m ga teng o’zgaradi:
tx=x13x16x17x18;
ty=y20y21­=10=1;
tz=z7z20z21z22=1010=0;
KALIT- K=x18y21z22=111=1 K25=1;
26* * X=100 1110 0000 0010 01 11 19 bit;
Y=11111 1000 0010 1101 11 01 0  22 bit;
Z=0101 001 11 1010 0011 0000 10 23 bit;
Majority m =maj(x8,y10,z10)=(0,0,0)=0;
1)X8=0 m ga teng o’zgaradi;
2) Y10=0 m ga teng o’zgaradi;
3)Z10=0m ga teng o’zgaradi:
tx=x13x16x17x18=1011=1;

ty=y20y21­=01=1;


tz=z7z20z21z22=1001=0
KALIT- K=x18y21z22=100=1 K26=1;
27 * X=1100 1110 0000 0010 01 1 19 bit;
Y=1111 11 1000 0010 1101 11 01  22 bit;
Z=0010 1 001 11 1010 0011 0000 1 23 bit;

Majority m =maj(x8,y10,z10)=(0,0,1)=0;


1)X8=0 m ga teng o’zgaradi;
2) Y10=0 m ga teng o’zgaradi;
3)Z10=1m ga teng o’zgarmaydi:
tx=x13x16x17x18=0001=1;

ty=y20y21­=10=1;


KALIT- K=x18y21z22=111=1 K27=1;
28* * X=1 1100 1110 0000 0010 01 19 bit;
Y=1 1111 11 1000 0010 1101 11 0  22 bit;
Z=0010 1 001 11 1010 0011 0000 1 23 bit;
Majority m =maj(x8,y10,z10)=(0,0,1)=1;
1)X8=0 m ga teng o’zgaradi;
2) Y10=0 m ga teng o’zgaradi;
3)Z10=1m ga teng o’zgarmaydi:
tx=x13x16x17x18=0100=1;
ty=y20y21­=11=0;
//tz=z7z20z21z22=0100;
KALIT- K=x18y21z22=101=0 K28=0;
29* X=11 1100 1110 0000 0010 0 19 bit;
Y=01 1111 11 1000 0010 1101 11  22 bit;
Z=0010 1 001 11 1010 0011 0000 1 23 bit;
Majority m =maj(x8,y10,z10)=(1,0,1)=1;
1)X8=0 m ga teng o’zgaradi;
2) Y10=0 m ga teng o’zgarmaydi;
3)Z10=0m ga teng o’zgaradi:
tx=x13x16x17x18=0010=1;
ty=y20y21­=00; ///
tz=z7z20z21z22=1000=1;
KALIT- K=x18y21z22=011=0 K29=0;
30* * X=111 1100 1110 0000 0010 19 bit;
Y=01 1111 11 1000 0010 1101 11  22 bit;
Z=10010 1 001 11 1010 0011 0000 23 bit;
Majority m =maj(x8,y10,z10)=(1,0,1)=1;
1)X8=1 m ga teng o’zgaradi;
2) Y10=0 m ga teng o’zgarmaydi;
3)Z10=1m ga teng o’zgaradi:
tx=x13x16x17x18=0001=1;
tz=z7z20z21z22=0000=0;
KALIT- K=x18y21z22=010=0 K30=1;
SHIFR MATN :Abduqosimov CQDF!M
1)O—01110 01101= 00010 =C
2)D--0001110011= 10000 = Q
3)I--0010100110= 00011 = D
4)L--0101101110 = 00101 -- F
5)O--0111010101= 11011 = !
6)V--1010111001= 01100 = M

JAVOB : Abduqosimov ---->>>> CQDF!M



ODILOV ni shifrlaymiz A5/1 bo’yicha

#include


#define SIZEX 19
#define SIZEY 22
#define SIZEZ 23

int maj(int, int, int);

int main(){
int x[SIZEX] = {0,1,1,1,0,0,0,0,1,1,0,1,0,0,0,0,1,0,1};
int y[SIZEY] = {1,0,1,1,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,1,1,0};
int z[SIZEZ] = {1,0,0,0,0,1,0,1,1,0,1,1,1,0,1,0,1,0,1,1,1,0,1};

int i,j = 0;


int m;

printf("\n");


for(i = 0; i < 9; i++){
m = maj(x[8], y[10], z[10]);

printf("X: ");


if(x[8] == m){
int t = x[13] ^ x[16] ^ x[17] ^ x[18];
for(j = SIZEX-1 ; j >= 0; j--){
if(j == 0){
x[j] = t;
}else{
x[j] = x[j-1];
}
}
}

for(j = 0; j < SIZEX; j++){


printf("%d", x[j]);
}

printf("\nY: ");


if(y[10] == m){
int t = y[20] ^ y[21];
for(j = SIZEY-1 ; j >= 0; j--){
if(j == 0){
y[j] = t;
}else{
y[j] = y[j-1];
}
}
}
for(j = 0; j < SIZEY; j++){
printf("%d",y[j]);
}

printf("\nZ: ");


if(z[10] == m){
int t = z[7] ^ z[20] ^ z[21] ^ z[22];
for(j = SIZEZ-1 ; j >= 0; j--){
if(j == 0){
z[j] = t;
}else{
z[j] = z[j-1];
}
}
}
for(j = 0; j < SIZEZ; j++){
printf("%d",z[j]);
}

if(i < 8){


int key = x[SIZEX-1] ^ y[SIZEY-1] ^ z[SIZEZ-1];
printf("\nKluch biti = %d ^ %d ^ %d = %d",x[SIZEX-1],y[SIZEY-1],z[SIZEZ-1],key);
printf("\n\n");
}
}
}

int maj(int x, int y, int z){


int m;
if(x == 0){
if(y == 0 || z == 0){
m = 0;
}else{
m = 1;
}
}else{
if(y == 1 || z == 1){
m = 1;
}else{
m = 0;
}
}
return m;
}



Download 2,29 Mb.
1   2   3




Download 2,29 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa



19 bit; Y=1111 1000 0010 1101 11 01 01  22 bit; Z=01001 11 1010 0011 0000 1011

Download 2,29 Mb.