Click here to Skip to main content
13,630,793 members
Rate this:
Please Sign up or sign in to vote.
See more:
Ive been searching through google but cant seem to figure out how its been decoded ?

Decode from base64 to ASCII Dec.
For example,
CS20UumGFaSm0QXZ54HADg => 9 45 180 82 233 134 21 164 166 209 5 217 231 129 192 14

I used all online converters, if possible i would like to get in in perl or c#.

All help would be greatfull.

thanks in advance
Posted 1-Aug-14 0:41am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Base64 is not an encryption algorithm - it is a translation algorithm. The difference being that encryption is secure, and translation isn't...

Base64 is simple, and converts binary 8 bit data into a form that is transmittable over a character based data link such as HTML which does not support binary. It in no way encrypts data, and it can be reversed with ease by even novice coders. There is a good explanation here:[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

With Perl you can use the MIME::Base64[^] package. This is returned as first Google result when searching for 'base64 decoder perl'.
dennis2704 1-Aug-14 8:09am
Yes i understand i allready tried the MIME::Base64 package but the outcome isnt what i get?

use MIME::Base64;

my $chars = "CS20UumGFaSm0QXZ54HADg";
my $encoded = encode_base64($chars);
print "Encode $encoded";

Jochen Arndt 1-Aug-14 8:22am
Your string is already encoded. So you must *decode* it:
my $decoded = decode_base64($chars);
print "Decoded $decoded";
dennis2704 2-Aug-14 10:25am
Ok so im testing the code you gave me but i thought i was supposed to be getting the numbers as output but instead of that im getting " -┤RÚå§ñªÐ♣┘þü└♫ " as output.

Maybe you could help me with it?

Thanks in advance
Jochen Arndt 4-Aug-14 3:29am
Base64 encoding is mainly used to encode binary data. And it seems that your data are binary. So it makes no sense to use the print() function. Treat the returned string as byte array instead. To print it as hex string you might use:
my $hex_str = unpack("H*",$decoded);
print $hex_str;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180712.1 | Last Updated 1 Aug 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100