How to send personalized secure links

Copyright © 2015, Adobe
How to send personalized
secure links
Adobe Campaign
Page 1
Copyright © 2015, Adobe
Document Purpose
Code sample for DES encryption.
Introduction
This code sample allows you to encrypt a value using the DES algorithm in JavaScript.
This is applicable only up to version 6.0.2.
Please note, DES is considered insecure, you should favor AES if you can
Purpose
If you need to provide a personalized link to a website, but you don't want the recipient to see the identifier, you need to encrypt it. The
website needs to decrypt it using the same algorithm.
JavaScript source code
<%
// Encryption of a Neolane ID with the DES method
// Create this option and set a different value on each environment. Must be 16 chars in hex.
// For example : 0ABFBA777380F43B
var key = getOption("kbm_mdCodeEncryptionKey") :
var iv = "0000000000000000"
var padding = "PKCS5PADDING"
var method = "ECB"
var id = recipient.id // or any other identifier
var cryptid = escapeUrl(encryptDES(key, id, method, iv, padding))
// Example of personalized link
var url = "http://login.myClientWebsite.com/login?id=" + cryptid
%>
To access you account, click <a href="<%=url%>">here</a>.
Adding random data
It is more secure to not generate the same code each time the same value is encoded.
To do that, you need to add a random number to the encoded data, separated from the value with a space.
Use the following code in JavaScript :
var id = Math.random()+ " "+ recipient.id // or any other identifier
var cryptid = escapeUrl(encryptDES(key, id, method, iv, padding)
Adobe Campaign
Page 2
Copyright © 2015, Adobe
Adobe Campaign
Page 3