~vcs-imports/paramiko/trunk

Viewing all changes in revision 742.3.1.

  • Committer: Alex Gaynor
  • Date: 2014-03-30 02:22:36 UTC
  • mto: This revision was merged to the branch mainline in revision 746.
  • Revision ID: git-v1:6f211115f49edcea7d23b764d7cf3a84ff12f5f0
Switch from using PyCrypto's Random to using os.urandom.

There's several reasons for this change:

1) It's faster for reads up to 1024 bytes (nearly 10x faster for 16 byte reads)
2) It receives considerably more security review since it's in the kernel.
3) It's yet another step towards running on PyPy.
4) Using userspace CSPRNGs is considered something of an anti-pattern. See:
   http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/
   http://webcache.googleusercontent.com/search?q=cache:2nTvpCgKZXIJ:www.2uo.de/myths-about-urandom/+&cd=3&hl=en&ct=clnk&gl=us

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: