def decrypt(encrypted, passphrase):
    encrypted = base64.b64decode(encrypted)
assert encrypted[0:8] == 'Salted__'
salt = encrypted[8:16]
key_iv = bytes_to_key(passphrase, salt, 32 + 16)
key = key_iv[:32]
iv = key_iv[32:]
aes = AES.new(key, AES.MODE_CBC, iv)
return unpad(aes.decrypt(encrypted[16:]))
password = 'some password'.encode()
ct_b64 = 'U2FsdGVkX1+ATH716DgsfPGjzmvhr+7+pzYfUzR+25u0D7Z5Lw04IJ+LmvPXJMpz'
pt = decrypt(ct_b64, password)
print(('pt', pt))
print(('pt', decrypt(encrypt(pt, password), password)))
Как расшифровать пароль из JavaScript CryptoJS.AES.encrypt (пароль, кодовая фраза) в Python