function xorEncrypt(plaintext, key) { let encrypted = ''; for (let i = 0; i < ...