<script runat="server">
Platform.Load("Core", "1.1.1")
try {
var data = Request.GetFormField("data");
JSON = Platform.Function.ParseJSON(data);
Documento = JSON.Documento;
encDocumento = JSON.encDocumento;
encFactura = JSON.encFactura;
today = new Date();
password = "e2a80fe9-5ad6-4e94-8c35-481ae69b8a7a";
saltVal = "77a43623-feb2-4c41-99d9-54ea77cd424b";
initVectorVal = "2d6ed376-b312-4b1e-9545-5c7c0e71134a";
Variable.SetValue("@password", password);
Variable.SetValue("@saltVal", saltVal);
Variable.SetValue("@initVectorVal", initVectorVal);
Variable.SetValue("@encDocumento", encDocumento);
Variable.SetValue("@encFactura", encFactura);
</script>
%%[
SET @desEncDocumento = DecryptSymmetric(@encDocumento,"AES",@password,@null,@saltVal,@null,@initVectorVal,@null)
]%%
<script runat="server">
var desEncDocumento = Variable.GetValue("@desEncDocumento");
if (Documento == desEncDocumento) {
</script>
%%[
SET @desEncFactura = DecryptSymmetric(@encFactura,"AES",@password,@null,@saltVal,@null,@initVectorVal,@null)
]%%
<script runat="server">
var desEncFactura = Variable.GetValue("@desEncFactura");
Write(desEncFactura)
}
}
catch (error) {
Write('false')
}
</script>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter