MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / decrypt

Function decrypt

packages/shared/src/crypto.ts:30–42  ·  view source on GitHub ↗
(iv: string, encryptedText: string)

Source from the content-addressed store, hash-verified

28}
29
30export function decrypt(iv: string, encryptedText: string): string {
31 const encryptionKey = Buffer.from(env.SOURCEBOT_ENCRYPTION_KEY, 'ascii');
32
33 const ivBuffer = Buffer.from(iv, 'hex');
34 const encryptedBuffer = Buffer.from(encryptedText, 'hex');
35
36 const decipher = crypto.createDecipheriv(algorithm, encryptionKey, ivBuffer);
37
38 let decrypted = decipher.update(encryptedBuffer, undefined, 'utf8');
39 decrypted += decipher.final('utf8');
40
41 return decrypted;
42}
43
44
45export function hashSecret(text: string): string {

Callers 1

decryptActivationCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected