base64

need base64 encode/decode in c

I need a function to encode base64 and a function to decode base64 string in c. I found http://base64.sourceforge.net/b64.c but the functions work on files, not strings, and add line breaks. I need one that simply encodes/decodes strings. Where can I find such a sourcecode? ...

C# Byte[] to Url Friendly String

Hello, I'm working on a quick captcha generator for a simple site I'm putting together, and I'm hoping to pass an encrypted key in the url of the page. I could probably do this as a query string parameter easy enough, but I'm hoping not too (just because nothing else runs off the query string)... My encryption code produces a byte[], w...

Encoding utf-8 to base64 with accents

Hi, I have some data like this: data1 = ['Agos', '30490349304'] data2 = ['Desir\xc3\xa9','9839483948'] I'm using an API that expects the data encoded in base64, so what I do is: data = data1 string = base64.b64encode("Hi, %s! Your code is %s" % (data[0], data[0])) myXMLRPCCall(string) Which works fine with data1. With data2 the enc...

Passing base64_encoded serialized data between form submissions

I'm creating a wizard-based series of forms for taking user inputs. One of the requirements for that wizard is that the script (PHP) cannot save the inputs into the database (MySQL) until the user clicks the 'Save' button, so I have to device a mechanism to transport user inputs in one form to another when the user clicks 'Previous' or '...

Base64 Decode in C# or Java

I have a Base64-encoded object with the following header: application/x-xfdl;content-encoding="asc-gzip" What is the best way to proceed in decoding the object? Do I need to strip the first line? Also, if I turn it into a byte array (byte[]), how do I un-gzip it? Thanks! ...

Flash Loader and ByteArray

I need to be able to load a jpeg/png image from disk and show it in flex and send it to a server as a base64 encoded string. But once the image file is loaded, in my flash.display.LoaderInfo object, the bytes property (type of ByteArray) contains more byte than the file content. Example: image file size: 3089 flash.display.LoaderInfo.b...

Insert base 64 string into SQL Server database

Dear guys I get a base 64 string from a XML file which I want to insert into my SQL Server database. Which field type have the field in my database to be? varbinary(MAX)? Do I have to convert the base 64 string to another format before inserting into my database? Best regards ...

Reinterpret float vector as unsigned char array and back.

Hi all, I've searched and searched stackoverflow for the answer, but have not found what I needed. I have a routine that takes an unsigned char array as a parameter in order to encode it as Base64. I would like to encode an STL float vector (vector) in Base64, and therefore would need to reinterpret the bytes in the float vector as an ...

C# base64 encoding/decoding with serialization of objects issue

I'm using serialization and deserialization in C# for my Project (which is a Class). They are serialized and saved to an XML file. When loading the Project, all goes well. Now I'm trying to encode the serialized Project to Base64 and then save the file, which goes well too. The first line of the file (before encoded!) looks like this: ...

How to Decode base 64 data

I have an XML doucment in which there is an tag for image like this if there is an image then the tag would be as follows <thumbnail> <type>IMAGE JPG</type> <data> base64 data </data> </thumbnail> And if there is no image then <thumbnail/> I want to get the base64 encoded image using DOM parser and how to handle tags which don't...

Decoding eval gzinflate base64_decode (Anyone Know of a Decoder I could Use for This)

I want to make sure that this code is not harmful but everytime I try to decode it it doesn't actually do anything but give me even crazier looking symbols. Any suggestions would be helpful. Below is the actual encrypted code... eval(gzinflate(str_rot13(base64_decode('FZnHDoRVElF/cmE7Kw5rpx3tCO+95zLCe3Uaz9diL9cCFVZSc7wQf//3r7//qM55...

How would this method be in C#? [From VisualBasic.Net]

Here's the snippet: Function Encode(ByVal dec As String) As String Dim bt() As Byte ReDim bt(dec.Length) bt = System.Text.Encoding.ASCII.GetBytes(dec) Dim enc As String enc = System.Convert.ToBase64String(bt) Return enc End Function I'm trying to make an program that sends a...

Convert image (jpg) to base64 in Excel VBA?

I need to convert an image inside Excel (or through VBA) to base64 (in the end I will make XML output). How can I do this? Do I need to make a reference to DOM? I´ve been reading this question but it only works for text strings not images... Does anyone have any code that I can see? ...

Apache Commons Codec with Android: could not find method

Today I tried including the apache.commons.codec package in my Android application and couldn't get it running. Android could not find method ord.apache.commons.codec.binary.* and output the following errors in DDMS 01-12 08:41:48.161: ERROR/dalvikvm(457): Could not find method org.apache.commons.codec.binary.Base64.encodeBase64URLSa...

What text encoding scheme do you use when you have binary data that you need to send over an ascii channel?

If you have binary data that you need to encode, what encoding scheme do you use? I know about: Hex encoding. Very simple, but quite verbose, expands one byte to two. Base 64. Most common, not so verbose, expands three bytes to four. Base 85. Not common, less verbose again, expands four bytes to five. Are there any other encoding sc...

Why is command line computed base64 string different than curl computed base64 string?

Really confused - Guess it has to do with a single character placement at the end, or possible padding done with basic digest that I'm not aware of..? So, if I execute this, you can see the product of the base64 encode: echo '[email protected]:password' | openssl enc -base64 aG9zdEBtYWlsLmNvbTpwYXNzd29yZAo= Now, if I make a curl request:...

Encrypt printable text so result is still printable (can be typed)

I want to encrypt some info for a licensing system and I want the result to be able to be typed in by the user. Update: This operation must be reversible (decrypt-able) E.g., Encrypt ( ComputerID+ProductID) -> (any standard ASCII character that can be typed. Ideally maybe even just A-Z). So far what I did was to convert the encrypted t...

decoding base64 encoded string with URL escaped characters

I am currently working on importing contacts from windows live contacts(hotmail addressbook). At one stage, the service posts back some data that i need to my page as a base64 encoded string which, as per microsoft documentation, contains url escaped sequences for '&' and '='. The string is thus not standard base64 encoded. The problem ...

Writing a base64 string to a file without carriage returns

Will I run into problems if I write a base64 string into a file without breaking it up using carriage returns? Is there a length where I'll run into difficulties writing and reading a big string in one go? Right now the size of the strings I'm storing are about 100 characters but they can get into the 10,000+ range - will that be a p...

How to generate DigestValue and SignatureValue for enveloped XML Signature using PHP/linux tool

Hi, i have been trying to find some examples on how to generate DigestValue and SignatureValue for XML signature (WSDL). Below is a sample SOAP for the application: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:SOAP-SEC="http://schemas.xmlsoap.org/soap/security/2000-12" xmlns:soapenv="http://schemas.xmlsoap.org/soap/en...