base64 encode/decode?

Posted on 2009-02-12
Last Modified: 2012-08-13

I just XOR'd a string and I want to send it over the internets. Of course now though the string has a bunch of crazy characters in it that is messing up transmission in a URL. I guess I need to base64 encode the output of the XOR before sending it to my server?

Does anyone know of a trusted code snippet that will do the encoding/decoding?

I'm doing this to just keep the average person from seeing this data.

Thank you
Question by:DJ_AM_Juicebox
    LVL 84

    Accepted Solution

    LVL 53

    Expert Comment

    Just a remark (don't accept this as answer, please) : I'm sure you know, but XOR "encryption" is relatively easy to break. So, depending on who you label as the "average user", it might not be sufficient. Maybe something like SSL is more appropriate ?

    Author Comment

    Hi Infinity, yeah I'm kind of stuck - my clients are cell phones, and the amount of data I have to encode is like 200kb for upload to my server. The data isn't sensitive - it's just a few art-y type files I created, and I didn't want to make it so easy for someone to simply examine the transfer and see the template guts (it's xml). Just doing an XOR would give me some peace of mind that it's not simply plain text.

    I have been using AES in some other projects and it's great, but I'm afraid it will be too slow for that much data on a cell phone.

    I don't know much about https, but that seemed like another option to create a secure connectionfrom the cell phones to the server - not sure where to get started with that.

    Thanks for any other ideas
    LVL 53

    Expert Comment

    If it's just for hiding the fact that you're sending plaintext data that is not sensitive, then an XOR might be sufficient indeed.

    Author Comment

    Yeah it's not user data or anything, just didn't want to make it so easy as for a non programmer to copy and paste it.

    Thanks, I have some more questions about the XOR.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
    Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
    The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now