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

Function encryptText

services/cloudObjects.js:1358–1363  ·  view source on GitHub ↗
(cipher_alg, key, iv, text)

Source from the content-addressed store, hash-verified

1356
1357// to encrypt data
1358function encryptText(cipher_alg, key, iv, text) {
1359 const cipher = crypto.createCipheriv(cipher_alg, key.toString('hex').slice(0, 32), iv.toString('hex').slice(0, 16));
1360 let result = cipher.update(text, 'utf8', 'hex');
1361 result += cipher.final('hex');
1362 return result;
1363}
1364
1365// to decrypt data
1366// eslint-disable-next-line

Callers 1

_encryptFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected