Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Decryption

Status
Not open for further replies.

andrewlee

Programmer
May 28, 2000
31
NZ
I'm trying to use the _cryptapi and VFP9 to decrypt a file.

I know the following :

The password. It is 24 Bytes long.
The CSP needs to be Microsoft Enhanced Cryptographic Provider v1.0
Data encryption standard is 3DES
Encryption mode is ECB

I can't get the right result from _cryptapi class. Changing the provider in Wincrypt.h doesn't seem to make any difference.
Can anyone tell me how to configure _crytapi to work with the above values, or is there another class or Active X that would be suitable ?

Cheers
Andy
 
Is it possible the password is seeded?

That means something is added to it before the password

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are not good for you.
 
Was the data encrypted in the same computer or on another computer with another Windows version?
There is a known mismatch in the crypto providers between XP and later OSes, that's all I remember.

Googling I find:
You may also deep dive into
And see which points to
Bye, Olaf.
 
Thanks Griff and Olaf

The data file was originally encrypted on an unknown computer and unknown Windows version in a commercial program that was written in C++.
When the program runs, it decrypts a file and uses that information to run a section of the program.
This program is run on many different computers throughout the world and works OK.

The program includes a .DLL where calls are made to CryptDecrypt() and other functions that presumably use the MS Enhanced CSP to perform the decryption.

I'm guessing that if I can get the correct configuration of _cryptapi I should be able to decrypt the file.

I've updated the cProvidername property to Microsoft Enhanced Crytographic Provider v1.0 but can't find where to tell it to use the 3DES mode or the ECB setting.
(dnCRYPT_MODE_ECB in wincrypt.h).

Looking through the eTutorials, I understand that with 3DES,Block Encryption would be used.

Tricky business, this - so many unknowns to get right. Am I chasing rainbows here ?

Cheers
Andy



 
Am I chasing rainbows here ?

Possibly.

One thing needs to be pointed out here....

The data file was originally encrypted on ... in a commercial program that was written in C++.

Ummm ... so someone went to great lengths to prevent you from doing what you're trying to do and you're asking us to help you do it? Is what you're doing even legal?

Aside from that, you've made a lot of guesses about what was actually done and can't get it to work. Could your initial guesses be off the mark?
 
Yes all legal and above board Dan. The encrypted data is an .xml file which controls whether a couple of checkboxes are displayed on screen or not. I want to stop these controls being available to certain staff members.

The decryption configuration options are not guesses. They were supplied to me by a C++ programmer who needed to do exactly the same thing ( as have many other users of this rather frustrating program ) and he has performed a successful decryption.


 
If you have the password to decrypt and know all the details of the algorithm used, then I see no legal issues. If you would have got knowledge on these informations illegally, it would be rather ironic, you fail on the doing.

Do you not have the application, which encrypted the xml to decrypt it, too?

Bye, Olaf.
 
One other thought: If the config file is containing some sort of "license" for the options available in an app, this app does decrypt it, doesn't it? What happend, when you remove the file (don't delete just move somewhere else=. I assume then the app won't start at all? Or funktionality is shrinked down to a shareware status?

Bye, Olaf.
 
Hi Olaf

I removed the encrypted file and the program ran OK but when I tried to access this particular screen, it crashed.

I may now change tack and look more closely at the calling .dll and investigate some of its relevant functions.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top