Questions tagged [bouncycastle]

Bouncy Castle is a cryptography API providing various cryptography, encryption, and security protocols. There are fairly similar libraries in both C# and Java that implement the API. Additionally, Bouncy Castle provides a JCE-compliant crypto provider for Java.

  • Generation and parsing of PKCS#12 files.
  • X.509: Generators and parsers for V1 and V3 certificates, V2 CRLs and attribute certificates.
  • PBE algorithms supported by PBEUtil: PBEwithMD2andDES-CBC, PBEwithMD2andRC2-CBC, PBEwithMD5andDES-CBC, PBEwithMD5andRC2-CBC, PBEwithSHA1andDES-CBC, PBEwithSHA1andRC2-CBC, PBEwithSHA-1and128bitRC4, PBEwithSHA-1and40bitRC4, PBEwithSHA-1and3-keyDESEDE-CBC, PBEwithSHA-1and2-keyDESEDE-CBC, PBEwithSHA-1and128bitRC2-CBC, PBEwithSHA-1and40bitRC2-CBC, PBEwithHmacSHA-1, PBEwithHmacSHA-224, PBEwithHmacSHA-256, PBEwithHmacRIPEMD128, PBEwithHmacRIPEMD160, and PBEwithHmacRIPEMD256.
  • Signature algorithms supported by SignerUtilities: MD2withRSA, MD4withRSA, MD5withRSA, RIPEMD128withRSA, RIPEMD160withRSA, RIPEMD256withRSA, SHA-1withRSA, SHA-224withRSA, SHA-256withRSAandMGF1, SHA-384withRSAandMGF1, SHA-512withRSAandMGF1, SHA-1withDSA, and SHA-1withECDSA.
  • Symmetric key algorithms: AES, Blowfish, Camellia, CAST5, CAST6, DESede, DES, GOST28147, HC-128, HC-256, IDEA, NaccacheStern, RC2, RC4, RC5-32, RC5-64, RC6, Rijndael, Serpent, Skipjack, TEA/XTEA, Twofish, and VMPC.
  • Symmetric key modes: CBC, CFB, CTS, GOFB, OFB, OpenPGPCFB, and SIC (or CTR).
  • Symmetric key paddings: ISO10126d2, ISO7816d4, PKCS#5/7, TBC, X.923, and Zero Byte.
  • Asymmetric key algorithms: RSA (with blinding), ElGamal, DSA, ECDSA.
  • Asymmetric key paddings/encodings: ISO9796d1, OAEP, and PKCS#1.
  • Digests: GOST3411, MD2, MD4, MD5, RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, Tiger, and Whirlpool.
  • Signer mechanisms: DSA, ECDSA, ECGOST3410, GOST3410, ISO9796d2, PSS, RSA.
  • Key Agreement: Diffie-Hellman and EC-DH.
  • Macs: CBCBlockCipher, CFBBlockCipher, GOST28147, HMac, and ISO9797 Alg. 3.
  • PBE generators: PKCS#12, and PKCS#5 - schemes 1 and 2.
  • OpenPGP (RFC 2440)
  • Cryptographic Message Syntax (CMS, RFC 3852), including streaming API.
  • Online Certificate Status Protocol (OCSP, RFC 2560).
  • Time Stamp Protocol (TSP, RFC 3161).
  • TLS/SSL Client with support for client side authentication.
3108 questions
1
vote
1 answer

Decrypt AES/OFB/NoPadding

I need to decrypt content encoded using the AES/OFB/NoPadding combo in C#. This doesn't seem to be supported natively: the following code won't do it as var aes = new AesManaged { Padding = PaddingMode.None, Mode = CipherMode.OFB, KeySize =…
ticofab
  • 7,551
  • 13
  • 49
  • 90
1
vote
1 answer

AES/EAX Crypto with JCE - Mac check in EAX failed

I am trying to perform encryption/decryption using AES/EAX/NoPadding. Since EAX doesn't appear to be available without BouncyCastle, BC has been added as a provider. When I try to encrypt "Hello World!", it appears to have encrypted…
Nick H
  • 8,897
  • 9
  • 41
  • 64
1
vote
1 answer

Please help me to fix the AES CTR mode Bouncy Castle code in C#

Bouncy Castle CRT Csharp, Decrypt failed to get the plain text Test failed static void Main(string[] args) { string toEncrypt = "This is a test string"; byte[] key = Encoding.ASCII.GetBytes("0123456789abcdef"); …
1
vote
0 answers

Perform S/MIME signing and checking signature immediately afterwards fails

The following source is a JUnit-Test that shows the problem in question. import java.math.BigInteger; import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.PrivateKey; import java.security.PublicKey; import…
Lothar
  • 5,323
  • 1
  • 11
  • 27
1
vote
1 answer

Bouncycastle add comments in header

In gpg you have the option to add comments to your signed file via the --comments option. Is there anything available for this on BouncyCastle icw Java ? For example in gpg : gpg --batch ^ --digest-algo SHA256 ^ --comment…
RvAPR
  • 11
  • 2
1
vote
1 answer

How do I read RSA public key from PEM file and use it to encrypt in BouncyCastle in C#?

The C# BouncyCastle contains a class called Org.BouncyCastle.Utilities.IO.Pem.PemReader that seem to take the RSA public key file in PEM format. I looked at this link: how can i convert pem public key to rsa public key with bouncycastle in c#? But…
Raghu
  • 2,859
  • 4
  • 33
  • 65
1
vote
1 answer

Bouncycastle fails in android API < 21

i am trying to run some spongycastle code in android: try { Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider()); ECGenParameterSpec spec = new ECGenParameterSpec("P-256"); KeyPairGenerator…
erik
  • 83
  • 6
1
vote
1 answer

How allow use user acts as another one on certificate level

I have problem with design of next business logic. I had server (S) acts as CA with some services, and many clients (A,B, ...) that registered on server. Each client has it's sertificate. Each client can sign his message so server can authorize…
qnikst
  • 302
  • 1
  • 9
1
vote
0 answers

How to implement a Pkcs12 export in Bouncy Castle

I'm wondering how to implement the export statement below analogical in Bouncy Castle. I'm completely new to Bouncy Castle and couldn't find a easy-to-understand introduction to this topic in general or my issue specifically. This is the openssl…
Osman
  • 571
  • 7
  • 19
1
vote
0 answers

NoSuchFieldError: id_tc26_signwithdigest_gost_3410_12_256

Have anyone experience this error? NoSuchFieldError: id_tc26_signwithdigest_gost_3410_12_256 What could be missing here? Here's the stacktrace: aused by: java.lang.NoSuchFieldError: id_tc26_signwithdigest_gost_3410_12_256 at…
quarks
  • 33,478
  • 73
  • 290
  • 513
1
vote
0 answers

spark-assembly-hadoop.jar: fat jar strips BouncyCastle provider of signature

The environment: Hadoop: 2.5.3.0-37 Spark: 1.6.2 Scala: 2.10.5 Java: 1.8 Quick summary: the fat jar spark-assembly-1.6.2.2.5.3.0-37-hadoop2.7.3.2.5.3.0-37.jar includes class-files from the BouncyCastle jar-file, and strips BouncyCastle's…
Kode Charlie
  • 1,297
  • 16
  • 32
1
vote
1 answer

How do I serialize a BCMcEliecePublicKey?

I want to serialize a McEliece public key (BCMcEliecePublicKey) but always get a NotSerializableException. java.io.NotSerializableException: org.bouncycastle.pqc.crypto.mceliece.McEliecePublicKeyParameters I tried the same code with XMSSMT and it…
1
vote
1 answer

Implement gost 28147-89 algorithm for encrypting and decripting in java using bouncycastle

I am trying to implement gost 28147-89 algorithm for encrypting and decrypting string. In the bouncycastle documentation I didn't understand how to implement gost 28147. How can I make a simple class which encrypts and decrypts a string using the…
dastan12
  • 25
  • 5
1
vote
3 answers

Encrypt file with BouncyCastle and only public key in C#?

New to PGP and I'm trying to encrypt a file through a C# console app. In my research it sounds as though BouncyCastle is one of the more popular ones to use. I found the following article and it looks like it would work just fine except that I only…
Caverman
  • 3,371
  • 9
  • 59
  • 115
1
vote
0 answers

bouncycsatle ecdsa verify signature failed though passing on openssl

I have generated EC curve keys using openssl and generated the signature using sha256 digest The data: 265a33bf7a514b6671e6e02aaee2383759348d9f openssl dgst -sha256 -sign key1.pem data > sig1 The public key file pubkey1.pem -----BEGIN PUBLIC…
anish
  • 6,884
  • 13
  • 74
  • 140