-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcracker.h
65 lines (47 loc) · 1.32 KB
/
cracker.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
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef CRACKER_H__
#define CRACKER_H__
/*
* This module coordinate all the analysis modules to crack a Vigenère cipher.
* Namely, it curently uses:
* - Multi-frequency-analysis
* - Kasiski analysis
*
* And will use:
* - Friedman test
* - Index of coincidence analysis
* - Wordlist attack
* - Autocorrelation (with or without a FFT)
* - Fourier Transform variation for text
*
* This module's API (will) also give access various statistics about the text
* being cracked.
*/
#include <sys/types.h>
#include "filtered_string.h"
#include "mfreq_analysis.h"
#include "kasiski.h"
struct cracker {
const struct fs_ctx *str;
size_t klen;
char *key;
/* Argument to be given to ka_init */
size_t ka_minlen;
struct kasiski ka;
int ka_done;
struct mfreq mfa;
int mfa_done;
};
/*
* Initialize a struct cracker. */
void ck_init(struct cracker *state, struct fs_ctx *str);
/* Free everything one of the ck_* function allocated. */
void ck_fini(struct cracker *state);
/* Set the key length. */
void ck_set_length(struct cracker *state, size_t len);
/* Crack the key length. */
void ck_length(struct cracker *state);
/* Crack the password using frequency analysis. */
void ck_freq(struct cracker *state);
/* Crack the Vigenère cipher using all the implemented techniques. */
void ck_crack(struct cracker *state);
#endif