rsa

python RSA module how to use java decrypt

I use python rsa module(http://stuvel.eu/rsa) get private_key and public_key. How can I use these private_key and public_key to encrypt or decrypt in java? ...

Can I test authentication with an RSA key locally?

Is there a way to check locally if you're providing the correct passphrase to an RSA key? I recently had trouble pushing some commits to github because the push prompted for a password and then failed authentication. I verified that github had the correct public key for the id_rsa file in my ~/.ssh directory, and I verified that I could...

Cryptography / Compression in Silverlight

I'm porting my application from WPF to Silverlight. The biggest problem is that my application uses RSA encryption and Deflate compression, and both classes are not available in Silverlight. I know that you can view the sourcecode of any .NET class using reflection, so would it be possible to just 'decompile' the RSACryptoService class,...

how to load an rsa privated key encrypted with des in java

hi, in my job i was assigned a task in which i have to programmatically load a private and public keys from files and then store them in a .jks file,the private key was generated using openssl, its an rsa des encrypted key in der format,i have no problem loading the public key, however,i haven't found a way to load the private key in its...

Signing data with PEM key and password in PHP. How to do same thing in .NET?

Hello everyone, I've got this code written in PHP: $text = "some data to sign"; $password = "some password"; $file = "private.pem"; $fp = fopen($file, "r"); $private = fread($fp, filesize($file)); fclose($fp); $pkeyid = openssl_get_privatekey($private, $password); openssl_sign($text, $signature, $pkeyid); $signature = base64_encode($s...

How to decrypt a string on OpenSSL that was previously encrypted via Crypto++?

EDIT: I found out that the keys aren't the problem like I said in the comments. I can use them without any issues to encrypt and decrypt data on OpenSSL. But I need to decrypt a string on OpenSSL that was previously encrypted via Crypto++ and that's not working. I'll post additional details later. Hi, I have encrypted a string using a...

RSA Encryption in .NET - decryption in JAVA -> Java throws "modulus not positive" error.

I am having problems with our third party vendor implimenting an sso. They are receiving the following error when verifying my signature: java.lang.ArithmeticException: BigInteger: modulus not positive--at java.math.BigInteger.modPow(BigInteger.java:1556) I have no control over their Java code. Here is what I am doing now: I created ...

How can I import an RSA public key from either XML or modulus/exponent in native code for use with Windows CAPI's CryptVerifySignature?

In C#, I am able to validate a hash against a public key in either of the following ways: // Import from raw modulus and exponent using (RSACryptoServiceProvider rsa = new RSACryptoServiceProvider()) { RSAParameters rsaKeyInfo = new RSAParameters {Modulus = modulus, Exponent = exponent}; rsa.ImportParameters(rsaKeyInfo); ret...

Little glitch in implementing RSA algorithm

I am trying to implement the RSA algorithm, but for some reason my code below doesn't produce correct results (note that only the relevant code is shown). BigInteger n = p.multiply(q); BigInteger totient = (p.subtract(BigInteger.ONE)).multiply(q.subtract(BigInteger.ONE)); Random rand = new Random(); BigInteger e; do { e = new BigInteg...

iphone OS! RSA Encryption with public key generated by Bouncy Castle (Java)

Hi, I'm developing an application on iphone. I had an application on Java using encryption (RSA) and I created a Private Key and Public Key. I want use the Public Key in Java application on iphone. For Ex: My Public Key is byte[] publicKey = {0x01,0x02}; How can I use my publicKey to encrypt data on iphone? I saw CryptoExercise, but i ca...