Tabnine Logo For Javascript
createDecipher
Code IndexAdd Tabnine to your IDE (free)

How to use
createDecipher
function
in
crypto

Best JavaScript code snippets using crypto.createDecipher(Showing top 15 results out of 315)

origin: moleculerjs/moleculer

transporterReceive(next) {
      return (cmd, data, s) => {
        const decrypter = iv ? crypto.createDecipheriv(algorithm, password, iv) : crypto.createDecipher(algorithm, password);
        const res = Buffer.concat([decrypter.update(data), decrypter.final()]);
        return next(cmd, res, s);
      };
    }
origin: perguth/node-streams

function decrypt (ciphertext) {
 var decipher = crypto.createDecipher(algorithm, 'pw')
 var plaintext = decipher.update(ciphertext, 'hex', 'utf8')
 plaintext += decipher.final('utf8')
 return plaintext
}
origin: roccomuso/transfer-sh

function Transfer (fileInput, opts) {
 if (!fileInput) throw Error('File input required')
 var algorithm = 'aes-256-cbc'
 this.fileInput = fileInput
 this.opts = opts || {}
 this.httpOptions = {}
 this.inputStream = isReadable(fileInput) ? fileInput : fs.createReadStream(fileInput)
 this.encryptedStream = null
 this.sEncrypt = this.opts.password ? crypto.createCipher(algorithm, this.opts.password) : new PassThroughStream()
 this.sDecrypt = this.opts.password ? crypto.createDecipher(algorithm, this.opts.password) : new PassThroughStream()
}
origin: sanderhelleso/klourly

function decrypt(data) {

  // create decipher with set algo, secret and generated iv
  const decipher = crypto.createDecipher(
    process.env.CRYPTO_ALGO, process.env.CRYPTO_SECRET
  );

  // deencrypt the passed in data
  const decrypted = decipher.update(
    data, process.env.CRYPTO_DIGEST, process.env.CRYPTO_OUT
  );

  // return the decrypted message
  return `${decrypted}${deciper.final(process.env.CRYPTO_OUT)}`;
}
origin: DavidCai1993/lock.js

function decrypt (content, key) {
 if (typeof content !== 'string') content = content.toString()

 let decrypted = ''
 let dip = crypto.createDecipher('rc4', key)
 decrypted += dip.update(content, 'hex', 'binary')
 decrypted += dip.final('binary')

 return decrypted
}
origin: node-ebics/node-ebics-client

const decrypt = (data, algorithm, passphrase) => {
  data = (Buffer.from(data, 'base64')).toString();
  const decipher = crypto.createDecipher(algorithm, passphrase);
  const decrypted = decipher.update(data, 'hex', 'utf8') + decipher.final('utf8');

  return decrypted;
}
origin: DigitalState/Formio

decrypt(secret, cipherbuffer) {
   if (cipherbuffer === undefined) {
    return undefined;
   }

   const decipher = crypto.createDecipher('aes-256-cbc', secret);
   const decryptedJSON = Buffer.concat([
    decipher.update(cipherbuffer), // Buffer contains encrypted utf8
    decipher.final()
   ]);

   return JSON.parse(decryptedJSON);  // This can throw a exception
  }
origin: HeraldStudio/herald-webservice

// 对称解密算法,要求 value 是 String 或 Buffer,否则会报错
const decrypt = (key, value) => {
 try {
  let decipher = crypto.createDecipher(config.auth.cipher, key)
  let result = decipher.update(value, 'hex', 'utf8')
  result += decipher.final('utf8')
  return result
 } catch (e) {
  return ''
 }
}
origin: GaurangBhatt/BeamlineJS

var decrypt = function(text) {
 var decipher = crypto.createDecipher('aes-256-cbc','beamline')
 var dec = decipher.update(text,'hex','utf8')
 dec += decipher.final('utf8');
 return dec;
}
origin: PowerMobileWeb/snowflake-hapi-openshift

/**
 * ##  method to decrypt data(password)
 *
 */
function decrypt(password) {
 var decipher = crypto.createDecipher(algorithm, privateKey);
 var dec = decipher.update(password, 'hex', 'utf8');
 dec += decipher.final('utf8');
 return dec;
}
origin: Sniperkillerut/node_hapi_objection

// method to decrypt data(password) 
function decrypt (password) {
 const decipher = crypto.createDecipher(algorithm, privateKey)
 let dec = decipher.update(password, 'hex', 'utf8')
 dec += decipher.final('utf8')
 return dec
}
origin: csxiaoyaojianxian/JavaScriptStudy

function aesDecrypt(encrypted, key) {
  const decipher = crypto.createDecipher('aes192', key);
  var decrypted = decipher.update(encrypted, 'hex', 'utf8');
  decrypted += decipher.final('utf8');
  return decrypted;
}
origin: DavidCai1993/lock.js

function decrypt (content, key) {
 if (typeof content !== 'string') content = content.toString()

 let decrypted = ''
 let dip = crypto.createDecipher('rc4', key)
 decrypted += dip.update(content, 'hex')
 decrypted += dip.final()

 return decrypted
}
origin: zhr85210078/node-mongodb-es-connector

var aesDecrypt = function (encrypted, key) {
  const decipher = crypto.createDecipher('aes192', key);
  try {
    decrypted = decipher.update(encrypted, 'hex', 'utf8');
    decrypted += decipher.final('utf8');
  } finally {
    decrypted = encrypted;
    return decrypted;
  }
}
origin: NanoDevs/NanoLightWallet

// Decrypt using aes-256-cbc
function decrypt(text, password){
  var decipher = cryptom.createDecipher('aes-256-cbc',password);
  var dec = decipher.update(text,'hex','utf8');
  dec += decipher.final('utf8');
  return dec;
}
cryptocreateDecipher

Most used crypto functions

  • Hash.update
  • Hash.digest
  • createHash
  • randomBytes
  • Hmac.digest
  • createHmac,
  • Cipher.final,
  • Cipher.update,
  • Decipher.update,
  • Decipher.final,
  • createCipheriv,
  • createCipher,
  • createDecipheriv,
  • pbkdf2,
  • publicEncrypt,
  • privateDecrypt,
  • pbkdf2Sync,
  • DecipherGCM.final

Popular in JavaScript

  • ms
    Tiny millisecond conversion utility
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • minimatch
    a glob matcher in javascript
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • crypto
  • express
    Fast, unopinionated, minimalist web framework
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • debug
    small debugging utility
  • http
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now