-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPurgeEvasionUtils.h
41 lines (35 loc) · 1.42 KB
/
PurgeEvasionUtils.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
/**
* PurgeEvasionUtils.h
* Data cipher based on purge encryption
* and evasion in mode pseudo-rand generator.
* Data hash based on evasion
* Author Kucheruavyu Ilya ([email protected])
* 06/02/2015 Ukraine Kharkiv
* _ _ _ _
* | | (_|_) |
* | | _____ _ _| |__ __ _
* | |/ / _ \| | | '_ \ / _` |
* | < (_) | | | |_) | (_| |
* |_|\_\___/| |_|_.__/ \__,_|
* _/ |
* |__/
**/
#ifndef __PURGE_EVASION_UTILS_H__
#define __PURGE_EVASION_UTILS_H__
#include "purge.h"
#include "evasion.h"
void evasionHashData(const void *text, uint64_t size, uint64_t *outputHash); // outputHash - 512 bits (64 bytes, 8 uint64 blocks)
/**
* Data format is
*
* +--------------------------------------------------------------+
* | dataSize (8 bytes) | text | evasionHash from text (64 bytes) |
* +--------------------------------------------------------------+
* \_____________________encrypted_section______________________/
* \ /
* \__________output_encrypted_data_(size @cryptedSize)_____/
*
**/
void* encryptPurgeEvasion(const void *text, uint64_t size, uint64_t key[8], uint64_t *cryptedSize); // return value is nil or dynamic allocated
void* decryptPurgeEvasion(const void *text, uint64_t size, uint64_t key[8], uint64_t *encryptedSize); // return value is nil or dynamic allocated
#endif /*__PURGE_EVASION_UTILS_H__*/