class XORCryptor:
    def __init__(self, key):
        self.key = key

    def decrypt(self, encrypted_buffer):
        return [byte ^ ord(self.key[i % len(self.key)]) for i, byte in enumerate(encrypted_buffer)]

def decrypt(encrypted_buffer, borrowed_string):
    # Key for decryption
    key = "CSUCKS"

    # Editing our borrowed value
    borrowed_string += "PARTY FOUL! Here is your flag: "

    # Create decryption object
    xor_cryptor = XORCryptor(key)

    # Decrypt the encrypted buffer
    decrypted_buffer = xor_cryptor.decrypt(encrypted_buffer)

    # Print the raw decrypted bytes for inspection
    print("Decrypted bytes:", decrypted_buffer)

    # Convert the decrypted buffer to a string (handling possible invalid UTF-8)
    decrypted_str = ''.join(chr(byte) for byte in decrypted_buffer if 32 <= byte <= 126)

    # Append the decrypted string to the borrowed string
    borrowed_string += decrypted_str

    # Print the final message
    print(borrowed_string)

def main():
    # Encrypted flag values (in hexadecimal)
    hex_values = [
        "41", "30", "20", "63", "4a", "45", "54", "76", "12", "90", "7e", "53", "63", "e1",
        "01", "35", "7e", "59", "60", "f6", "03", "86", "7f", "56", "41", "29", "30", "6f", "08",
        "c3", "61", "f9", "35"
    ]
