bouncycastle

Deriving ECDSA Public Key from Private Key

落花浮王杯 提交于 2020-01-11 03:37:25
问题 I was attempting to generate a public ECDSA key from a private key, and I haven't managed to find much help on the internet as to how to do this. Pretty much everything is for generating a public key from a public key spec, and I don't know how to get that. So far, this is what I've put together: public void setPublic() throws GeneralSecurityException { ECNamedCurveParameterSpec params = ECNamedCurveTable.getParameterSpec("secp256k1"); KeyFactory fact = KeyFactory.getInstance("ECDSA", "BC");

Problem transmiting a RSA public key, javaME , bouncy castle

余生颓废 提交于 2020-01-10 03:12:07
问题 I'm working on the porting of an instance messaging application from Java to JavaME ,that also implements cryptography. The problem is that I want to send my public key to the server. The desktop client has this code for this job: byte[] encoded_public_key=publick_key.getEncoded(); And the server has this code to retrieve the key: EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encoded_public_key); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PublicKey puKey = keyFactory

Problem transmiting a RSA public key, javaME , bouncy castle

你说的曾经没有我的故事 提交于 2020-01-10 03:12:05
问题 I'm working on the porting of an instance messaging application from Java to JavaME ,that also implements cryptography. The problem is that I want to send my public key to the server. The desktop client has this code for this job: byte[] encoded_public_key=publick_key.getEncoded(); And the server has this code to retrieve the key: EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(encoded_public_key); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PublicKey puKey = keyFactory

Verification of PGP signature using BouncyCastle

家住魔仙堡 提交于 2020-01-06 18:40:34
问题 I've generated a PGP Signature: -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBBABCAAGBQJYnkPxAAoJEBFjzYGyXBOsXRoH/3O4bwKK45aUN+m0N4jsZ+n5 W8R/aGti/llvJ62tHBCO5BIp/pp+b1Gdv99xtnJXHu/f0TqPYj+fwq4vfaorNTtA Vtq8MaMesw1OWZEfu/lyjNOwdg81FUlYkw0Bjo3H/MxWjWYUiHmJo+OGriyf5dv/ 433ZqitZMxLHCfZsuoU5teZ0BPUSoNjF6hOFK3ZI7QXsgYUyohzW2goy9bDVCKRq e73CHpnMKCrnDc+/4+sK349bD/cZp6/c0T8b7cBCeBGGilPD6ovJUQE5vhGTKnJM lgyxhA87tw9wqFwpZXDr0nzOP+MFfE9WRGecVYZ9G+LP/biefSe5iWRaPIcZIi0= =qUHb -----END PGP

Verification of PGP signature using BouncyCastle

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 18:40:29
问题 I've generated a PGP Signature: -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBBABCAAGBQJYnkPxAAoJEBFjzYGyXBOsXRoH/3O4bwKK45aUN+m0N4jsZ+n5 W8R/aGti/llvJ62tHBCO5BIp/pp+b1Gdv99xtnJXHu/f0TqPYj+fwq4vfaorNTtA Vtq8MaMesw1OWZEfu/lyjNOwdg81FUlYkw0Bjo3H/MxWjWYUiHmJo+OGriyf5dv/ 433ZqitZMxLHCfZsuoU5teZ0BPUSoNjF6hOFK3ZI7QXsgYUyohzW2goy9bDVCKRq e73CHpnMKCrnDc+/4+sK349bD/cZp6/c0T8b7cBCeBGGilPD6ovJUQE5vhGTKnJM lgyxhA87tw9wqFwpZXDr0nzOP+MFfE9WRGecVYZ9G+LP/biefSe5iWRaPIcZIi0= =qUHb -----END PGP

Inverse operation to `PublicKeyFactory.CreateKey()`

試著忘記壹切 提交于 2020-01-06 11:45:50
问题 Using Bouncycastle with C#, what is the inverse operation to: byte[] publicKey; AsymmetricKeyParameter asymmetricKeyParameter = PublicKeyFactory.CreateKey(publicKey); RsaKeyParameters rsaKeyParameters = (RsaKeyParameters)asymmetricKeyParameter; I.e. I have a RsaKeyParameters object containing a public key and want to convert it to a byte array in such a way that I could feed it back in to PublicKeyFactory.CreateKey() 回答1: The inverse operation for public keys should be: byte[] publicKey =

replace JCE with Bouncycastle jar

别来无恙 提交于 2020-01-06 05:07:09
问题 I have to get rid of JCE jars and should be replaced with bouncy castle jar for AES encryption and decryption. I am getting invalid key size exception when i replace JCE policy jars with BC jars for AES 256 algorithm. But it works well with key size 128. How can i make use of BC jars in case of AES 256 algorithm. Thanks. 回答1: This answer assumes that it is not possible to install the unlimited strength jurisdictional cryptography files using the scripting mentioned. The key size restraint of

java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1Encodable

爷,独闯天下 提交于 2020-01-06 04:19:12
问题 I am using IText 4.2.0 and bcprov-jdk15-1.43.jar and bctsp-jdk15-1.43.jar for signing pdf. I added these jars by add external jars button in Eclipse. When I execute it gives me following error. ExceptionConverter: java.lang.Exception: Failed to get TSA response from tsaURL at com.lowagie.text.pdf.TSAClientBouncyCastle.getTimeStampToken(TSAClientBouncyCastle.java:185) at com.lowagie.text.pdf.TSAClientBouncyCastle.getTimeStampToken(TSAClientBouncyCastle.java:136) at com.lowagie.text.pdf

Decrypt an AES encoded message (encrypted in Python) in Java

微笑、不失礼 提交于 2020-01-05 07:23:21
问题 I want to decrypt an AES encrypted message in Java. I’ve been trying various Algorithm/Mode/Padding options from the standard library and from BouncyCastle. No luck :-( The encrypting entity is written in Python and is already in production. Encrypted messages have already gone out, so I cannot easily change that part. The Python code looks like this: from Crypto.Cipher import AES import base64 import os import sys BLOCK_SIZE = 16 PADDING = '\f' pad = lambda s: s + (BLOCK_SIZE - len(s) %

Is there a smaller version of the BouncyCastleProvider on android?

∥☆過路亽.° 提交于 2020-01-05 04:48:28
问题 I'm developing an android honeycomb app that requires the use of the BouncyCastle library (bcprov-jdk15-143.jar). I've included this jar in my libs folder and added it to my build path. Unfortunately, it's relatively large (1.6 Megs) and it takes several minutes for Eclipse to package it up into Dalvik byte code. This is making it very slow to develop as each time I want to test my changes, I need to wait for the packaging to finish. The requirement for BouncyCastle comes from using google's