def redact(data, opts = {})
	    options = @options.merge(opts)
	    
  		redact_hash = options[:redact]
  		
  		raise "Don't know what to redact. Please configure the redact hash when initializing or pass as an argument to redact." unless redact_hash && redact_hash.any?
  
		result = data.clone
  
  		# If it's blacklist mode, just go over our redact keys
  		# Otherwise, we have to go through and remove all keys that aren't :keep
  		if (options[:filter_mode] == :whitelist)
  		  keys = data.keys
		  redact_hash = whitelist_redact_hash redact_hash
  		else
  		  keys = redact_hash.keys
  		end

		keys.each do |hash_key,how|
		  how = redact_hash[hash_key] || :remove
		  
		  if data.has_key? hash_key
			case how.to_sym
			  when :keep
			    nil
			  when :remove
				nil
			  when :digest
			  	digest(result, hash_key, options)
			  when :encrypt
				encrypt(result, hash_key, options)
			  else
				raise "redact called with unknown operation on #{hash_key}: #{how}"
			end

			result.delete hash_key unless how.to_sym == :keep
		  end
		end
  
		result
	  end
def redact(data, opts = {})
	    options = @options.merge(opts)
	    
  		redact_hash = options[:redact]
  		
  		raise "Don't know what to redact. Please configure the redact hash when initializing or pass as an argument to redact." unless redact_hash && redact_hash.any?
  
		result = data.clone
  
  		# If it's blacklist mode, just go over our redact keys
  		# Otherwise, we have to go through and remove all keys that aren't :keep
  		if (options[:filter_mode] == :whitelist)
  		  keys = data.keys
		  redact_hash = whitelist_redact_hash redact_hash
  		else
  		  keys = redact_hash.keys
  		end

		keys.each do |hash_key,how|
		  how = redact_hash[hash_key] || :remove
		  
		  if data.has_key? hash_key
			case how.to_sym
			  when :keep
			    nil
			  when :remove
				nil
			  when :digest
			  	digest(result, hash_key, options)
			  when :encrypt
				encrypt(result, hash_key, options)
			  else
				raise "redact called with unknown operation on #{hash_key}: #{how}"
			end

			result.delete hash_key unless how.to_sym == :keep
		  end
		end
  
		result
	  end
Removes, digests or encrypts fields in a hash
 NOTE: This should NOT be used to protect password fields or similar
 The purpose of hashing is to reduce data to a form that can be *quickly*
 compared against other records without revealing the original value.
 To allow for this, all hashes are created using the *same salt* which is
 not secure enough for password protection
 For passwords, use BCrypt