def dec_bf_pcbc(crypted, salt, passphrase, keylen=56): key, iv = passphrase_to_salted_key_and_iv(passphrase, salt, keylen, 8) return pkcs5_unpad(dec_pcbc(blowfish(key), iv)(crypted))
def enc_bf_pcbc(text, salt, passphrase, keylen=56): key, iv = passphrase_to_salted_key_and_iv(passphrase, salt, keylen, 8) return enc_pcbc(blowfish(key), iv)(pkcs5_pad(text))