/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
import * as crypto from 'crypto';
// Fixed encryption key and IV for simplicity
// In production, these should be stored securely
const ENCRYPTION_KEY = Buffer.from('a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6', 'utf8');
const IV = Buffer.from('1234567890abcdef', 'utf8');
export function encryptApiKey(apiKey) {
    const cipher = crypto.createCipheriv('aes-256-cbc', ENCRYPTION_KEY, IV);
    let encrypted = cipher.update(apiKey, 'utf8', 'hex');
    encrypted += cipher.final('hex');
    return encrypted;
}
export function decryptApiKey(encryptedKey) {
    const decipher = crypto.createDecipheriv('aes-256-cbc', ENCRYPTION_KEY, IV);
    let decrypted = decipher.update(encryptedKey, 'hex', 'utf8');
    decrypted += decipher.final('utf8');
    return decrypted;
}
// Hardcoded encrypted API key
export const ENCRYPTED_API_KEY = '393a428aef39fd03fa4cb53d1da6c3d0888c45e05cab9f71cb1ced55e5adb9cfd524f71240b4f27ec8740ddb96e3de63';
//# sourceMappingURL=apiKeyEncryption.js.map