A python module that produces Jasypt/Bouncycastle compatible hashes and encrypted passwords.
Any python environment that can run pycrypto
.
Download the packaged jasypt4py module and install it with pip.
Example pip
Installation:
pip install -U jasypt4py
Currently only supports PBEWITHSHA256AND256BITAES-CBC-BC
and PBEWITHSHA256AND128BITAES-CBC-BC
from Jasypt/Bouncycastle.
See tests.
Jasypt encryption function:
$JASYPT_HOME/bin/encrypt.sh providerClassName = "org.bouncycastle.jce.provider.BouncyCastleProvider" \
saltGeneratorClassName = "org.jasypt.salt.RandomSaltGenerator" \
algorithm = "PBEWITHSHA256AND256BITAES-CBC-BC" \
password = 'pssst...don\'t tell anyone' \
keyObtentionIterations = 4000 \
input = 'secret value'
is equivalent to:
from jasypt4py import StandardPBEStringEncryptor
cryptor = StandardPBEStringEncryptor('PBEWITHSHA256AND256BITAES-CBC')
cryptor.encrypt('pssst...don\'t tell anyone', 'secret value', 4000)
Jasypt decryption function:
$JASYPT_HOME/bin/decrypt.sh providerClassName = "org.bouncycastle.jce.provider.BouncyCastleProvider" \
saltGeneratorClassName = "org.jasypt.salt.RandomSaltGenerator" \
algorithm = "PBEWITHSHA256AND256BITAES-CBC-BC" \
password = 'pssst...don\'t tell anyone' \
keyObtentionIterations = 4000 \
input = 'xgX5+yRbKhs4zSubkAPkg9gSBkZU6XWt7csceM/3xDY='
is equivalent to:
from jasypt4py import StandardPBEStringEncryptor
cryptor = StandardPBEStringEncryptor('PBEWITHSHA256AND256BITAES-CBC')
cryptor.decrypt('pssst...don\'t tell anyone', 'xgX5+yRbKhs4zSubkAPkg9gSBkZU6XWt7csceM/3xDY=', 4000)