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); }; }
decrypt(ctx) { const decrypt = crypto.createDecipheriv("aes-256-ctr", pass, iv); return ctx.params.pipe(decrypt); }
async getFileData(filename) { const bucket = await this._getBucket(); const stream = bucket.openDownloadStreamByName(filename); stream.read(); return new Promise((resolve, reject) => { const chunks = []; stream.on('data', data => { chunks.push(data); }); stream.on('end', () => { const data = Buffer.concat(chunks); if (this._fileKey !== null) { const authTagLocation = data.length - 16; const ivLocation = data.length - 32; const authTag = data.slice(authTagLocation); const iv = data.slice(ivLocation, authTagLocation); const encrypted = data.slice(0, ivLocation); const decipher = crypto.createDecipheriv(this._algorithm, this._fileKey, iv); decipher.setAuthTag(authTag); return resolve(Buffer.concat([decipher.update(encrypted), decipher.final()])); } resolve(data); }); stream.on('error', err => { reject(err); }); }); }
iv = Buffer.from(iv, 'base64'); const decipher = crypto.createDecipheriv('aes-128-cbc', _sessionKey, iv);
const decipher = crypto.createDecipheriv('aes-128-ecb', this.key, ''); result = decipher.update(data, format, 'utf8'); result += decipher.final('utf8'); const decipher = crypto.createDecipheriv('aes-128-ecb', UDP_KEY, ''); result = decipher.update(data, format, 'utf8'); result += decipher.final('utf8');
decrypt(encodedString) { let encoded = JSON.parse(this.constructor.base64decode(encodedString)); encoded.iv = this.constructor.base64decode(encoded.iv); encoded.value = this.constructor.base64decode(encoded.value, 'binary'); const decipher = Crypto.createDecipheriv(this.server.clientOptions.crypt.cypher, this.server.clientOptions.crypt.key, encoded.iv); let decrypted = decipher.update(encoded.value, 'binary', 'ascii'); decrypted += decipher.final('ascii'); return JSON.parse(decrypted); }
decrypt(readableStream, key, iv) { this.validateKey(key) const decipher = crypto.createDecipheriv(ALGORITHM, Buffer.from(key, 'hex'), iv) readableStream.pipe(decipher) return decipher }
function decrypt(text, key) { const textParts = text.split(DELIMITER); const iv = Buffer.from(textParts.shift(), HEX); const encryptedText = Buffer.from(textParts.join(DELIMITER), HEX); const decipher = crypto.createDecipheriv(ALGORITHM, Buffer.from(key), iv); let decrypted = decipher.update(encryptedText); decrypted = Buffer.concat([decrypted, decipher.final()]); return decrypted.toString(); }
decrypt(password: string) { const decipher = createDecipheriv( this.config.cyper.algorithm, this.config.cyper.privateKey, this.config.cyper.iv ); let dec = decipher.update(password, 'hex', 'utf8'); dec += decipher.final('utf8'); return dec; }
decrypt (data) { const decipher = createDecipheriv("aes256", password, encryptionIv); let decrypted = decipher.update(data, "hex", "utf8"); decrypted += decipher.final("utf8"); return decrypted; }
static decrypt(key, nonce) { const cypher = crypto.createDecipheriv('aes192', key, nonce); cypher.on('error', (e) => { Log.debug('cypher emitted error', e); }); return cypher; }
export function decryptSettingsCache(data){ try{ let decipher = crypto.createDecipheriv("aes-256-cbc", Buffer.from(key[1], "base64"), Buffer.from(key[0], "base64")) let decrypted = decipher.update(Buffer.from(data, "base64")); decrypted = Buffer.concat([decrypted, decipher.final()]); return decrypted.toString("utf8") }catch(e){ return "{}" } }
decrypt(ctx) { const decrypter = crypto.createDecipheriv("aes-256-ctr", password, iv); return ctx.params.pipe(decrypter); }
const iv = data.slice(ivLocation, authTagLocation); const encrypted = data.slice(0, ivLocation); const decipher = crypto.createDecipheriv( this._algorithm, this._fileKey,
export function decryptSettingsCache(data){ try{ let decipher = crypto.createDecipheriv("aes-256-cbc", Buffer.from(key[1], "base64"), Buffer.from(key[0], "base64")) let decrypted = decipher.update(Buffer.from(data, "base64")); decrypted = Buffer.concat([decrypted, decipher.final()]); return decrypted.toString("utf8") }catch(e){ return "{}" } }