Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:27:38+00:00 2026-05-31T00:27:38+00:00

I am new in iphone development.I am using -(NSString *)Base64Encode:(NSData *)data { //Point to

  • 0

I am new in iphone development.I am using

-(NSString *)Base64Encode:(NSData *)data
{
    //Point to start of the data and set buffer sizes 
    int inLength = [data length]; 
    int outLength = ((((inLength * 4)/3)/4)*4) + (((inLength * 4)/3)%4 ? 4 : 0); 
    const char *inputBuffer = [data bytes]; 
    char *outputBuffer = malloc(outLength); 
    outputBuffer[outLength] = 0; 
    //64 digit code 
    static char Encode[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 
    //start the count
    int cycle = 0; 
    int inpos = 0;
    int outpos = 0; 
    char temp; 
    //Pad the last to bytes, the outbuffer must always be a multiple of 4 
    outputBuffer[outLength-1] = '='; 
    outputBuffer[outLength-2] = '=';  

    while (inpos < inLength)
    {     switch (cycle) 
        {         case 0:         
            outputBuffer[outpos++] = Encode[(inputBuffer[inpos]&0xFC)>>2];      
            cycle = 1;            
            break;         
        case 1:            
            temp = (inputBuffer[inpos++]&0x03)<<4; 
            outputBuffer[outpos] = Encode[temp];    
            cycle = 2;       
            break;        
        case 2:         
            outputBuffer[outpos++] = Encode[temp|(inputBuffer[inpos]&0xF0)>> 4];      
            temp = (inputBuffer[inpos++]&0x0F)<<2; 
            outputBuffer[outpos] = Encode[temp];   
            cycle = 3;                            
            break;       
        case 3:      
            outputBuffer[outpos++] = Encode[temp|(inputBuffer[inpos]&0xC0)>>6];   
            cycle = 4;       
            break;    
        case 4:          
            outputBuffer[outpos++] = Encode[inputBuffer[inpos++]&0x3f];  
            cycle = 0;   
            break; 
        default:
            cycle = 0; 
            break;    
        }
    } 
    NSString *pictemp = [NSString stringWithUTF8String:outputBuffer];
    free(outputBuffer);
    return pictemp;
}   

this code for encryption of data and this is a logic which is i am also using in my java code.But I don’t hava any idea how to write decryption logic in objective c for this encrypted result method.Is there anyone have idea then please help me.Thanks in Advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:27:39+00:00Added an answer on May 31, 2026 at 12:27 am

    Check out http://cocoawithlove.com/2009/06/base64-encoding-options-on-mac-and.html Ag great blog for Objective-C programmers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to iPhone development. I am using the below code to add
I am new to Objective C and iPhone development. I am using CoreData on
I am new iphone development. In my app, i am using two textfield and
I'm new to iPhone development and I'm having trouble using the 3rd part Kal
I am new to iPhone development.I have created an application using UITableViewCellAccessoryDisclosureIndicator . I
I am new to iphone development. In my app, i am using number of
Let me start off by saying Im VERY new to iphone development, but Im
Hope all of you doing great. I am new in Iphone development using xcode
I am new to iPhone development. I want to create an iPhone application, using
I am new to iPhone development. I am building an app by using Xcode

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.