first results, some fixes/optimizations on encryptions and tests