You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it is hard to display success or error messages because the message needs to
@@ -159,11 +177,58 @@ A simple authentication helper interface along with a default implementation is
159
177
*[TgUtils\Auth\CredentialsProvider](https://github.com/technicalguru/php-utils/blob/src/TgUtils/Auth/CredentialsProvider.php) - Interface to provide username and password to other objects
160
178
*[TgUtils\Auth\DefaultCredentialsProvider](https://github.com/technicalguru/php-utils/blob/src/TgUtils/Auth/DefaultCredentialsProvider.php) - Simple default implementation of the interface
161
179
180
+
## Sensitive Data Obfuscation
181
+
182
+
Publishing sensitive data such as e-mail addresses and phone numbers is dangerous nowadays as spammers
183
+
grab such information automatically from websites. The utils package provides a javascript-based way
184
+
to obfuscate this information on websites. Its' idea is based on the rot13 obfuscation method but uses a
185
+
random character mapping instead of a fixed rotation. This idea was chosen because rot13 seems to be a kind of standard
186
+
in obfuscation and spammers might already be able to read them.
187
+
188
+
It shall be noted that it is still not impossible to read the information even when obfuscated. But it requires
189
+
a bit more sophisticated effort (Javascript execution) to gain the sensitive information.
190
+
191
+
**Idea:** The text to be obfuscated is replaced - char by char - by other characters from a map. This map is
192
+
generated uniquely for this special obfuscation instance. Other obfuscations on the same page will use different
193
+
maps. The HTML source displays only: `[javascript protected]`. However, a special javascript will run after
194
+
the page loaded and replace exactly this text with the real content.
195
+
196
+
Two obfuscation methods exists: a simple text obfuscation and an e-mail obfuscation which also creates a mailto: link
197
+
that the user can click.
198
+
199
+
Here is how you use it:
200
+
201
+
```
202
+
user \TgUtils\Obfuscation;
203
+
204
+
/*** Just create everything and put it in your HTML page **/
0 commit comments