This module implements the password-based key derivation function, PBKDF, specified in RSA PKCS#12 v1.0.


Quick start


Install from PyPIhttps://pip.pypa.io/en/latest/installing.html


pip install PBKDF_PKCS12


Example PBKDF PKCS#12 v1.0 usage

PBKDF_PKCS12v1(iteration, password, salt, keylen)


import PBKDF_PKCS12
from Crypto.Cipher import AES
import os

salt = os.urandom(8)    # 64-bit salt
key = PBKDF_PKCS12.PBKDF_PKCS12v1(2, "This passphrase is a secret" , salt, 32) # 256-bit key
iv = os.urandom(16)     # 128-bit IV
cipher = AES.new(key, AES.MODE_CBC, iv)


https://pypi.python.org/pypi/PBKDF_PKCS12/1.0

Posted by kkoha :