-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCSporeEncrypt.h
More file actions
37 lines (29 loc) · 778 Bytes
/
Copy pathCSporeEncrypt.h
File metadata and controls
37 lines (29 loc) · 778 Bytes
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
/*
* File: CSporeEncrypt.h
* Author: rbross
*
* Created on March 2, 2011, 12:43 PM
*/
#ifndef CSPOREENCRYPT_H
#define CSPOREENCRYPT_H
#include <stdio.h>
#include <string.h>
#include <openssl/evp.h>
#include <openssl/blowfish.h>
//! Class to encrypt data
class CSporeEncrypt
{
public:
CSporeEncrypt();
virtual ~CSporeEncrypt();
//! Encrypt buffer
static void BF_encrypt(const unsigned char *keydata, int keydatalen, unsigned char *in, unsigned char *out, unsigned int inlen);
//! Decrypt buffer
static void BF_decrypt(const unsigned char *keydata, int keydatalen, unsigned char *in, unsigned char *out, unsigned int inlen);
protected:
static void GetKey();
public:
static int iKeySize;
static unsigned char *ucKey;
};
#endif /* CSPOREENCRYPT_H */