libbase64

libbase64 is a library written in C++.
It encode and decode a simple text or files to base64.

Download: http://sourceforge.net/projects/libbase64/

Install instructions:
1.- Download the files.
2.- Extract 'libbase64.a' to folder's project or if you want use shared library, move 'libbase64.so' to shared library's path of you system (/lib/).
3.- Then include the header.
4.- And add to the linker the option: -lbase64

How to use:
#include <iostream>
#include <cstring>
#include "base64.h"

#define ENCODE "/Encode"
#define DECODE "/Decode"
#define FILE   "-File"
#define STR    "-String"

using namespace std;

void  Usage();

int main(int argc, char* argv[])
{
    if( (argc != 4) )
    {
        Usage();
        return 1;
    }
    if( (strcmp(argv[1], ENCODE) == 0) )
    {
        if( (strcmp(argv[2], FILE) == 0) )
        {
            if(!base64_encode_file(argv[3]))
            {
                cout << "     File could not be encrypted!" <<endl;
            }
            else
            {
                cout << "     File could be encrypted!" <<endl;
            }
        }
        if( (strcmp(argv[2], STR) == 0) )
        {
            cout << base64_encode((const unsigned char *)argv[3], strlen(argv[3])) <<endl;
        }
    }
    if( (strcmp(argv[1], DECODE) == 0) )
    {
        if( (strcmp(argv[2], FILE) == 0) )
        {
            if(!base64_decode_file(argv[3]))
            {
                cout << "     File could not be decrypted!" <<endl;
            }
            else
            {
                cout << "     File could be decrypted!" <<endl;
            }
        }
        if( (strcmp(argv[2], STR) == 0) )
        {
            cout << base64_decode((string)argv[3]) <<endl;
        }
    }
    return 0;
}


void Usage()
{
    cout << "Usage:" <<endl;
    cout << "     Extasis [/Encode] [/Decode] [[-File] Path] [[-String] Text]" <<endl;
}

How to compile:
g++ -o Main.o Main.cpp -L"ProjectPath" -lbase64