aboutsummarylogtreecommitdiffstats
path: root/rc4.h
blob: 14affb53e5a1779836158e5277278dd07d8a47ee (plain)
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
#ifndef RC4_H
#define RC4_H

#define PASS_MAX 32
#define BACKSPACE 127
#define KEY_SCHEDULE_LENGTH 256
#define DECRYPT 0
#define ENCRYPT 1

#include <ncurses.h>
#include <json-c/json_tokener.h>
#include <unistd.h>
#include "string-tick.h"

/**
 * Returns a password string taken from user input with a maximum of 32 characters. The user's input
 * should not be echoed in the terminal, so ncurses noecho() function should be used.
 * @return the password taken from input
 */
char* rc4_getPassword(void);

/**
 * Returns an encoded string given a String object and password used to encode it.
 * @param pString The String to encode.
 * @param password the key used to encode
 */
void rc4_encode_string(String* pString, char* password);

#endif