Solved

MrMick - Decoding Base64 files!!

Posted on 1998-04-03
6
190 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LINQ return type for nested group query 6 71
Use Multiple Forms 4 49
Saving history changes to sub form 4 36
bit defender blocks good applications 2 82
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

15 Experts available now in Live!

Get 1:1 Help Now