-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamp.html
129 lines (115 loc) · 4.18 KB
/
amp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html lang="en">
<head>
<title>Decrypt AES in SFMC</title>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!-- Bootstrap CSS v5.2.1 -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT"
crossorigin="anonymous"
/>
<!--
https://mclh5l9mytm5mlgmrclc7cbjkyv8.pub.sfmc-content.com/dkeyxbaghkz?f=amp.html&t=c63d-2604-3d08-597c-9190-cc01-d14f-7c9e-5553.ngrok-free.app
-->
</head>
<body>
<script runat="server">
Platform.Load("Core","1.1.1");
try{
</script>
%%[ set @enc = RequestParameter('encStr');
set @password = IIF(empty(RequestParameter('password')) , 'zoetis' , RequestParameter('password'))
set @iv = IIF(empty(RequestParameter('iv')) , '3944a5680c2e80ef12adc728c0acc926' , RequestParameter('iv'))
set @salt = IIF(empty(RequestParameter('salt')) , '2b8869f12dd9d562' , RequestParameter('salt'))
IF NOT EMPTY(@enc) THEN
set @decStr = DecryptSymmetric(@enc, "aes", @null, @password, @null, @salt, @null,
@iv)
set @decStr = concat('Decrypted String: ' , @decStr)
ENDIF
/* outputline(concat(
'Hardcoded decoding: '
, DecryptSymmetric('bfHMgljk/BpHudryDHranBLlEOZevJQvEH7Wj+nZxHNFYFHliBP+Bg9Esb61ZxiJ2AMRpGIknGaWPvvN1QIeUw==', "aes", @null, 'anypasswordvalue', @null, '701e6a98ec6e4f51', @null, 'c4a89623cbca32fa0a9d077569975fbc')
)) */
]%%
<script runat="server">
}catch (e) {
Write("<b>Error Message:</b> " + Stringify(e.message) + "<br><br><b>Description:</b> " + Stringify(e.description));
}
</script>
<header>
<!-- place navbar here -->
<h2 class="text-center">Decrypt String in SFMC</h2>
</header>
<main>
<form action="%%=RequestParameter('PAGEURL')=%%" method="post">
<section class="container">
<div class="mb-3">
<label for="" class="form-label">Password</label>
<input
type="text"
class="form-control"
name="password"
id="password"
aria-describedby="helpId"
placeholder="Enter Password here"
value="%%=v(@password)=%%"
/>
<label for="" class="form-label">Init Vector</label>
<input
type="text"
class="form-control"
name="iv"
id="iv"
aria-describedby="helpId"
placeholder="Enter iv here"
value="%%=v(@iv)=%%"
/>
<label for="" class="form-label">Salt</label>
<input
type="text"
class="form-control"
name="salt"
id="salt"
aria-describedby="helpId"
placeholder="Enter Salt here"
value="%%=v(@salt)=%%"
/>
<label for="" class="form-label">Encrypted String</label>
<input
type="text"
class="form-control"
name="encStr"
id="encStr"
aria-describedby="helpId"
placeholder="Enter Encrypted String here"
value="%%=RequestParameter('encStr')=%%"
/>
<button type="submit" class="btn btn-primary mt-5">Decrypt</button>
</div>
<div>%%=v(@decStr)=%%</div>
</section>
</form>
</main>
<footer>
<!-- place footer here -->
</footer>
<!-- Bootstrap JavaScript Libraries -->
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz"
crossorigin="anonymous"
></script>
</body>
</html>