KeyGeneration and IV algorithm
Spaniakos - Keygeneration and IV algorythm for Arduino and Raspberry Pi
|
#include <KEYGEN.h>
Public Member Functions | |
void | init (int lpin) |
void | gen_pass (void *out, int size) |
void | gen_IV (void *out, int size) |
int | get_type () |
void | printArray (char output[], int sizel) |
double | millis () |
long int | rpi_rand (int x) |
Private Attributes | |
timeval | tv |
char | NUMS [NUMS_MAX+1] = "0123456789" |
char | SYMS [SYMS_MAX+1] = "!@#$^&*()-_=+[]<>,./:" |
char | CAPS [CAPS_MAX+1] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
char | LOWE [LOWE_MAX+1] = "abcdefghijklmnopqrstuvwxyz" |
int | pin |
void KEYGEN::init | ( | int | lpin | ) |
Begin operation of the Algorythm and set the pin to be used for noise
Call this in setup(), before calling any other methods.
lpin | integer value of the pin keyg.init(5);
|
void KEYGEN::gen_pass | ( | void * | out, |
int | size | ||
) |
Generate a password of specified size and stores it in the out pointer. The password includes characters from types NUMS , SYMS, CAPS, LOWE
out | pointer that the generated password will be saved. |
size | integer value, indicating the size of the password to be generated |
void KEYGEN::gen_IV | ( | void * | out, |
int | size | ||
) |
Generate an IV of specified size and stores it in the out pointer. The IV is a numerical value.
out | pointer that the generated IV will be saved. |
size | integer value, indicating the size of the password to be generated |
int KEYGEN::get_type | ( | ) |
return a random number from 0 to 3. This function is mainly used from gen_pass in order to randomlly get a character from NUMS or SYMS or CAPS or LOWE
void KEYGEN::printArray | ( | char | output[], |
int | sizel | ||
) |
Gets an array and its size and prints it in the standard output character by character.
output[] | array of any size. |
sizel | integer values indicating the size of the array. |
double KEYGEN::millis | ( | ) |
used in linux in order to retrieve the time in milliseconds.
long int KEYGEN::rpi_rand | ( | int | x | ) |
used in Raspberry pi in order to generate a random number.
x | get an integer that is te upper limit-1 of the random number. |
|
private |
Used to get time on linux boards
|
private |
Hold the Numbers
|
private |
Holds the Symbols
|
private |
Holds the Caps letters
|
private |
Hold the Lower letters
|
private |
Pin to gain noise from, Used for random seed