Log in

View Full Version : Need Help Converting Public Function from VB6 to VBA Access97 (Serpent encrytion)



HelloEarth
12-15-2011, 10:23 AM
I need to convert a VB6 Class Module to work in Access VBA Class Module

I'm adding it to an existing Access 97 Pro SR2 Database running on a WinXP Pro SR3 computer.

To get this working properly, I believe I just need to convert two Public Functions called DecodeArray64, and set_key
But I just don't get/fathom what type of array it is in VB6... :banghead:
As a result I've been unable to convert it over to VBA.


I have changed what I do know of VB6 to VBA conversions. And I just commented out the original code.
Enum, commented-out and it became a Type and Const
RaiseEvent Progress, then became Hourglass and acSysCmdUpdateMeterNote: The Hourglass DoCmd's (x4) are commented-out until the code works.


Anyways I've attached in the Class Module for Access97
It saved as a Plain ASCII Text file.

It is the encrytion algorithm for Serpent which is a symmetric key block cipher algorithm. (Yes, the Serpent cipher is open source, and license-free.) Have a look at wikipedia.org and search for: Serpent (cipher)

HelloEarth
12-15-2011, 10:39 AM
Whoops! :doh:
Please ignore my reference above to:

Enum, commented-out and it became a Type and Const

I did that in my attempt to transfer the Twofish encryption before settling on the Serpent encryption. This was because Serpent seemed to have fewer VB6 proprietary references then Twofish...

Like Serpent, Twofish is also unpatented, with uncopyrighted source code, and it is license-free!

HelloEarth
12-15-2011, 01:51 PM
I had mentioned the Twofish code, and I've attached it here.

It might be easier after all, since it only has 1 public function (called DecodeArray64) that I'm unable to convert.


Meanwhile, I've tried emailing the author of both VB6 versions, David Midkiff.
The email address "mznull@earthlink.net" is (not surpisingly) no-longer valid.


So if anyone can help me with code, or contacting the author... :help
I would greatly appreciate it.

HiTechCoach
12-17-2011, 08:28 AM
This may help: Encryption (http://www.hitechcoach.com/index.php?option=com_docman&task=doc_details&gid=32&Itemid=28)

HelloEarth
12-22-2011, 06:48 AM
Thanks HiTechCoach
Just a quick note.
I opened it with Access 2003 and it easily ported to Access97 format.
But I haven't tested the 97 version to see what works or broken...

I haven't had time to do anything with it yet, since it is the season! :rudolph:
Hopefully in the next week or so I'll get the chance.

HelloEarth
12-23-2011, 09:44 AM
I took the time to look through some of the code and it appears (at first glance) that there's no salt being added, and no option to do so...
And the code seems to rely heavily on XOR-ing.
So, I'll have to do some testing and see if the resulting encryption is open to a simple stream cipher attack (in Free Pascal) when I've a little time to do so.

HiTechCoach
12-23-2011, 12:59 PM
Please let us know your result of the test. I am curious to hear how well the encryption works.