About
The class AESFile provides means to create and work with AES encrypted files. Derived from BaseFile working with AES files works exactly the same as with other files, with the only exception of opening the file. So it is recommended to read BaseFile Manual first.
Warning For encryption using the MAXON API ALIASES see Stream Conversions Manual .
if (!fileInput || !fileAes)
{
}
const char pw[] = { 's' , 'p' , 'e' , 'a' , 'k' , ',' , ' ' , 'f' , 'r' , 'i' , 'e' , 'n' , 'd' , ',' , ' ' , 'a' , 'n' , 'd' , ' ' , 'e' , 'n' , 't' , 'e' , 'r' };
const Int32 keylen =
sizeof (pw) * 8;
DebugAssert ((keylen == 128) || (keylen == 192) || (keylen == 256));
const Int32 blocksize = 256;
{
}
if (readBytes != fileSize)
{
}
{
}
{
}
else
{
return maxon::UnexpectedError(
MAXON_SOURCE_LOCATION ,
"Error: The encrypted file does not match the encrypted version." _s);
}
Allocation/Deallocation
AESFile objects are created with the usual tools, see Entity Creation and Destruction Manual (Classic) .
Open
Warning For a plugin to be cross platform then the type and creator parameters must be correctly filled for Mac.
Miscellaneous
Further Reading
Int TryReadBytes(void *data, Int len)
maxon::Int Int
Definition: ge_sys_math.h:64
#define MACTYPE_CINEMA
Standard Mac type code for Cinema 4D.
Definition: ge_prepass.h:30
#define NewMemClear(T, cnt)
Definition: defaultallocator.h:204
@ ANY
Show an error dialog for any error.
static Bool CheckEncryption(const Filename &encrypt, const Filename &decrypt, const char *key, Int32 keylen, Int32 blocksize)
@ V_INTEL
Intel, little endian.
Manages file and path names.
Definition: c4d_file.h:93
return OK
Definition: apibase.h:2546
@ NONE
No check if file exists under case-sensitive drives.
#define iferr_return
Definition: resultbase.h:1465
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:66
Bool Open(const Filename &name, FILEOPEN mode=FILEOPEN::READ, FILEDIALOG error_dialog=FILEDIALOG::IGNOREOPEN, BYTEORDER order=BYTEORDER::V_MOTOROLA, Int32 type='C4DC', Int32 creator='C4D1')
void SetSuffix(const maxon::String &str)
maxon::Url MaxonConvert(const Filename &fn, MAXONCONVERTMODE convertMode)
Bool WriteBytes(const void *data, Int len)
Bool Open(const Filename &name, const char *key, Int32 keylen, Int32 blocksize, UInt32 aes_flags, FILEOPEN mode=FILEOPEN::READ, FILEDIALOG error_dialog=FILEDIALOG::IGNOREOPEN, BYTEORDER order=BYTEORDER::V_MOTOROLA, Int32 type='C4DC', Int32 creator='C4D1')
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:208
#define MACCREATOR_CINEMA
Standard Mac creator code for Cinema 4D.
Definition: ge_prepass.h:31
@ READ
Open the file for reading.
Definition: ge_autoptr.h:36
#define DebugAssert(condition,...)
Definition: debugdiagnostics.h:246
maxon::Char Char
Definition: ge_sys_math.h:56
Bool FileSelect(FILESELECTTYPE type, FILESELECT flags, const maxon::String &title, const maxon::String &force_suffix=maxon::String())