Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / November 2007



Tip: Looking for answers? Try searching our database.

Difficult one: decrypt files with win api

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vonClausowitz - 13 Nov 2007 16:19 GMT
Hi All,

I want to know if there is a way to decrypt files that have been given
a encryption in windows, using a winapi in VB.

If you have a file in windows and right click properties you can set
under advanced the protection (encryption). That way only a pc with
the right certificate can read the file. But now I want to remove the
encryption from the file under VB. The certificate is on the computer
where i run the VB program.

Marco
Ralph - 13 Nov 2007 16:57 GMT
> Hi All,
>
[quoted text clipped - 8 lines]
>
> Marco

Yes, well usually. But first, Encryption routines are not technically part
of the "WinApi", one needs to determine what encryption library is in use.
This can likely be determined by your O/S and what you have installed.

Also you might consider just using the shell.

What is the OS?

-ralph
vonClausowitz - 13 Nov 2007 17:14 GMT
> > Hi All,
>
[quoted text clipped - 18 lines]
>
> -ralph

Ralph,

We don't fancy the Shell.
We are using Win NT.

Marco
Ralph - 13 Nov 2007 17:58 GMT
> > > Hi All,
> >
[quoted text clipped - 23 lines]
> We don't fancy the Shell.
> We are using Win NT.

Whoa! Too old for me. All my links are broken. <g>

IIRC, you need to research the "CryptoAPI". I have never seen anything
written in VB, it was always accessed using C. But it should be easy enough
to create a wrapper.

Someone else will be along shortly.

-ralph
mayayana - 14 Nov 2007 14:36 GMT
> IIRC, you need to research the "CryptoAPI". I have never seen anything
> written in VB, it was always accessed using C.

That's capicom.dll, which is downloadable and redistributable.
I started looking into it awhile back for some reason but
then never ended up using it. I imagine there's a version
for NT4 (if that's what was meant by "NT"), but the link I
found for v. 2.1.0.2 doesn't list NT4 as supported.

http://www.microsoft.com/downloads/details.aspx?FamilyId=860EE43A-A843-462F-
ABB5-FF88EA5896F6

 You may have to look for an older version download
of an older version that supports NT4. Or it may be
possible to just unpack the download MSI file and
register capicom.dll on NT4.

 There are VB samples in this:

"Wiley CryptoAPI COM Objects"

Try a search for the above title or "wcco". The download
zip I have is wcco10.zip

 There are also limited samples in the MS download.

 I don't know whether capicom is actually what you
want, but it's probably worth checking into. I tried
to get a general list of supported functions in the DLL
but the reference link was broken on the above page.

(I sometimes almost wonder whether MS is going out of
business. Their whole website is a mess and I seem to
find nothing but broken links lately.)

 According to the docs, EncryptFile is in the kernel
and starts with Win2000, so I guess the OP
doesn't want that.
Timo Kunze - 13 Nov 2007 18:41 GMT
Have a look at the DecryptFile API function.

Timo
Signature

www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."

vonClausowitz - 14 Nov 2007 13:38 GMT
> Have a look at the DecryptFile API function.
>
> Timo
> --www.TimoSoft-Software.de- Unicode controls for VB6
> "Those who sacrifice freedom for safety deserve neither."

Timo,

Had a look around, there ain't much out there.
Do you have an example on this API?

Marco
Timo Kunze - 14 Nov 2007 18:51 GMT
vonClausowitz schrieb:
> Had a look around, there ain't much out there.
> Do you have an example on this API?
It's straight forward:
LPTSTR pPath = _T("C:\\MyFile.txt");
BOOL succeeded = DecryptFile(pPath, 0);

Timo
Signature

www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.