bouncycastle

How to speed up RSA key pair generation process

给你一囗甜甜゛ 提交于 2019-12-25 11:51:11
问题 I am using below code to generate 10000 RSA key pairs. It seems to be taking very long (takes around 25-30 minutes): for (int i = 0; i < 10000; i++) { String[] arr = GenerateKeys(1024); } public static string[] GenerateKeys(int keySizeInBits) { var r = new RsaKeyPairGenerator(); r.Init(new KeyGenerationParameters(new SecureRandom(), keySizeInBits)); var keyPair = r.GenerateKeyPair(); var publicKey = string.Empty; using (var stream = new MemoryStream()) { var textWriter = new StreamWriter

Bouncy-castle integration in Websphere causing the following error

扶醉桌前 提交于 2019-12-25 11:49:11
问题 I am trying to configure bouncycastle in IBM Websphere App Server 7, my JRE Version is 1.6. I am getting the following error when trying to run the code: Caused by: java.lang.ClassNotFoundException: sun.security.provider.Sun at java.net.URLClassLoader.findClass(URLClassLoader.java:434) at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:191) at java.lang.ClassLoader.loadClass(ClassLoader.java:660) at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:111) at

Can't verify PyOpenSSL signature in C#

拥有回忆 提交于 2019-12-25 07:24:59
问题 I can sign and verify data in PHP using OpenSSL: function generate_signature($privateKey, $data) { $keyData = openssl_get_privatekey($privateKey); openssl_sign($data, $signature, $keyData, OPENSSL_ALGO_SHA256); openssl_free_key($keyData); $sigText = base64_encode($signature); return $sigText; } function verify_signature($pubKey, $sigText, $data) { $signature = base64_decode($sigText); $keyData = openssl_get_publickey($pubKey); $ok = openssl_verify($data, $signature, $keyData,

Bouncy Castle example for encoding CDR

邮差的信 提交于 2019-12-25 05:20:07
问题 I am trying to encode PGWRecord CDR using ASN.1 notation, starting on page 89 in this 3GPP TS Document I've been looking for awhile for examples how I can do this, but to no avail. Are there any examples that can show me how to do this using Bouncy Castle ? Or is there a better alternative than Bouncy Castle to encode this CDR? Step by step instructions on how I can do this would be very nice! Any help would be very appreciated. Thanks all! 回答1: Try to look at BinaryNotes. You have ASN.1

Getting error while sending Push Notification to iPhone using Java-PNS?

我们两清 提交于 2019-12-25 05:16:31
问题 I am using javaPNS_2.2.jar file to send push notification message to iPhone device. My Code is: PushNotificationPayload payload = PushNotificationPayload.complex(); /* Customize the payload */ payload.addAlert("Hello World!"); payload.addCustomDictionary("mykey1", "My Value 1"); payload.addCustomDictionary("mykey2", 2); /* Push your custom payload */ String keystore = "C:/1.0Eywa_Baba/PushNotificationKey.p12"; String password = "Eywa@12"; boolean production = false; String devices = "C81DD339

BouncyCastle provider in j2me

匆匆过客 提交于 2019-12-25 03:11:52
问题 Where can I find examples that implements ECDSA and ECDH using light weight version of bouncycastle and uses bouncy castle provider dynamically? 回答1: The bouncycastle java crypto library has two basic modes. It can be use as a JCE provider, and as a standalone library accessed through its lightweight API. You can even use both at the same time if you prefer, EXCEPT in J2ME (now known as JME). You can only use the lightweight API in J2ME. You can find the J2ME version of the bouncycastle

Making HTTPS call in C# with the BouncyCastle library

為{幸葍}努か 提交于 2019-12-25 03:08:42
问题 Using C# 4.0, I need to make HTTPS call with the BouncyCastle library (Short story : Windows XP + TLS 1.2). When using the following code, I get a "HTTP Error 400. The request verb is invalid." Here is my code : using (var client = new TcpClient("serverName", 443)) { var sr = new SecureRandom(); var cl = new MyTlsClient(); var protocol = new TlsClientProtocol(client.GetStream(), sr); protocol.Connect(new MyTlsClient()); using (var stream = protocol.Stream) { var hdr = new StringBuilder(); hdr

Can I use elliptic curve cryptography as a password with Bouncy Castle in C#?

给你一囗甜甜゛ 提交于 2019-12-25 02:42:37
问题 I'd like to encrypt some data on a server so if someone got access to the database and codebase the secret data would not be compromised. It seems to me a good way to do this is through elliptic curve cryptography. I'm wondering how to do this in Bouncy Castle? I've Googled around and read some blog posts, but they generate keys unrelated to strings and I'm not sure how to implement it with a password, plus I don't want to make a mistake. essentially I'd like something like this: var

'Portable.BouncyCastle' already has a dependency defined for 'System.Collections'

北战南征 提交于 2019-12-25 01:19:32
问题 This error occurs on the Bamboo build server during a command that restores my solution's NuGet packages. I can bypass this error by disabling the package restore task; however, this is only a temporary fix. Is there any way I can check if the dependency exists while running the task? This error occurs before MSBUILD is running. I am using .NET 4.5 回答1: The already has a dependency defined for error when installing a NuGet package is due to a bug in older versions of NuGet. You should look at

How do I decrypt an AES key using C# Bouncy Castle that was encrypted using Libgcrypt raw flag

你离开我真会死。 提交于 2019-12-24 19:58:56
问题 Summary: I am attempting to decrypt (and eventually encrypt and return) files that are AES128 encrypted. The AES key is encrypted using libcrypt's RSA provider. When I attempt to decrypt the AESKey on Windows 7 using C# & BouncyCastle a "block truncated" error is thrown when I call "ProcessBlock". I have tried converting the data to BigEndian and I'll get a "Not a valid RSA exponent" when I try to create the RsaKeyParameters. The encryption was done using libgcrypt 1.2x on a linux system. I