function decrypt(input, secret) {
  // Ensure we have something to decrypt
  if (!input) {
    return new Error('You must provide a value to decrypt');
  }
  // Ensure we have the secret used to encrypt this value
  if (!secret) {
    return new Error('A \'secret\' is required to decrypt');
  }

  // turn string into an object
  try {
      input = JSON.parse(input);
  } catch (err) {
      return new Error('Unable to parse string input as JSON');
  }

  // Ensure our input is a valid object with 'iv', 'salt', and 'value'
  if (!input.iv || !input.salt || !input.value) {
    return new Error('Input must be a valid object with \'iv\', \'salt\', and \'value\' properties');
  }

  var salt = new Buffer(input.salt, 'base64'),
    iv = new Buffer(input.iv, 'base64'),
    keyLength = input.keyLength,
   iterations = input.iterations;

  try {

    var key = cryptoLib.pbkdf2Sync(secret, salt, iterations, keyLength / 8, 'sha1'),
      decipher = cryptoLib.createDecipheriv(CIPHER, key, iv);

    var decryptedValue = decipher.update(input.value, 'base64', 'utf8');
    decryptedValue += decipher.final('utf8');

    return decryptedValue;

  } catch (err) {
    return new Error('Unable to decrypt value due to: ' + err);
  }
}
decrypt() - Decrypt a serialized JSON object
@private
@param {string} input - the serialized JSON object to decrypt.
@param {string} secret - the secret to use for decryption