// SPDX-License-Identifier: Apache-2.0
// Copyright 2025 Basic Encryption Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BASIC_ENCRYPTION_H
#define BASIC_ENCRYPTION_H

#include <string>
#include <vector>

/**
 * BasicEncryption class provides simple encryption and decryption methods
 * including Caesar cipher and XOR encryption algorithms.
 */
class BasicEncryption {
public:
    // Lifecycle
    BasicEncryption();
    ~BasicEncryption();

    // Caesar Cipher Methods
    std::string EncryptCaesar(const std::string& plaintext, int shift);
    std::string DecryptCaesar(const std::string& ciphertext, int shift);

    // XOR Encryption Methods
    std::string EncryptXor(const std::string& plaintext, const std::string& key);
    std::string DecryptXor(const std::string& ciphertext, const std::string& key);

    // Utility Methods
    std::string GenerateRandomKey(int length);
    bool IsValidKey(const std::string& key);
    void SetDebugMode(bool enabled);

private:
    // Private helper methods
    char ShiftCharacter(char character, int shift);
    char UnshiftCharacter(char character, int shift);
    std::string ProcessXorEncryption(const std::string& input, const std::string& key);
    
    // Member variables
    bool mDebugMode;
    static const int MAX_SHIFT_VALUE = 25;
    static const int MIN_KEY_LENGTH = 1;
};

#endif // BASIC_ENCRYPTION_H