Added encryption support