Updated the base64Encode for AP MODE