bouncycastle

Android: CyanogenMod 7 (Android 2.3) + BouncyCastle encryption libraries: IllegalAccessError

丶灬走出姿态 提交于 2019-12-23 04:46:02
问题 I'm getting a strange error when using bouncycastle libraries: ERROR/AndroidRuntime(1226): FATAL EXCEPTION: Thread-10 ERROR/AndroidRuntime(1226): java.lang.IllegalAccessError: tried to access class org.bouncycastle.crypto.engines.RSACoreEngine from class org.bouncycastle.crypto.engines.RSAEngine ERROR/AndroidRuntime(1226): at org.bouncycastle.crypto.engines.RSAEngine.init(Unknown Source) ERROR/AndroidRuntime(1226): at org.bouncycastle.crypto.encodings.PKCS1Encoding.init(PKCS1Encoding.java:90)

BouncyCastle on the server side with Android phones as clients

本小妞迷上赌 提交于 2019-12-23 03:37:09
问题 I'm currently having some difficulties with getting BouncyCastle to work. Been searching on this for a couple of days now, so I'm hoping you can provide any helpful insights. Here's the set-up. Using REST-protocol, the Android-client sends POST-messages to the server. I made a separate project with classes representing these messages, so that I can include this as a library on both the client and the server. The message-objects are first parsed to a JSON-string and afterwards interpreted on

Java keyStore does not properly store X509 certificate chains

我们两清 提交于 2019-12-22 14:04:07
问题 I'm using the following code to generate a certificate chain with a root certificate, an intermediate and an end certificate: TestCertificates.java import org.bouncycastle.asn1.ASN1InputStream; import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; import org.bouncycastle.asn1.x509.AuthorityKeyIdentifier; import org.bouncycastle.asn1.x509.BasicConstraints;

`JCE cannot authenticate the provider BC` when running a JAR

冷暖自知 提交于 2019-12-22 10:45:17
问题 In my scala project I use "org.bouncycastle" % "bcprov-jdk14" % "1.51" for cryptography. If it test my project in Scala IDE it works fine. But once I make a JAR and try to run it via java -jar ... it throws an exception: Exception in thread "main" java.lang.SecurityException: JCE cannot authenticate the provider BC I use https://github.com/sbt/sbt-assembly for making a JAR and here's my java -version output: java version "1.7.0_72" Java(TM) SE Runtime Environment (build 1.7.0_72-b14) Java

implementing bouncy castle aes 256

故事扮演 提交于 2019-12-22 10:08:10
问题 I am working on a chat application. The main feature is to send messages in encrypted form and when they reach their destination they can be decrypted. The problem I am having is that the messages are not getting decrypted at their destination but however they reach their destination in encrypted form. How the code works: Client A sends message "Hello" to client B... When Client A clicks on button "Send message" I save that text in a String and then that String is passed along with key and iv

How to use Bouncycastle's CMac

非 Y 不嫁゛ 提交于 2019-12-22 08:35:00
问题 I'm trying to use BouncyCastle's CMac implementation but apparently I'm doing it wrong. At least the following unit test (based on RFC 5297 test vectors) fails: @Test public void testCMacOfZeros() { byte[] key = {(byte) 0xff, (byte) 0xfe, (byte) 0xfd, (byte) 0xfc, // (byte) 0xfb, (byte) 0xfa, (byte) 0xf9, (byte) 0xf8, // (byte) 0xf7, (byte) 0xf6, (byte) 0xf5, (byte) 0xf4, // (byte) 0xf3, (byte) 0xf2, (byte) 0xf1, (byte) 0xf0, // (byte) 0xf0, (byte) 0xf1, (byte) 0xf2, (byte) 0xf3, // (byte)

Are there advantages for using SpongyCastle over BouncyCastle, if targeting Android 3.0 and later?

泄露秘密 提交于 2019-12-22 04:42:55
问题 If I understand the situation correctly, SpongyCastle is a renaming of BouncyCastle and it was created to give people the ability to include a new version of BouncyCastle on Android, since just including the latest BouncyCastle jar would cause conflicts with the old and stripped down version of BouncyCastle that came with Android. However, apparently since version 3.0 (in 2011 - 6 years ago!) the Android BouncyCastle package was renamed to com.android.org.bouncycastle , so that now if you

RSA C# encryption with public key to use with PHP openssl_private_decrypt(): Chilkat, BouncyCastle, RSACryptoServiceProvider [closed]

杀马特。学长 韩版系。学妹 提交于 2019-12-22 01:32:28
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . i'm trying to encrypt the string in C# application for it to be decrypted on PHP side with openssl_private_decrypt(). the initial public key that i'm trying to decrypt with is obtained from within PHP's openssl_pkey_get_details($privateKey); talking ahead, i am able to do it using chilkat, but it

Creating an AsymmetricCipherKeyPair with just the Public key

元气小坏坏 提交于 2019-12-22 00:30:28
问题 I'm having a bit of an issue. I'm trying to write a client-server application (more a POC really), with the client requesting the public key from the server, the server then generates this key AsymmetricCipherKeyPair with the following private static AsymmetricCipherKeyPair GenerateKeyPair() { RsaKeyPairGenerator g = new RsaKeyPairGenerator(); g.Init(new KeyGenerationParameters(new SecureRandom(), 1024)); var pair = g.GenerateKeyPair(); return pair; } This generates correctly and can encrypt

How Do You Configure BouncyCastle For Mac OSX Maverick

别来无恙 提交于 2019-12-22 00:10:34
问题 I am trying to add bouncycastle to my classpath and the only instructions I can find is for Windows. I need it so I can connect my android client to my server. Has anyone gone through the same problem? 回答1: Answer provided by user2829409 in his question : It's actually very simple. Just add the provider jar to System/Library/Java/Extensions the OS takes care of adding it to your class path. Then run some code like: keytool -importcert -v -trustcacerts -file "YOUR_CERT.crt" -alias imeto_alias