Get basic core encryption funcionality up, still needs to be hooked up to UI and actual usage

Good basis for e.g. the history branch #423 to use (though is independent of that PR)