bouncycastle

What is the output format of the SHA256withECDSA signature algorithm?

∥☆過路亽.° 提交于 2020-03-05 02:56:25
问题 I'm generating a key pair using the secp256k1 curve. Then I'm using the private key to sign a random String: byte[] content = "random string".getBytes(); Signature dsa = Signature.getInstance("SHA256withECDSA"); dsa.initSign(privateKey); dsa.update(content); byte[] signature = dsa.sign(); The signature byte array has the following content: [48, 68, 2, 32, 11, 25, 119, -64, -107, 53, -84, 65, -18, -81, -56, 34, 11, 29, 120, 38, -102, 105, -89, -9, -46, -28, 91, 59, -74, -103, -53, 117, 81, -37

Java 1.6 + BouncyCastle + TLS1.2 (handshake_failure(40))

安稳与你 提交于 2020-02-29 03:41:28
问题 In my case, I have Java 1.6 and want to connect to a remote server which only supports TLS1.2. Server URL is: https://blagajne-test.fu.gov.si:9002 and certificate public key is here: http://datoteke.durs.gov.si/dpr/files/test-tls.cer I have no possibility to upgrade Java because is a part of Oracle Database 11g (11.4). I tried to write a simple program in Java which uses BouncyCastel libraries but got error: Exception in thread "main" org.bouncycastle.crypto.tls.TlsFatalAlertReceived:

input too large for RSA cipher with BouncyCastle

懵懂的女人 提交于 2020-02-27 12:33:30
问题 I'm trying to write a service to SFTP to a server on a given interval, download all files in a directory, and then decrypt them for processing. The decrypt method was working at one point, and I have no modified it since. I am still using the same keys as when it did successfully work. I am using the PGPEncrypt, PGPDecrypt, and PGPEncryptionKeys classes for BouncyCastle found here: https://github.com/sledwith/PGP-Decryption-With-C-Sharp Additionally, I have modified the code as shown here:

BouncyCastle updated pgp key now getting checksum mismatch error

喜欢而已 提交于 2020-02-03 04:15:45
问题 I have a utility that is using the BouncyCastle.Crypto dll (version 1.7.4, runtime version 1.1.4), in order to decrypt a file that is given to it by another system. I just updated the pgp key (and provided the encryptor with the new public key). The new key uses 4096 bit RSA encryption and has a 24 character password, which are the only differences I can think of between the new key and the old key. The old key used I believe 2048 bit encryption with a 7 character password. When I attempt to

TLSv1.2 on Jboss 5.1.0 GA using Java 6 and BouncyCastle

北慕城南 提交于 2020-02-02 15:03:55
问题 I'm facing a problem with a Jboss server and the https connector, running on Java 6. I want to make my server using only TLSv1.2 and using the cipher suites "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" for decoding the certificate. I know that Java 6 does not support TLSv1.2, but I added the Bouncy Castle JCE and JSSE provider to the JDK (https://www.bouncycastle.org/latest_releases.html) : Added the JARs files ( bcprov-jdk15on-159.jar and bctls-jdk15on

TLSv1.2 on Jboss 5.1.0 GA using Java 6 and BouncyCastle

大憨熊 提交于 2020-02-02 15:00:30
问题 I'm facing a problem with a Jboss server and the https connector, running on Java 6. I want to make my server using only TLSv1.2 and using the cipher suites "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" for decoding the certificate. I know that Java 6 does not support TLSv1.2, but I added the Bouncy Castle JCE and JSSE provider to the JDK (https://www.bouncycastle.org/latest_releases.html) : Added the JARs files ( bcprov-jdk15on-159.jar and bctls-jdk15on

Is Bouncy Castle API Thread Safe?

﹥>﹥吖頭↗ 提交于 2020-02-01 02:04:09
问题 Is Bouncy Castle API 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 level cryptography support in my app. Since it is a web application, there are greater chances of multiple threads accessing this component at a time. So tread safety is essential here. Please let

Blowfish ECB Mode in BouncyCastle

喜夏-厌秋 提交于 2020-01-26 04:08:45
问题 This thread should not be for discussion on how bad ECB mode is, and that I should change it, but that BouncyCastle doesn't really support the mode, except for in Java, where you can use "getInstance". The code I am using is this, and it only decrypts the first block(0x1000 bytes) correctly. BufferedBlockCipher Blowfish = new BufferedBlockCipher(new BlowfishEngine()); KeyParameter r3 = new KeyParameter(Blowfish_Key); Blowfish.Init(false, r3); Blowfish.ProcessBytes(pio.GetBuffer(), 0, (int)pio

Can't get ECDSA signature to validate with public key

∥☆過路亽.° 提交于 2020-01-24 22:12:29
问题 I'm running out of ideas as to why my sample code won't verify the given EC public key, signature and message. I've converted the signature to ASN.1 format which is 70 bytes and the public key is 64 bytes plus uncompressed byte (0x04). I've also tried converting the message to SHA256 hash but that didn't work as well. The publicKey hex value is used to construct a ECPublicKey with prime256v1 curve. The signature is base64 decoded then formatted to ASN.1. I don't see what I could be doing

BouncyCastle .NET custom TlsClient for anon CipherSuite working on Android, but not Windows

蓝咒 提交于 2020-01-24 14:36:35
问题 I've got access to a java application, which uses the CipherSuite TLS_ECDH_anon_WITH_AES_256_CBC_SHA for communication (No possibility to use another one). Some time ago I had to write a Xamarin App in C#, which connected to it successfully using Bouncy Castle PCL. I had to use Bouncy Castle, since Android (>=6.0) does not allow to use the previously mentioned cipher suite by default. Now, I have to write a .NET application on Windows, which shall connect to the exact same Java application,