const e=require("crypto"),r=require("os"),{encodings:t}=require("./constants"),{getHash:s}=require("./utils"),n=e=>Buffer.from(s(e).toString(t.hex)),u=()=>{const e=`${r.platform()}_${r.release()}_${r.userInfo().username}`;return n(e).slice(0,32)},c=()=>{const e=`${r.userInfo().username}_${r.release()}_${r.platform()}`;return n(e).slice(0,16)};module.exports={encrypt:r=>{const s=e.createCipheriv("aes-256-ctr",u(),c());let n=s.update(r,t.utf16le,t.hex);return n+=s.final(t.hex)},decrypt:r=>{const s=e.createDecipheriv("aes-256-ctr",u(),c());let n=s.update(r,t.hex,t.utf16le);return n+=s.final(t.utf16le)}};