You can use the
SecureToken feature to protect your HLS streams. However, you would need to upgrade to version 4. If you prefer to stay in version 2, then you can use an
AddOn module to protect your RTMP streams. For earlier versions, this would only work for RTMP streams.
I would strongly suggest that you look into upgrading to version 4. There are many features, including security modules, that have been introduced in the latest version.