history: encrypted <-> plain convertion
small code unification
finishing touches