-
Notifications
You must be signed in to change notification settings - Fork 0
/
kice.h
53 lines (42 loc) · 1.38 KB
/
kice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef SCRYPT_HEADER_KLEVH
#define SCRYPT_HEADER_KLEVH
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "file.h"
#define SIZE 96
#define FIRSTCHAR 31
#define LASTCHAR 126
#define DBG(i,j) printf("%d - %d\n",i,j)
/* ------------------------------------------------------
* decypher
*/
/*decypher file using both keys*/
void decypher(char* key,char* keyTab,char * from, char * to);
/*apply the decypher with c*/
void applyDecypher(char * text,char ch,unsigned char* tab,int idLast);
/* ------------------------------------------------------ */
/* ------------------------------------------------------
* cypher
*/
/*cypher text using both keys*/
void cypher(char* key, char* keyTab,char * from, char * to);
/*apply the cypher with c*/
void applyCypher(char * text,char c,unsigned char* tab);
/* ------------------------------------------------------ */
/* ------------------------------------------------------
* tab
*/
/*generate the shuffled ascii tab acording to the key*/
unsigned char* generateTab(char* key);
/*apply one shuffle to tab using c*/
void shuffle(unsigned char *tab,char c);
/*find c in tab*/
int find(unsigned char *tab,char c);
/* ------------------------------------------------------ */
/* ------------------------------------------------------
* Utilitaires
*/
void reverse(char * texte);
/* ------------------------------------------------------ */
#endif