473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Encryption

I have to make an Encrytion function that works for both VB.NEt and VB 6. I
use the System.Security.Cryptography in VB.NET and I want to use the same
type of functions in VB6.

I USE DPAPI to store some keys in registry and I want to use the same keys
both in VB6 and VB.NET. The DPAPI works fine in both. The problem is the
Encryprion/Decryption using advapi.dll

I have converted the classes from
http://msdn.microsoft.com/library/de...SecNetHT10.asp
to VB and I want the same classes/methods in VB6.

Anyone who has the same problem ? Any tips, hints ?

--
Regards
Robert Vabo
Gecko AS
www.gecko.no
Nov 20 '05 #1
3 2240
One easy way if you don't mind having your VB6 app relying on the presence
of .NET framework is by putting your VB.NET encryption code in a COM class
(ie instead of add a new class in VB.NET, you add a new COM class), build,
and add a reference in your VB6 app to that COM class. You will need both
sets of binaries (VB.NET and VB6) as well as .NET framework to run your VB6
app but it should work.

Nov 20 '05 #2
Thanks for the answer.
I have now made the component a COM component. I call it from VB6 but I get
this error message :
"Function or interface marked as restricted, or the function uses an
Automation type not supported in Visual Basic". Any suggestions.
I have made all the methods public.
--
Regards
Robert Vabo
Gecko AS
www.gecko.no

"Ting Liang (MSFT)" <tl****@online.microsoft.com> skrev i melding
news:vA**************@cpmsftngxa06.phx.gbl...
One easy way if you don't mind having your VB6 app relying on the presence
of .NET framework is by putting your VB.NET encryption code in a COM class
(ie instead of add a new class in VB.NET, you add a new COM class), build,
and add a reference in your VB6 app to that COM class. You will need both
sets of binaries (VB.NET and VB6) as well as .NET framework to run your VB6 app but it should work.

Nov 20 '05 #3
You should create a VB.net ClassLibrary project (named ClassLibrary1),
remove Class1 and create a new COM class (ComClass1). Implement your
encryption function in ComClass1, eg Public Function Encrypt(...). Build
ClassLibrary1 project. After building you should be able to find
ClassLibrary1 in VB6's Project->References dialog. Check it in the dialog.
You should then be able to write something like Dim x as New
ClassLibrary1.Class1, and make calls x.Encrypt(...) to it.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cliff | last post by:
We are trying to connect to 3 different Oracle databases using MS Access as the front-end and ODBC as the connection. The problem that we are having is that 1 of the databases requires a...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
7
by: Alan Silver | last post by:
Hello, I am writing a page where sensitive data is collected (over SSL) and stored in a database. I have been looking at the .NET encryption classes, but am a bit confused as to which is best...
2
by: Sumit Gupta | last post by:
Can anyone please tell me how to encrpt string or any kind of Data. Also the Algorithm of Compression. Any Link tutorial etc. Like : Zip or RAR Formats etc.
9
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be...
4
by: pintu | last post by:
Hello everybody.. I hav some confusion regarding asymmetric encryption.As asymmetric encryption it there is one private key and one public key.So any data is encrypted using private key and the...
1
by: =?Utf-8?B?bWljcm9ob2Y=?= | last post by:
Short version: Is there a way to configure (preferably programmatically) the max encryption strength that will be used by the framework when connecting to a particular SSL-protected web service? ...
11
by: John Williams | last post by:
I've written a simple program to do XOR encryption as my first foray into understanding how encryption works. The code compiles fine, however it segmentation faults on every run. using gdb to...
22
by: j1mb0jay | last post by:
I have had to create a simple string encryption program for coursework, I have completed the task and now have to do a write up on how it could be improved at a later date. If you could look...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.