bouncycastle

Send encripted data from a middlet to a servlet

What the best solution for send encripted data from a middlet to a servlet if I have to send small data in fast manner I try https but the data is inflate, "I don't why" I this moment I have implemented AESLigthEngine with CBC mode (block mode) because CFB mixed mode is slow ...

Is it possible to programmatically generate an X509 certificate using only C#?

We're trying to generate an X509 certificate (including the private key) programmatically using C# and the BouncyCastle library. We've tried using some of the code from this sample by Felix Kollmann but the private key part of the certificate returns null. Code and unit test are as below: using System; using System.Collections; using Or...

Illegal Argument Exception while decrypting with Bouncy Castle Crypto

Hi , Can any one point me in the right direction. I am not sure why I am getting an illegal argument exception while decrypting a key. This used to work earlier. Here is the stacktrace. java.lang.IllegalArgumentException: DES key too long - should be 8 bytes at org.bouncycastle.crypto.engines.DESEngine.init(Unknown Source) at...

Bouncy Castle doesn't supports ELGAMAL_ENCRYPT for message signing

Hi, I am using BouncyCastle library for cryptography. I was using DSA/RSA keys initially to transfer the message and it was all working fine Now I have to switch to DSA + ElGamal key pair for the signing/encryption of the message. but it doesn't seems to be working. The first step that I perform before sending the message is signing. ...

Solved: Why is desktop AES file IO incompatible with Android AES file IO?

I have ported an application from Android to desktop that uses AES to encrypt some private data. Both applications are able to encrypt and decrypt the data for their own use but unable to decrypt the other applications data. The AES keys, IVs, and algorithms are identical. The main difference between the two applications is that the andr...

Reimplement AES encryption using third-party Java library without US law limitations

I've implemented AES encryption with certain task-specific parameters using standard Java tools and BouncyCastle provider for specific AES algorithm. Here is the code: private byte[] aesEncryptedInfo(String info) throws UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException, InvalidKeyException, NoSuchAlgorithmExc...

How to export non-exportable private key from store

I need to export private key from Windows store. What should I do if key marked as non-exportable? I know that it is possible, program jailbreak can export this keys. To export key I use Org.BouncyCastle.Security.DotNetUtilities.GetKeyPair() that export key from (RSACryptoServiceProvider)cryptoProv.ExportParameters(true). Exported key I...

Java SCEP Messages from a Microsoft SCEP/CA Server

Hello there, A bit of a long shot here, but this site has continued to impress. Recently I've been doing a bunch of work with SCEP (Simple Certificate Enrollment Protocol). Specifically I've been tasked with writing a SCEP/CA server and a client to get certificate from my and other SCEP servers. So I'm really, really close to being don...

How to encrypt a string/stream with bouncycastle pgp without starting with a file

I need to encrypt a stream with pgp using the bouncycastle provider. All of the examples I can find are about taking a plain text file and encrypting that however I won't have a file and it's important that the plain text never be written to disk. Most of the methods I've seen are using PGPUtil.writeFileToLiteralData which wants the p...

Get Start with BouncyCastle crypto dll c#

I'm starter with cryptography I woul like to use BouncyCastle .dll for c# but I cannot found documentation and examples. In particulary I need to use to sign files with pkcs#7 (.p7m results) and add to them RFC 3161–compliant, time stamps from trusted server (.m7m results). somebody can suggest where I can found examples and documenta...

how can sign a file with BouncyCastle dll in c#

I starting with BouncyCastle Crypto dll and I'n not found enought documentation. I need one example of how can I sign a file with different alghoritms Like sha1 sha256 and other and obtain .p7m file. Can somebody help to me ? Many thanks in advance Piercarlo ...

Bouncycastle pgp decryption correct size but all blank

When I call this, it successfully encrypts my string but the output of the decrypted text is blank. I get no errors and the byteArray of the output string is of the correct lenth (102), however it's just 102 zeros. This is adapted from the KeyBasedFileProcessor example but is attempting to be stream/string based instead of file based. ...