Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How encrypt/decrypt (MD5) a CSV/Excel file from VBscript

1,950 views
Skip to first unread message

KarenM

unread,
Feb 23, 2006, 5:02:14 AM2/23/06
to
>From VB script I am generating a CSV/Excel file these files are emailed
out to parties outside the company. We would like to encrypt the file
before being sent out using MD5 or whatever and the recepient can then
decrypt and consume the file.

Kindly please share the code for Encrypting & decrypting the data files
if possible with MD5.

Thanks
Karen

McKirahan

unread,
Feb 23, 2006, 10:28:54 AM2/23/06
to
"KarenM" <karenm...@yahoo.com> wrote in message
news:1140687897.7...@g44g2000cwa.googlegroups.com...

Google is your friend.

http://www.frez.co.uk/freecode.htm#md5


Volker Hetzer

unread,
Feb 23, 2006, 11:21:14 AM2/23/06
to
KarenM schrieb:
MD5 is not an encryption algorithm, but a hash. If your intent is to
hide the data from spying eyes, MD5 (or any other hash FWIW) is totally
useless.

Use Winzip with a password.

Lots of Greetings!
Volker

KarenM

unread,
Feb 23, 2006, 2:59:06 PM2/23/06
to
McKirahan

Thanks for the code pointer. Can you kindly point how I can use it with
encrypting a text file and how do we decrypt the file.

Volker

Can we program winzip from vbscript to take a file and generate a
zipped file with password. How secure is a winzip file with a password
are there not cracks that can break it unlike MD5.

Thanks
Karen

McKirahan

unread,
Feb 23, 2006, 4:03:58 PM2/23/06
to
"KarenM" <karenm...@yahoo.com> wrote in message
news:1140724745.9...@i39g2000cwa.googlegroups.com...

As Volker indicated, MD5 can't be used to encrypt a file.
It is used to ensure that a file (or string) hasn't been changed.

"MD5 is an algorithm that is used to verify data integrity ..."
http://searchsecurity.techtarget.com/sDefinition/0,,sid14_gci527453,00.html

Here's a script that may do what you want.

Option Explicit
'*
Const cVBS = "password.vbs"
Const cZIP = "password.zip"
Const cPWD = "password"
Const cEXE = "C:\Program Files\WinZip\WzZip.exe"
'*
Dim strZIP
strZIP = cEXE & " -s" & cPWD & " " & cZIP & " " & cVBS
'*
Dim objWSS
Set objWSS = CreateObject("WScript.Shell")
objWSS.Run "%comspec% /C " & strZIP,7,True
Set objWSS = Nothing
'*
WScript.Echo strZIP

This uses a an old WinZip command line utility.
You may have to change it for your needs.


Volker Hetzer

unread,
Feb 24, 2006, 8:13:43 AM2/24/06
to
KarenM schrieb:
Unlike MD5 which does not encrypt anything (dunno who put that in your mind,
but MD5 is for signatures, not for encryption), WinZip (at least the newer
versions) does encryption and good one at that. Currently there's no known
method of breaking it.
As for how to use it, well you create a wsh object and run the command line
in it, wouldn't you? Wsh.Execute or something like that I suppose.

Since you keep on harping on MD5, would you kindly tru to figure out
whether your customer wants encryption or a signature? MD5 is no encryption
algorithm and if your customer wants MD5 then either he doesn't want encryption
or he too, doesn't know what he's talking about. No offense, seriously.

Lots of Greetings!
Volker

0 new messages