• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 753
  • Last Modified:

How do I decrypt cipher text in java which is encrypted by windows wincrypt and vice versa.

How can I decrypt cipher text in java, encrypted by wincrypt.h function CryptEncrypt. I am planning to use CALG_RC4.
0
ddas_auth
Asked:
ddas_auth
3 Solutions
 
mareqqCommented:
You can use the JCA/JCE provider or www.bouncycastle.org provider for cryptographic functions.
0
 
Infinity08Commented:
You can either implement it yourself using this information about RC4 :

        http://en.wikipedia.org/wiki/RC4

(also contains pseudocode and several links to more info). It's not very complicated.

Or use what mareqq suggested ...
0
 
CEHJCommented:
You might save yourself time and energy in the end by calling it in JNI
0
 
ddas_authAuthor Commented:
I think there are challanges in JNI. My program will run in user's windows xp computer. User's jre version and and classpath might be all different. One of the sun documentation mentioned that user has to first uninstall 1.4.0 before installing 1.4.2 in order to achieve correct JNI invocation. Similar things might happen with newer jre upgrade.

Last time I was working on JNI, I found a funny problem. I had to add location of jre jvm.dll to the "path" environment variable.
http://www.experts-exchange.com/Programming/Languages/CPP/Q_22612934.html
0
 
CEHJCommented:
Hmm. Sounds odd - it's the first i've heard of these issues.

>>All I had to do was set path=%path%;C:\Program Files\Java\jre1.5.0_11\bin\client;

What is 'client'?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now