Permalink
Checking mergeability…
Don’t worry, you can still create the pull request.
Comparing changes
Open a pull request
- 1 commit
- 6 files changed
- 0 commit comments
- 1 contributor
Unified
Split
Showing
with
134 additions
and 0 deletions.
- BIN add_table
- +41 −0 add_table.c
- BIN decode
- +36 −0 decode.c
- +56 −0 keylog.txt
- +1 −0 table
Binary file not shown.
| @@ -0,0 +1,41 @@ | |||
| #include <stdio.h> | |||
| #include <stdlib.h> | |||
| #include "string.h" | |||
|
|
|||
| char indx(char lettre, char* tab,int N){ | |||
| for (int i=0;i<N;i++){ | |||
| if(lettre==tab[i]) | |||
| return i; | |||
| } | |||
| return -30; | |||
| } | |||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
| int main(int argc, char ** argv){ | |||
| //char * text="abaq ke vf"; | |||
| int taille=strlen(argv[1]); | |||
| char * text_cryp=malloc(taille*sizeof(char)); | |||
| char * text_decryp=malloc(taille*sizeof(char)); | |||
| text_cryp=argv[1];//text; | |||
| int N=63; | |||
| char * tab=malloc(N*sizeof(char)); | |||
| FILE * file; | |||
| file=fopen("table","r+"); | |||
| fread(tab,1,N,file); | |||
| fclose(file); | |||
| //printf("------------------\n"); | |||
| //printf("%s\n",tab); | |||
| for(int i=0;i<taille;i++){ | |||
| text_decryp[i]=indx(text_cryp[i],tab,N)+65; | |||
| } | |||
| printf("------------------\n"); | |||
| printf("%s\n",text_decryp); | |||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
| } | |||
Binary file not shown.
| @@ -0,0 +1,36 @@ | |||
| #include <stdio.h> | |||
| #include <stdlib.h> | |||
| #include "string.h" | |||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
| int main(int argc, char ** argv){ | |||
|
|
|||
| //char * text_cryp=malloc(strlen(argv[1])*sizeof(char)); | |||
| //text_cryp=argv[1]; | |||
| int N=110-65+1; | |||
| char * tab=malloc(N*sizeof(char)); | |||
| //tab[0]='A';tab[1]='V';tab[2]='X';tab[3]='S';tab[4]='E',tab[5];tab[6] | |||
| int i=0; | |||
| int print; | |||
| FILE * file; | |||
| file=fopen("table","r+"); | |||
| fseek( file, 46, SEEK_SET ); | |||
| while(i<N){ | |||
| print=i+65+46; | |||
| printf("%c: ",print); | |||
| scanf("%s",tab+i); | |||
| i++; | |||
| } | |||
| fwrite(tab,1,N-46,file); | |||
| fclose(file); | |||
| printf("------------------\n"); | |||
| printf("%s\n",tab); | |||
|
|
|||
| } | |||
| @@ -0,0 +1,56 @@ | |||
| les majuscules se correspondent également | |||
|
|
|||
| numbers ok | |||
| a-a | |||
| b-v | |||
| v-c | |||
| c-x | |||
| x-w | |||
| w-* | |||
| *-* | |||
| z-zk | |||
| e-e | |||
| r-r | |||
| d-s | |||
| s-q | |||
| q-. | |||
| .-? | |||
| ,-n | |||
| n-b | |||
| t-t | |||
| y-y | |||
| u-u | |||
| i-i | |||
| o-o | |||
| p-p | |||
| f-d | |||
| g-f | |||
| h-g | |||
| j-h | |||
| k-j | |||
| l-k | |||
| m-l | |||
| ù-m | |||
| :-; | |||
| <-ĉ | |||
| =-= | |||
| ;-, | |||
| @-@ | |||
| [-[ | |||
| ^-Ђ | |||
| _-_ | |||
| '-' | |||
| {-{ | |||
| }-} | |||
| |-| | |||
| ~-~ | |||
| (- | |||
| )- | |||
| "-" | |||
| &-& | |||
| +-+ | |||
| \-\ | |||
| #-# | |||
| $-$ | |||
| %-M | |||
| !-: | |||
| @@ -0,0 +1 @@ | |||
| AVXSEDFGIHJKLBOP.RQTUC*WYZ[\]=_'avxsedfgihjklbop.rqtuc*wyz{|}~ | |||