function encrypt(data, secretKey, algorithm) {
  const cipher = crypto.createCipher(algorithm, secretKey);
  let crypted = cipher.update(data, 'utf-8', 'hex');
  crypted += cipher.final('hex');
  return crypted;
} // encrypt
/**
 * Encrypt the given data using passed in secretKey and algorithm
 * @param  {String} data -  Data to be encrypted
 * @param  {String} secretKey - Secret key for encryption
 * @param  {String} algorithm - Name of the encryption algorithm
 * @returns {String} - encrypted data
 */
Encrypt the given data using passed in secretKey and algorithm
@param  {String} data -  Data to be encrypted
@param  {String} secretKey - Secret key for encryption
@param  {String} algorithm - Name of the encryption algorithm
@returns {String} - encrypted data
Encrypt the given data using passed in secretKey and algorithm @param { String } data - Data to be encrypted @param { String } secretKey - Secret key for encryption @param { String } algorithm - Name of the encryption algorithm @returns { String } - encrypted data
function encrypt(data, secretKey, algorithm) {
  const cipher = crypto.createCipher(algorithm, secretKey);
  let crypted = cipher.update(data, 'utf-8', 'hex');
  crypted += cipher.final('hex');
  return crypted;
} 
function encrypt ( data , secretKey , algorithm ) { const cipher = crypto . createCipher ( algorithm , secretKey ) ; let crypted = cipher . update ( data , 'utf-8' , 'hex' ) ; crypted += cipher . final ( 'hex' ) ; return crypted ; }
Encrypt the given data using passed in secretKey and algorithm
 @param  {String} data -  Data to be encrypted
 @param  {String} secretKey - Secret key for encryption
 @param  {String} algorithm - Name of the encryption algorithm
 @returns {String} - encrypted data
Encrypt the given data using passed in secretKey and algorithm @param { String } data - Data to be encrypted @param { String } secretKey - Secret key for encryption @param { String } algorithm - Name of the encryption algorithm @returns { String } - encrypted data
// encrypt