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 3601790
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:39:55+00:00 2026-05-18T20:39:55+00:00

i am Getting the image from the .net web server which is in base64

  • 0

i am Getting the image from the .net web server which is in base64 encoded from.

By googling i found this source for the encryption and decryption

i tried this

#import <Foundation/Foundation.h>

@class NSString;

@interface NSData (NSDataAdditions)

+ (NSData *) base64DataFromString:(NSString *)string;

-------------------------------------------

#import "NSDataAdditions.h"

@implementation NSData (NSDataAdditions)

+ (NSData *) base64DataFromString: (NSString *)string {
  unsigned long ixtext, lentext;
  unsigned char ch, input[4], output[3];
  short i, ixinput;
  Boolean flignore, flendtext = false;
  const char *temporary;
  NSMutableData *result;

  if (!string)
    return [NSData data];

  ixtext = 0;
  temporary = [string UTF8String];
  lentext = [string length];
  result = [NSMutableData dataWithCapacity: lentext];
  ixinput = 0;
  while (true) {
    if (ixtext >= lentext)
      break;
    ch = temporary[ixtext++];
    flignore = false;
    if ((ch >= 'A') && (ch <= 'Z'))
      ch = ch - 'A';
    else if ((ch >= 'a') && (ch <= 'z'))
      ch = ch - 'a' + 26;
    else if ((ch >= '0') && (ch <= '9'))
      ch = ch - '0' + 52;
    else if (ch == '+')
      ch = 62;
    else if (ch == '=')
      flendtext = true;
    else if (ch == '/')
      ch = 63;
    else
      flignore = true; 

    if (!flignore) {
      short ctcharsinput = 3;
      Boolean flbreak = false;

      if (flendtext) {
         if (ixinput == 0)
           break;                
         if ((ixinput == 1) || (ixinput == 2)) {
           ctcharsinput = 1;
         else
           ctcharsinput = 2;

         ixinput = 3;
         flbreak = true;
      }

      input[ixinput++] = ch;

      if (ixinput == 4)
        ixinput = 0;

      output[0] = (input[0] << 2) | ((input[1] & 0x30) >> 4);
      output[1] = ((input[1] & 0x0F) << 4) | ((input[2] & 0x3C) >> 2);
      output[2] = ((input[2] & 0x03) << 6) | (input[3] & 0x3F);

      for (i = 0; i < ctcharsinput; i++)
        [result appendBytes: &output[i] length: 1];
    }

    if (flbreak)
      break;
  }
  return result;
}

@end

but it shows error by resolving errors it is not decrypted.

And i try this link

But i did n’t understand through that link.

can any one pls help me.

Post some code for base64 decryption in iphone.

Thank u 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-18T20:39:56+00:00Added an answer on May 18, 2026 at 8:39 pm

    You should use a Base64 teststring like VGVzdHN0cmluZw== to test this method.

    Use http://www.motobit.com/util/base64-decoder-encoder.asp to debug your data.

    Edit
    You should convert your string online to TEST it in your Objective C Code! You cleary didn’t pass the method a real Base64 encoded string.

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

Sidebar

Related Questions

i am Getting the image from the .net web server which is in base64
I am getting image and some details from .net web server. I need to
I am trying to retrieving image from sql server 2005 into asp.net web page
I wanted to change the resolution of a image,this image I am getting from
I have this source code where I got it from net tutsplus. I have
I am getting an image from facebook by the URL: http://external.ak.fbcdn.net/safe_image.php?d=d282e1e7c86c9270232f97ddc737df39&w=90&h=90&url=http%3A%2F%2Fi52.tinypic.com%2F2q0ixzl.jpg Now, I want
i need to get data along with images from .net web server. i have
I want to get a thumbnail image for videos from Vimeo. When getting images
Trying to create a background-image slideshow and am getting this error... This is the
I have this ASP.NET code: <asp:GridView ID=gvImages runat=server AutoGenerateColumns=False CellPadding=4 ForeColor=#333333 GridLines=None> <Columns> <asp:ImageField

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.