Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
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

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: http://en.wikipedia.org/wiki/Base64[^]
 
Share this answer
 
With Perl you can use the MIME::Base64[^] package. This is returned as first Google result when searching for 'base64 decoder perl'.
 
Share this answer
 
Comments
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";

Regards
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
dennis
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900