Switch from PyCrypto/M2Crypto to cryptography; swap sha1 to sha256 in pbkdf2 at the same time