bouncy castle?

can v use bouncy castle api's in java?i have used it in j2me....can it also b used with standard edition?
[120 byte] By [vinodha] at [2007-11-26 17:15:12]
# 1
Yes! I do so all the time.
sabre150a at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 2
how can i use bouncy castle api's in java?can u just give me instruction!!!!thnxwatin for yur reply!!
DaveAnjana at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 3
can u plz tel me wer 2 extract the java n org folders...also, is the compilation normal?
vinodha at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 4

> how can i use bouncy castle api's in java?

> can u just give me instruction!!!!

> thnx

> watin for yur reply!!

You don't really expect me to write a 100 page document on using Bouncy Castle when there is already documentation and examples - http://www.bouncycastle.org/documentation.html

sabre150a at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 5

> can u plz tel me wer 2 extract the java n org

> folders...

> also, is the compilation normal?

I don't really understand. Please use English as I don't speak SMS.

Again, there is already documentation and examples - http://www.bouncycastle.org/documentation.html

sabre150a at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 6
sorry for that,i want to know which zip file i have to download from bouncy castle.organd also where to extract those folders appropriately.thanx in advance.
vinodha at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 7

I find it best to download the 'grab the lot at one hit' i.e. crypto-135.tar.gz or crypto-135.tar.zip from http://www.bouncycastle.org/latest_releases . Just unzip and you will find the jars you need for the JDK you are using. You will need to add the appropriate jar to your class path.

From there, follow the documentation and examples.

sabre150a at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 8
can u plz help me with setting paths....pleasethanks in advance
vinodha at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 9
> can u plz help me with setting paths....please> thanks in advanceSorry, but this request means you need to look at the Java tutorial - http://java.sun.com/docs/books/tutorial/ .
sabre150a at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 10
Hi,I have installed crypto 135 and also done security setting in .security file.also scanned the bouncycastle.org site.But i am not able to start using it.I need a tutorial or detailed instructions for starting the use of bouncycastle.Please help me...
Radha_Krishna_Prasada at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...
# 11

There must be some tutorial information on their website. I know they have an examples on http://www.bouncycastle.org/documentation.html. Basically, you can use it in two ways. One way is exclusively through the JCE. You use the same Java classes like Cipher, MessageDigest, Signature, etc, but you explicitly specify the provider in the getInstance method. Here is small code fragment example

import java.io.*;

import java.security.*;

import javax.crypto.*;

import org.bouncycastle.jce.provider.BouncyCastleProvider;

public class BCastle1

{

public static void main(String[] args) throws Exception

{

Security.addProvider(new BouncyCastleProvider());

// "BC" is the name of the BouncyCastle provider

KeyGenerator keyGen = KeyGenerator.getInstance("DES", "BC");

keyGen.init(new SecureRandom());

Key key = keyGen.generateKey();

Cipher encrypt = Cipher.getInstance("DES/CBC/PKCS5Padding", "BC");

encrypt.init(Cipher.ENCRYPT_MODE, key);

ByteArrayOutputStream bOut = new ByteArrayOutputStream();

CipherOutputStream cOut = new CipherOutputStream(bOut, encrypt);

// ... other stuff omitted ....

}

}

Another way is to use the lightweight API directly. You use the classes whose Javadocs are at http://www.bouncycastle.org/docs/docs1.5/index.html just like any other Java classes.

ghstarka at 2007-7-8 23:43:12 > top of Java-index,Security,Cryptography...