MCPcopy Index your code
hub / github.com/chartbrew/chartbrew / decrypt

Function decrypt

server/modules/cbCrypto.js:20–33  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

18}
19
20function decrypt(text) {
21 if (!text) return text;
22 // console.log("text decrypt", text);
23
24 const textParts = text.split(":");
25 const iv = Buffer.from(textParts.shift(), "hex");
26 const encryptedText = Buffer.from(textParts.join(":"), "hex");
27 const decipher = crypto.createDecipheriv(ALGORITHM, Buffer.from(SECRET_KEY, "hex"), iv);
28 let decrypted = decipher.update(encryptedText);
29
30 decrypted = Buffer.concat([decrypted, decipher.final()]);
31
32 return decrypted.toString();
33}
34
35function isValidAES256Key(key) {
36 // Check if the key length is 64 hexadecimal characters (which represents 32 bytes)

Callers 4

decryptFileFunction · 0.70
decryptFileSyncFunction · 0.70
changePasswordMethod · 0.50

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected