Session: Improvements to encryption functionality