// Copyright (c) Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/Collections/Array.h"
///
/// Contains algorithms for data encryption/decryption.
///
class FLAXENGINE_API Encryption
{
public:
///
/// Encrypt bytes with custom data
///
/// Bytes to encrypt
/// Amount of bytes to process
static void EncryptBytes(byte* data, uint64 size);
///
/// Decrypt bytes with custom data
///
/// Bytes to decrypt
/// Amount of bytes to process
static void DecryptBytes(byte* data, uint64 size);
public:
static int32 Base64EncodeLength(int32 size);
static int32 Base64DecodeLength(const char* encoded, int32 length);
static void Base64Encode(const byte* bytes, int32 size, Array& encoded);
static void Base64Encode(const byte* bytes, int32 size, char* encoded);
static void Base64Decode(const char* encoded, int32 length, Array& output);
static void Base64Decode(const char* encoded, int32 length, byte* output);
};