PKG-INFO 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. Metadata-Version: 1.1
  2. Name: backports.pbkdf2
  3. Version: 0.1
  4. Summary: Fast PBKDF2 for Python 2.6 - 3.4
  5. Home-page: https://bitbucket.org/tiran/backports.pbkdf2
  6. Author: Christian Heimes
  7. Author-email: christian@python.org
  8. License: PSFL
  9. Description: ========================================================
  10. PKCS#5 password-based key derivation function 2 (PBKDF2)
  11. ========================================================
  12. This is a backport of ``hashlib.pbkdf2_hmac`` for Python 2.6 to 2.7. The
  13. implementation comes with a pure Python implementation and a C module that
  14. depends on OpenSSL. The C code does *not* wrap ``PKCS5_PBKDF2_HMAC`` as
  15. its implementation is suboptimal.
  16. Usage
  17. =====
  18. ::
  19. >>> from backports.pbkdf2 import pbkdf2_hmac, compare_digest
  20. >>> dkey = pbkdf2_hmac('sha1', passwordbytes, saltbytes, iterations=100000)
  21. >>> compare_digest(dkey, originalkey)
  22. True
  23. pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None)
  24. hash_name
  25. name of the digest algorithm as string
  26. password
  27. password as bytes, bytearray or bytes-like object (*)
  28. salt
  29. salt as bytes, bytearray or bytes-like object (*). The salt should be
  30. generated with a CPRNG like ``os.urandom()``. You should **never** use
  31. ``random.random()``. About 16 bytes seem to be a good choice.
  32. iterations
  33. number of rounds, 100,000 rounds of SHA-1 take about 30ms on a modern
  34. CPU.
  35. dklen
  36. length of the derived key (defaults to digest_size)
  37. returns
  38. derived key as bytes
  39. (*) bytearray and bytes-like objects are not supported on Python 2.6
  40. Benchmarks
  41. ==========
  42. ==================== ===== ===== ===== ======
  43. password length 10 100 500 1000
  44. ==================== ===== ===== ===== ======
  45. backports.pbkdf2 C 0.314 0.321 0.310 0.310
  46. backports.pbkdf2 Py 0.838 0.847 0.853 0.913
  47. pbkdf2_ctypes 0.99.3 0.554 0.663 0.954 1.344
  48. pbkdf2 1.3 5.235 5.746 6.155 6.450
  49. Django pbkdf2 1.5.4 1.976 2.430 2.676 3.078
  50. PyCrypto 2.6.1 6.903 9.062 9.518 10.274
  51. ==================== ===== ===== ===== ======
  52. algorithm
  53. sha1
  54. rounds
  55. 50000
  56. dklen
  57. 20
  58. saltlen
  59. 16
  60. number of runs per test
  61. 10
  62. Python
  63. Python 3.3 on Linux AMD64
  64. CPU
  65. Intel i7-2860QM @ 2.50GHz
  66. Changelog
  67. =========
  68. pbkdf2 0.1
  69. ----------
  70. *Release date: 19-Oct-2013*
  71. - initial release of backports.pbkdf2
  72. Keywords: pbkdf2 password openssl security
  73. Platform: POSIX
  74. Platform: Windows
  75. Classifier: Development Status :: 4 - Beta
  76. Classifier: Intended Audience :: Developers
  77. Classifier: License :: OSI Approved :: Python Software Foundation License
  78. Classifier: Natural Language :: English
  79. Classifier: Operating System :: POSIX
  80. Classifier: Operating System :: Microsoft :: Windows
  81. Classifier: Programming Language :: C
  82. Classifier: Programming Language :: Python
  83. Classifier: Programming Language :: Python :: 2
  84. Classifier: Programming Language :: Python :: 2.6
  85. Classifier: Programming Language :: Python :: 2.7
  86. Classifier: Programming Language :: Python :: 3
  87. Classifier: Programming Language :: Python :: 3.2
  88. Classifier: Programming Language :: Python :: 3.3
  89. Classifier: Programming Language :: Python :: Implementation :: CPython
  90. Classifier: Programming Language :: Python :: Implementation :: PyPy
  91. Classifier: Topic :: Security :: Cryptography