moved type conversion into the encryption service.