django-pgcrypto-fields
django-pgcrypto-fields copied to clipboard
Pass options to pgp_sym_encrypt
pgp_sym_encrypt function supports certain options. For example by default it uses AES128 algorithm to encrypt but you can customize pgp_sym_encrypt(data, psw, 'compress-algo=1, cipher-algo=aes256')
. Is there a way I can provide the cipher-algo option with value AES256 when I create CharPGPSymmetricKeyField
or maybe in the settings file? If there is not then could there please be an enhancement that can be made for this?
@SiddharthPant It's currently not configurable in this package but a PR would be welcome.
This is also related to #89
@peterfarrell
What if you did something like this:
>>> ("pgp_sym_encrypt(%s, '{}', '{}')::%s" % ("foo", "bar")).format(2, 3)
"pgp_sym_encrypt(foo, '2', '3')::bar"
.format picks up the {}, % picks up the %s