Added functionality to use encrypted wallets.