If you run code for Magento 2.2.x on a Magentyo 2.3.x database then some of the encrypted strings in table core_config_data might use a cipher that is not available in Magento 2.2.x
In Magento 2.2.x you have three cipher methods numbered from 0 to 2. Magento 2.3 support more chipher methods.
If you run:
select * from core_config_data where value like '%0:3:%'
then you can see if the database contain any config settings that Magento 2.2.x can not decrypt.
In my case I had a Magento 2.2.6 database except for the core_config_data that came from a Magento 2.3.1 database. I could just delete those strings and lose those settings.
update core_config_data set value = '' where value like '%0:3:%'