371 Contributors: 9 Monday, July 3, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial:
Roadmap: roadmap

Security and Cryptography


Python, being one of the most popular languages in computer and network security, has great potential in security and cryptography. This topic deals with the cryptographic features and implementations in Python from its uses in computer and network security to hashing and encryption/decryption algorithms.


  • hashlib.pbkdf2_hmac(name, password, salt, rounds, dklen=None)


Many of the methods in hashlib will require you to pass values interpretable as buffers of bytes, rather than strings. This is the case for as well as hashlib.pbkdf2_hmac. If you have a string, you can convert it to a byte buffer by prepending the character b to the start of the string:

  "This is a string"
 b"This is a buffer of bytes"

Related Examples