"use strict";exports.id=8576,exports.ids=[8576],exports.modules={48576:(e,t,a)=>{a.d(t,{HI:()=>u,decryptCombined:()=>c,pe:()=>o});var r=a(84770);let s="aes-256-gcm";function n(){let e=process.env.ENCRYPTION_MASTER_KEY;if(!e||e.length<32)throw Error("ENCRYPTION_MASTER_KEY must be at least 32 characters");return(0,r.createHash)("sha256").update(e).digest()}function i(e){let t=process.env.VAULT_KEY_DERIVATION_SALT||"wasiyyah-vault-salt";return(0,r.createHash)("sha256").update(`${t}:${e}`).digest()}function u(e,t){let a=t?i(t):n(),u=(0,r.randomBytes)(12),o=(0,r.createCipheriv)(s,a,u,{authTagLength:16}),c=o.update(e,"utf8","base64");c+=o.final("base64");let f=o.getAuthTag();return{encryptedData:c,iv:u.toString("base64"),authTag:f.toString("base64")}}function o(e,t,a,u){let o=u?i(u):n(),c=(0,r.createDecipheriv)(s,o,Buffer.from(t,"base64"),{authTagLength:16});return c.setAuthTag(Buffer.from(a,"base64")),c.update(e,"base64","utf8")+c.final("utf8")}function c(e,t){let a=e.split(":");if(a.length<3)throw Error("Invalid combined encrypted data format");let r=a[0],s=a[1];return o(a.slice(2).join(":"),r,s,t)}}};