# Base 64 Encode/Decode Functions

Topics

:

Overview
Functions

Overview

Standalone functions used for base 64 password encryption and decoding.

Functions

gxsBase64ConvertToNumber()
gxsBase64Decode()
gxsBase64Encode()
gxsBasicAuthenticationDecode()
gxsBasicAuthenticationEncode()
gxsCalculateBase64Length()

int gxsBase64ConvertToNumber(unsigned char c)

- Standalone function used to convert the encoded base 64 byte to a number.

void gxsBase64Decode(const char *s, char *strbuf)

- Standalone function used to decode the encoded string "s" from a base 64 format and pass back the decoded string in the "strbuf" variable.

void gxsBase64Encode(const char *s, char *strbuf, int length)

- Standalone function used to encode the specified string "s" to a base64 format and pass back the encrypted string in the "strbuf" variable.

void gxsBasicAuthenticationDecode(const gxString &wwwauth, gxString &user,gxString &passwd)

-Standalone function used to decode a basic authentication line and pass back the username and password in the "user" and "passwd" variables.

void gxsBasicAuthenticationEncode(const char *user, const char *passwd,const char *header, gxString &wwwauth)

- Standalone function used to write an authentication header for the basic authentication scheme using base 64 encoding. The "basic" authentication scheme is based on the model that the user agent must authenticate itself with a user-ID and a password for each realm. The realm value should be considered an opaque string, which can only be compared for equality with other realms on that server. The server will authorize the request only if it can validate the user-ID and password for the protection space of the Request-URI.

int gxsCalculateBase64Length(int len)

- Standalone function used to calculate the number of bytes it will take to store a base 64 encrypted string.

End Of Document