// SPDX-License-Identifier: Apache-2.0
// Copyright 2025 Simple 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 SIMPLE_ENCRYPTION_H
#define SIMPLE_ENCRYPTION_H

#include <string>

/**
 * SimpleEncryption class provides basic encryption and decryption functionality
 * using Caesar cipher and XOR encryption methods.
 */
class SimpleEncryption {
public:
    // Lifecycle
    SimpleEncryption();
    explicit SimpleEncryption(int key);
    ~SimpleEncryption();

    // Operations
    std::string EncryptCaesar(const std::string& plaintext, int shift = 0);
    std::string DecryptCaesar(const std::string& ciphertext, int shift = 0);
    
    std::string EncryptXor(const std::string& plaintext, const std::string& key);
    std::string DecryptXor(const std::string& ciphertext, const std::string& key);
    
    // Accessors
    void SetDefaultKey(int key);
    int GetDefaultKey() const;
    
    // Utilities
    bool IsValidText(const std::string& text) const;
    std::string GenerateRandomKey(int length) const;

private:
    // Attributes
    int mDefaultKey;
    
    // Helper methods
    char ShiftCharacter(char character, int shift) const;
    bool IsAlphabetic(char character) const;
    char ToUpperCase(char character) const;
    char ToLowerCase(char character) const;
};

#endif // SIMPLE_ENCRYPTION_H