ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
encryptionfunctions.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, LLC.
15******************************************************************************/
16#ifndef ENCRYPTION_FUNCTIONS_H
17#define ENCRYPTION_FUNCTIONS_H
18
19#include <string>
20
21namespace modelspace {
22
23 const int MAX_SIZE_CHAR = 0xFF;
24
25 /// @brief Function to perform a simple encryption of a buffer of data
26 /// @param unencrypted The unencrypted buffer to encrypt
27 /// @param encrypted The encrypted buffer result
28 /// @param size The size of the buffer
29 /// @param key The encryption key to use for the buffer
30 void simpleEncrypt(char* unencrypted, char* encrypted, char size, const std::string &key);
31
32 /// @brief Function to decrypt a buffer of data -- companion to simpleEncrypt
33 /// @param unencrypted The encrypted buffer to decrypt
34 /// @param encrypted The unencrypted buffer result
35 /// @param size The size of the buffer
36 /// @param key The encryption key to use for the buffer
37 void simpleDecrypt(char* encrypted, char* unencrypted, char size, const std::string &key);
38
39 /// @brief Function to write a buffer of bytes to a file, along with their size
40 /// @param buffer The buffer of data to write to file
41 /// @param buffer_size The size of the buffer to be written
42 /// @param filename The name of the file to write to
43 void writeFileBinarySize(char* buffer, char buffer_size, const std::string &filename);
44
45 /// @brief Function to read a buffer of bytes from a file
46 /// @param buffer The buffer of data to read from -- max size is the max value of a char
47 /// @param buffer_size The size of the buffer to be written
48 /// @param filename The name of the file to write to
49 void readFileBinarySize(char buffer[MAX_SIZE_CHAR], char* size_actual, const std::string &filename);
50
51}
52
53#endif
Class to propagate CR3BP dynamics in characteristic units.
Definition ConfigurationWriter.cpp:18
void readFileBinarySize(char buffer[MAX_SIZE_CHAR], char *size_actual, const std::string &filename)
Function to read a buffer of bytes from a file.
Definition encryptionfunctions.cpp:79
void writeFileBinarySize(char *buffer, char buffer_size, const std::string &filename)
Function to write a buffer of bytes to a file, along with their size.
Definition encryptionfunctions.cpp:65
void simpleDecrypt(char *encrypted, char *unencrypted, char size, const std::string &key)
Function to decrypt a buffer of data – companion to simpleEncrypt.
Definition encryptionfunctions.cpp:47
void simpleEncrypt(char *unencrypted, char *encrypted, char size, const std::string &key)
Function to perform a simple encryption of a buffer of data.
Definition encryptionfunctions.cpp:24