My problem is two fold.
1) I must support a deployed legacy application written in VB6 SP5. I
need to export data from a database, compress it and the encrypt the data
using 3DES (to prevent tampering) data gets transmitted at night to the home
office of my company. Rewriting this application in .NET is not an option as
the application was 5 years in development.
2) After I receive the data from the outlying offices, I need to Decrypt
the data using VB.NET 2003 and the Cryptography namespace prior to
transforming the data into an AS/400.
I have successfully written VB6 code which encrypts and decryptes the data
through calls to advapi32.dll. Unfortunately, any attempts to decrypt these
files using VB.NET's Cryptography namespace results in a error and the
attempt always fails.
Can someone give me some examples or guidance in VB6 to VB.NET data 3DES
encryption/decryption??? I am really stumped on this topic. Sample code
would be nice!!! Remember the conditions - Encypt Under VB6 / Decrypt Under
VB.NET 2003.
Thanks
underwmd
For the microsoft news server, try these newsgroups...
microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general
There are some others, but these should get you started.
Rick - MVP
"underwmd" <nos...@nospam.net> wrote in message
news:aRugc.13424665$Of.22...@news.easynews.com...
If you were to take note, I posted this to a total of 7 groups encompassing
both VB Classic and VB.NET. With this, I hoped to stir up someone whom is
in a unique situation such as myself whom has to support both platforms
1. microsoft.public.dotnet.framework
2. microsoft.public.dotnet.framework.interop
3. microsoft.public.dotnet.general
4. microsoft.public.dotnet.languages.vb
5. microsoft.public.vb.com
6. microsoft.public.vb.winapi
7. microsoft.public.vb.winapi.networks
This is not the first time I have posted to the USENET.
Michael
"Rick Rothstein" <rickNOS...@NOSPAMcomcast.net> wrote in message
news:%23mHTbmU...@tk2msftngp13.phx.gbl...
Encrypting data with CryptoAPI
http://www.mvps.org/emorcillo/vb6/crypto/encrypt.shtml
You can then decrypt it in vb.net using this function:
Private Function DecryptData(ByVal data() As Byte, ByVal password As String)
As Byte()
' Create the 3DES service provider
Dim tdes As New TripleDESCryptoServiceProvider
' Create a PasswordDeriveBytes to derive the key
' from the password
Dim passderive As New PasswordDeriveBytes(password, Nothing)
Dim iv As Byte() = New Byte() {0, 0, 0, 0, 0, 0, 0, 0}
' Derive the key from the password
tdes.Key = passderive.CryptDeriveKey("TripleDES", "MD5", 0, iv)
tdes.IV = iv
' Get the decryptor
Dim decryptor As ICryptoTransform = tdes.CreateDecryptor
' Decrypt the data
DecryptData = decryptor.TransformFinalBlock(data, 0, data.Length)
decryptor.Dispose()
End Function
--
Eduardo A. Morcillo [MS MVP VB]
http://www.mvps.org/emorcillo
Rick - MVP
"underwmd" <nos...@nospam.net> wrote in message
news:joxgc.13342255$Id.22...@news.easynews.com...
I'll try your recommendations and get back with you.
In the mean time to enlighten me on this issue further:
Can you refence a document to me to give me an idea of how to combine the
hashing with the encryption technique, how would I have known without your
reply to use a zeroed byte array for the IV array. The security and
encryption of VB classic and VB.NET is all new to me.
Thank you for your time
Michael Underwood
"Eduardo A. Morcillo [MS MVP VB]" <emorcillo_at_mvps.org> wrote in message
news:umTQj4VJ...@TK2MSFTNGP12.phx.gbl...
Then you should know that you should NOT cross-post?
That's obviously correct ... but only accidentally.
microsoft.* is not USENET.
Bob
--