b64encode

Description

Returns a string that is base-64 encoded, or if an error occurs, an empty string.

Syntax

b64encode <string>

b64encode <string>

  • Returns a string that is base-64 encoded, or if an error occurs, an empty string.

Examples

when RULE_INIT {
   set ::key [AES::key]
}
when HTTP_RESPONSE {
   set decrypted [HTTP::cookie "MyCookie"]
   HTTP::cookie remove "MyCookie"
   set encrypted [b64encode [AES::encrypt $::key $decrypted]]
   HTTP::cookie insert name "MyCookie" value $encrypted
}
when HTTP_REQUEST {
   set encrypted [HTTP::cookie "MyCookie"]
   HTTP::cookie remove "MyCookie"
   set decrypted [AES::decrypt $::key [b64decode $encrypted]]
   HTTP::cookie insert name "MyCookie" value $decrypted
}