Encode and decode security tokens.