Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_crypto.h
Go to the documentation of this file.
1
9#ifndef __N_CRYPTO_H
10#define __N_CRYPTO_H
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
21#include <stdlib.h>
22#include <memory.h>
23#include "nilorea/n_str.h"
24
26#define n_mathmod(__a, __b) ((__a % __b + __b) % __b)
27
28N_STR* n_vigenere_get_rootkey(size_t rootkey_size);
29N_STR* n_vigenere_get_question(size_t question_size);
30N_STR* n_vigenere_get_answer(N_STR* root_key, N_STR* question);
33N_STR* n_vigenere_quick_encode(N_STR* decoded_question);
34N_STR* n_vigenere_quick_decode(N_STR* encoded_question);
35N_STR* n_vigenere_encode_qa(N_STR* input_data, N_STR* question, N_STR* answer);
36N_STR* n_vigenere_decode_qa(N_STR* input_data, N_STR* question, N_STR* answer);
37int n_vigenere_encode_file(N_STR* in, N_STR* out, N_STR* rootkey);
38int n_vigenere_decode_file(N_STR* in, N_STR* out, N_STR* rootkey);
39int n_vigenere_decode_file_qa(N_STR* in, N_STR* out, N_STR* question, N_STR* answer);
40int n_vigenere_encode_file_qa(N_STR* in, N_STR* out, N_STR* question, N_STR* answer);
41
46#ifdef __cplusplus
47}
48#endif
49/* #ifndef __N_CRYPTO_H */
50#endif
char * key
N_STR * n_vigenere_encode_qa(N_STR *input_data, N_STR *question, N_STR *answer)
directly vigenere encode a file using key
Definition n_crypto.c:656
int n_vigenere_decode_file_qa(N_STR *in, N_STR *out, N_STR *question, N_STR *answer)
directly vigenere decode a file using question and answer
Definition n_crypto.c:734
N_STR * n_vigenere_quick_encode(N_STR *decoded_question)
quick encode data
Definition n_crypto.c:446
N_STR * n_vigenere_decode(N_STR *string, N_STR *key)
decode input using vigenere cypher and key
Definition n_crypto.c:417
N_STR * n_vigenere_get_answer(N_STR *root_key, N_STR *question)
get an answer from a root key and a question
Definition n_crypto.c:535
int n_vigenere_encode_file_qa(N_STR *in, N_STR *out, N_STR *question, N_STR *answer)
directly vigenere encode a file using question and answer
Definition n_crypto.c:763
N_STR * n_vigenere_decode_qa(N_STR *input_data, N_STR *question, N_STR *answer)
directly vigenere decode a file using key
Definition n_crypto.c:691
N_STR * n_vigenere_encode(N_STR *string, N_STR *key)
encode input using vigenere cypher and key
Definition n_crypto.c:407
int n_vigenere_encode_file(N_STR *in, N_STR *out, N_STR *rootkey)
directly vigenere encode a file using key
Definition n_crypto.c:571
int n_vigenere_decode_file(N_STR *in, N_STR *out, N_STR *rootkey)
directly vigenere decode a file using key
Definition n_crypto.c:614
N_STR * n_vigenere_get_rootkey(size_t rootkey_size)
get a rootkey randomly generated
Definition n_crypto.c:50
N_STR * n_vigenere_get_question(size_t question_size)
get a question generated from the current machine hardware (disk&cpu)
Definition n_crypto.c:478
N_STR * n_vigenere_quick_decode(N_STR *encoded_question)
quick decode data
Definition n_crypto.c:461
A box including a string and his lenght.
Definition n_str.h:39
N_STR and string function declaration.