Solved

MrMick - Decoding Base64 files!!

Posted on 1998-04-03
6
194 Views
Last Modified: 2012-06-21
Hi there,

MrMick very kindly answered a question of mine a few day ago and provided me with a routine to encode a file into base64.  I've used this routine and it works fine but would now like the ability in my app to decode these files as well.

Has anyone got a VB sub that will do this?

Thanks

Pete
0
Comment
Question by:peterwest
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1460287
Most encryption routines will decrypt if the encrypted object is run through the encryption again.
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1460288
Make a backup of the file first!
0
 
LVL 2

Author Comment

by:peterwest
ID: 1460289
I don't think Base64 will decrypt the file by running it through again!!!  I've already tried that and it didn't work.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 2

Accepted Solution

by:
sbmc earned 50 total points
ID: 1460290
Base64 encoding works in chunks of three bytes converted to four bytes. Decoding works by grabbing 4 byte chunks and converting these 4 bytes into 3 bytes as follows:
   1. grab 4 bytes
   2. convert to binary ie 32 bits
   3. remove 1st 2 bits of every byte
   4. divide the resulting 24 bits into 3 8bit chunks
   5. convert each 8 bit string into a byte
   6. repeat 1-6 for each group of 4 byte strings in your file

0
 
LVL 2

Author Comment

by:peterwest
ID: 1460291
Thanks,

I've already got the necessary routine to decode Base64 but it is useful to understand how it works - maybe i'll even write my own routine as the one i'm using at the moment is a little convoluted and inefficient (or at least it would appear so).

Pete

0
 
LVL 2

Author Comment

by:peterwest
ID: 1460292
Thanks,

I've already got the necessary routine to decode Base64 but it is useful to understand how it works - maybe i'll even write my own routine as the one i'm using at the moment is a little convoluted and inefficient (or at least it would appear so).

Pete

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

830 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