MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / encryptText

Function encryptText

services/cloudUser.js:486–491  ·  view source on GitHub ↗
(cipher_alg, key, iv, text)

Source from the content-addressed store, hash-verified

484
485// to encrypt data
486function encryptText(cipher_alg, key, iv, text) {
487 const cipher = crypto.createCipheriv(cipher_alg, key.toString('hex').slice(0, 32), iv.toString('hex').slice(0, 16));
488 let result = cipher.update(text, 'utf8', 'hex');
489 result += cipher.final('hex');
490 return result;
491}
492
493// to decrypt data
494// eslint-disable-next-line

Callers 3

loginFunction · 0.70
changePasswordFunction · 0.70
resetUserPasswordFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected