use securerandom
fix a bug
avoid potential path traversal.
Merge branch 'master' into confluence