MCPcopy Create free account
hub / github.com/027xiguapi/code-box / decryptEncSecret

Method decryptEncSecret

utils/encryption.ts:65–84  ·  view source on GitHub ↗
(entry: any)

Source from the content-addressed store, hash-verified

63 }
64
65 decryptEncSecret(entry: any): any | null {
66 try {
67 if (!entry.encData || !this.password) {
68 return null
69 }
70
71 const decryptedData = CryptoJS.AES.decrypt(
72 entry.encData,
73 this.password
74 ).toString(CryptoJS.enc.Utf8)
75
76 if (!decryptedData) {
77 return null
78 }
79
80 return JSON.parse(decryptedData)
81 } catch (error) {
82 return null
83 }
84 }
85
86 getEncryptionStatus(): boolean {
87 return Boolean(this.password)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected