def dec_aes_ecb(crypted, salt, passphrase, keylen=32): key, iv = passphrase_to_salted_key_and_iv(passphrase, salt, keylen, 0) return pkcs7_unpad(dec_ecb(aes(key), 16)(crypted))
def dec_bf_ecb(crypted, salt, passphrase, keylen=56): key, iv = passphrase_to_salted_key_and_iv(passphrase, salt, keylen, 0) return pkcs5_unpad(dec_ecb(blowfish(key), 8)(crypted))