Solved

MrMick - Decoding Base64 files!!

Posted on 1998-04-03
6
189 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
Comment Utility
Most encryption routines will decrypt if the encrypted object is run through the encryption again.
0
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
Make a backup of the file first!
0
 
LVL 2

Author Comment

by:peterwest
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 2

Accepted Solution

by:
sbmc earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 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

8 Experts available now in Live!

Get 1:1 Help Now