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

Posted on 2007-08-07
Last Modified: 2012-08-14
How can I decrypt cipher text in java, encrypted by wincrypt.h function CryptEncrypt. I am planning to use CALG_RC4.
Question by:ddas_auth
    LVL 1

    Assisted Solution

    You can use the JCA/JCE provider or provider for cryptographic functions.
    LVL 53

    Accepted Solution

    You can either implement it yourself using this information about RC4 :


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

    Or use what mareqq suggested ...
    LVL 86

    Assisted Solution

    You might save yourself time and energy in the end by calling it in JNI
    LVL 1

    Author Comment

    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.
    LVL 86

    Expert Comment

    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'?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now