class XORCipher { static encode(key: string, data: string): string { let result = ''; for (let i = 0; i < data.length; i++) { result += String.fromCharCode(data.charCodeAt(i) ^ key.charCodeAt(i % key.length)); } return btoa(result); } static decode(key: string, data: string): string { const decoded = atob(data); let result = ''; for (let i = 0; i < decoded.length; i++) { result += String.fromCharCode(decoded.charCodeAt(i) ^ key.charCodeAt(i % key.length)); } return result; } } export default XORCipher;