Merge only IV and salt functionality from danpal/attr_encryptor

Here's a pared-down pull request containing only the IV- and salt-related functionality.