bouncycastle

Is Bouncy Castle API Thread Safe ?

Is Bouncy Castle API (http://bouncycastle.org/java.html) Thread Safe ? Especially, org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher org.bouncycastle.crypto.paddings.PKCS7Padding org.bouncycastle.crypto.engines.AESFastEngine org.bouncycastle.crypto.modes.CBCBlockCipher I am planning to write a singleton Spring bean for basic l...

scp via java

What is the best method of performing an scp transfer via the Java programming language? It seems I may be able to perform this via JSSE, JSch or the bouncy castle java libraries. None of these solutions seem to have an easy answer. ...

Dazed and confused by Java Security & BouncyCastle APIs

I've been trying to make sense of the BouncyCastle cryptography APIs for Java. Unfortunately, I'm finding Java cryptography in general to be so obscured by service provider interfaces and jargon that I can't wrap my head around what anything actually does. I've tried reading the necessary documentation repeatedly but it just stays incomp...

PGP Encryption with BouncyCastle C# causes invalid key warning on signature verification

We need to PGP encrypt files and send them over FTP to a third party. The files are encrypted with the DH/DSS public key of the third party and signed with our private key. The third party have our public key and their own private key. The encryption/decryption works, but the third party are getting warnings when they try to verify our ...

Not able to access BouncyCastle jar from application jar

Hello All, I have made jar file for my application. One of the class of my application uses BouncyCastleProvider class of BC jar. I have created one folder "lib" in the same parent folder where my application jar is residing. I have changed my machine CLASSPATH to point to this new lib folder. But when I run my application it gives me...

Are there any other open source JCE libraries besides BouncyCastle?

I am looking for open source JCE libraries that implement some of the more esoteric encryption algorithms so that I can study their implementation. I would be especially interested in ones that implement Identity Based Encryption (IBE) as published by Stanford. ...

Encrypting a BouncyCastle RSA Key Pair and storing in a SQL2008 database

I have a function that generates a BouncyCastle RSA key pair. I need to encrypt the private key and then store the encrypted private and public keys into separate SQL2008 database fields. I am using the following to get the keypair: private static AsymmetricCipherKeyPair createASymRandomCipher() { RsaKeyPairGenerator r = new RsaKeyPai...

Generating 128-bit keys with keytool

Is there a way to generate a 128-bit key pair suitable for encryption using Sun's keytool program? It seems that the algorithms available in http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#KeyPairGenerator are either not supported or do not allow keys shorter than 512 bits. The key pair will be used with ...

problem passing private key and public key?

hi i need to pass the public key and private key in string format for encryption and decryption in pgp.i ve generated the keys like this but i am not able to use those.so can anyone tell me how to get the public key and private key in string format from this.and also the rsakeygenerator has not given the passphrase for private key. so wh...

How do I get started using BouncyCastle?

So after CodingHorror's fun with encryption and the thrashing comments, we are reconsidering doing our own encryption. In this case, we need to pass some information that identifies a user to a 3rd party service which will then call back to a service on our website with the information plus a hash. The 2nd service looks up info on tha...

generation of public,private and passphrase in pgp?

hi can anyone tell me how to generate pgp public, private and passphrase using bouncy castle in c#? ...

problem generating pgp keys?

I'm using RSACryptoServiceProvider I've generated public key and private key. The keys generated by it are in the following format: Public key: <RSAKeyValue> <Modulus>m9bAoh2...eGNKYs=</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> Private key: <RSAKeyValue> <Modulus>m9bAo...ZAIeGNKYs=</Modulus> <Exponent>AQAB<...

Timestamp Response is Incorrect - BouncyCastle

Hi, Trying to request a timestamp (RFC 3161) by using BouncyCastle and connecting to http://timestamping.edelweb.fr/service/tsp. I do get a TimestampResponse back from the server but it seems to be without an actual date. This is the code: public static void main(String[] args) { String ocspUrl = "http://timestamping.edelweb.fr/se...

InvalidCipherTextException: pad block corrupted

my code is as below while running it i got the error as shown, // TODO Auto-generated method stub String user = request.getParameter("user"); HttpSession session = request.getSession(); CryptoEngine inCipher = (CryptoEngine) session .getAttribute("inCipher"); CryptoEngine outCipher = (CryptoEngine) session .getAttrib...

Using "strong" JRE policy files with BouncyCastle

Cryptography newbie here... I'm trying to do 128-bit encryption using BouncyCastle with the code below. import java.io.BufferedOutputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.security.KeyStore; import java.security.Security; import java....

BouncyCastle RSAPrivateKey to .NET RSAPrivateKey

I'm creating a certificate distribution system to keep track of clients and stuff. What happens is: Client send CSR to Server Server checks and signs certificate Server sends Signed certificate to Client Client puts Signed certificate plus Private key in Windows store. So on the client this happens: //Pseudo Server Object: Server s...

BouncyCastle Last Byte Decrypt Problem

I am decrypting an XML file from the file system using Bouncy Castle. I output the decrypted text and get a fatal error SAXParseException on the very last byte of data. Below is my decryption method and the setup of the cipher object. I was initially using cipher streams, and everything worked perfect (commented out code was my stream)...

Generate authenticated CMSEnvelopedData Messages with bouncycastle

I am trying to encrypt data with a password and store it inside a ASN.1 encoded CMS message (using C# and BouncyCastle 1.4) The code I have seems to have two problems: the data does not seem to be signed with a HMAC, so when I tamper with the encodedData (by enabling the commented out line), the decryption still succeeds. when I decry...

Bouncycastle: what does the subKeyID-Parameter of AddKeyTransRecipient do?

I'm trying to asymetrically encrypt a message of arbitrary length with bouncycastle. (1.4+ with C#) This is the code I have right now. It is supposed to (but doesn't) generate a CMS message where the data itself is encrypted with AES256 with a random key and the key is encrypted with the public key from keyPair. keyPair is an RSA-Key ...

Get REAL X.509 data from RFC1421 formatted certificate.

We have a Java application that stores RSA public keys and allows a user to encrypt a short stream of information with any of the keys. The application also allows the user to import a new key certificate into the keystore. When we load the certificate from a file, we want to use the common name (CN) as the alias. Here is the problem: C...