fixed some crypto and encoding bugs
Merge remote-tracking branch 'origin/devel' into devel