Make encrypt/decrypt local functions of key-provider.cpp