Home | Sign in | English EN
  • 3DES encryption
CryptStandard (Example)
3DES encryption
This example is used to perform a 3DES encryption used in an URL.
// 3DES encryption used in an URL
// ----------------------------------------
bufEncryptedResult is Buffer
bufToEncrypt is Buffer = "Message to encrypt"
bufMD5Key is Buffer
bufKey is Buffer = "password"

// Hashes the password in MD5
bufMD5Key = HashString(HA_MD5_128, bufKey)
// MD5 gives a result on 128 bits (16 bytes)
// Fills the encryption key on 192 bits (24 bytes)
// because 3DES requires 192-bit keys (3x64 bits)
// To do so, the first 64 bits must be repeated (first 8 bytes)
// from the beginning to the end of the key
bufMD5Key = bufMD5Key + bufMD5Key[[to 8]]
// Encrypts in 3DES
bufEncryptedResult = CryptStandard(bufToEncrypt, bufMD5Key, crypt3DES, ...
cryptECB, cryptPaddingPKCS)
// Switches the result to base64 so that it can be read, without CR
bufEncryptedResult = Replace(Crypt(bufEncryptedResult, "", ...
cryptNone, encodeBASE64), CR, "")
// Encodes all so that it can be passed on an URL to a site
sURLParameter is string = URLEncode(bufEncryptedResult)
Minimum version required
  • Version 20
This page is also available for…
Click [Add] to post a comment