add utility function to encrypt/decrypt img files