modified encrypt/decrypt; key and iv to db