Rating:

In this chall, key and the plaintext are encoded with the same function i.e. encrypt. To get plaintext, first we have to recover key. We know that each character i of the key is modified to (i+i)%26. So, for every character of the pseudo-key there are two possibilities.
Manually getting all the possibilities.
['e', 'r'], ['e', 'r'], ['d', 'q'], ['c', 'p'], ['j', 'w'], ['j', 'w'], ['j', 'w'], ['a'], ['c', 'p'], ['g', 't'], ['f', 's']

First I thought of bruteforcing all the keys with those characters, but luckily saw somehing in the key that first few characters are forming 'redpw' and last few characters forms 'ctf'. So, we just have to bruteforce only 2 characters.
Let's try with key="redpwwwactf"
```
from string import ascii_lowercase
chr_to_num = {c: i for i, c in enumerate(ascii_lowercase)}
num_to_chr = {i: c for i, c in enumerate(ascii_lowercase)}
ct= "z_jjaoo_rljlhr_gauf_twv_shaqzb_ljtyut"
pk= "iigesssaemk"
def decrypt(ctxt, key):
for i in range(len(ct)):
key = ''.join(key[i % len(key)] for i in range(len(ctxt)))
ptxt = ''
for i in range(len(ctxt)):
if ctxt[i] == '_':
ptxt += '_'
continue
x = chr_to_num[ctxt[i]]
y = chr_to_num[key[i]]
ptxt += num_to_chr[(x - y +26) % 26]
return ptxt

key="redpwwwactf"
print(decrypt(ct, key))
```
Running the script will give us: i_guess_pseudo_keyf_are_pseudb_secure
I fixed some chracters and submitted: flag{i_guess_pseudo_keys_are_pseudo_secure}

Original writeup (https://github.com/noob-aViral/redpwn_writeups/blob/master/pseudo-key.py).