Solved

MrMick - Decoding Base64 files!!

Posted on 1998-04-03
6
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio 2005 text editor 10 55
Protecting vb6 & .Net code Obfuscation 18 214
Prevent user closing word document opened with VB6 6 89
Added a column screws up code 5 78
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

738 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