rsa

[Java] RSA BadPaddingException : data must start with zero

Hello everyone. I try to implement an RSA algorithm in a Java program. I am facing the "BadPaddingException : data must start with zero". Here are the methods used to encrypt and decrypt my data : public byte[] encrypt(byte[] input) throws Exception { Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");// cipher.init(Ci...

how to encrypt java object using RSA

Hi can everyone tell me how to encrypt & decrypt Java oject ...

RSA encryption results in server execution timeout

Hi, I am using PHP Crypt_RSA (http://pear.php.net/package/Crypt_RSA) for encrypting and decrypting the contents. Contents are of 1kb size. Following are the results: keylength = 1024 Encryption function takes time: 225 secs keylength = 2048 Encryption function takes time: 115 secs I need to reduce this execution time as most...

Encrypted AES key too large to Decrypt with RSA (Java)

Hello, I am trying to make a program that Encrypts data using AES, then encrypts the AES key with RSA, and then decrypt. However, once i encrypt the AES key it comes out to 128 bytes. RSA will only allow me to decrypt 117 bytes or less, so when i go to decrypt the AES key it throws an error. Relavent code: KeyPairGenerator kpg = K...

RSA encrypted data block size

how do you store an rsa encrypted data block? the output might be significantly greater than the original input data block size, and i dont think people waste memory by padding bucket loads of 0s in front of each data block. besides, how would they be removed? or is each block stored on new lines within the file? if that is the case, how...

how do i convert RSAParameters from .net to .pem file so i can use it in php

Hello i have a private and public keys for RSA generated in .net in this format string privateKey = "<RSAKeyValue>" + "<Modulus>...kCFhsjB4xMW49mrx5B/Ga...</Modulus>" + "<Exponent>...</Exponent>" + "<P>...7bRCrQVgVIfXdTIH3iY8x...</P>" + ...

Is there any available free & open source implementation of RSA-2048 for SQL Server 2000?

I'm trying to do some cryptography for SQL Server 2000, and I know that only SQL 2005+ comes with built-in functionality for doing this natively. Do you know any open source implementation that I can use for free of RSA-2048 cryptography? ...

SIMPLE OpenSSL RSA Encryption in C/C++ is causing me headaches

SOLVED: I was dumb. First argument of encrypt should have been key.size() and first argument of decrypt should have been RSA_size(myKey). Hey guys, I'm having some trouble figuring out how to do this. Basically I just want a client and server to be able to send each other encrypted messages. This is going to be incredibly insecure bec...

Can I RSA-encrypt in Java but decrypt in PHP?

Can I RSA-encrypt in J2ME or J2SE, and decrypt in PHP? I assume RSA is a specification, and has nothing to do with the languages. ...

Java RSASSA-PKCS1 howto

Can anybody tell me how to generate signature for "RSASSA-PKCS1-v1.5" in Java? I, actually, want to know how do I with java.security.Signature class. Do I have to use any 3rd party libraries? ...

How to create a RSA key in the machine for using in RSACryptoServiceProvider?

I have the following situation: Several applications in different machines are going to share a information stored in a database with RSA cryptography. Today I'm doing this in a way it's not the safer way. These machines share a DLL containing the RSA key in a XML. How could I use the information from this XML to generate machine keys...

is this a correct way to generate rsa keys?

is this code going to give me correct values for RSA keys (assuming that the other functions are correct)? im having trouble getting my program to decrypt properly, as in certain blocks are not decrypting properly this is in python: import random def keygen(bits): p = q = 3 while p == q: p = random.randint(2**(bits/2-2)...

RSA key length and export limitations

I know, there are a lot of limitations to the length of used key (import and export limitations for nearly each country). Usually, it varies from 64 to 256 bits. To use more bits, it is obligatory to ask permission from authorities. But it is recommended to use 1024 bits keys for RSA as minimum! Does it mean that I cannot just use RSA w...

iphone - data signing using NSData of the private key

Hi I am working on a e-banking iphone application. I am using WSS with XML-Signature to sign the requests to the customer's SOAP server. Since the iPhone device can not be trusted (due to jail-breaking), the customer requirement is to manually encrypt the RSA key pair (using AES128) before storing the keys into keychain. From what I ...

Encrypting Files with AES, Encrypting Key with RSA - Am I on the right track?

Overview: I'm trying to design an application that will encrypt files to safely send through Snail Mail (LARGE sets of data). I'm planning on using AES/RijndaelManaged encryption from .Net to encrypt the files initially, using a randomly generated key using RNGCryptoServiceProvider. I'm then encrypting this random AES key with a RSA Pu...

ssh-2 rsa body format?

Is there any documentation on what the bignums in the body are? Like here is an example pubkey. ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBMgigwcBaB3sqogC/yVPANQJKjMwOvrdOKhBIVlI2eOIq6FEyzNI8cbRDbHo5muipun922bLoV+p/dPZ2/8wJ+zugLM8eCdsr+VbYZ3T5wb7bjd2swePOWtffnsXnHiP8aWyRj64vd/mRPR1gYErg8vb7vM5c4B2ANKHs/rP65Bw== rsa-key-20100514 It contains 3 ...

What is the difference between DSA and RSA?

It appears they are both encryption algorithms that require public and private keys. Why would I pick one versus the other to provide encryption in my client server application? ...

how does public key cryptography work

Hello, What I understand about RSA is that Alice can create a public and a private key combination, and then send the public key over to Bob. And then afterward Bob can encrypt something using the public key and Alice will use the public and private key combo to decrypt it. However, how can Alice encrypt something to be sent over to B...

How can I create a key using RSA/ECB/PKCS1Padding in python?

I am struggling to find any method of using RSA in ECB mode with PKCS1 padding in python. I've looked into pyCrypto, but they don't have PKCS1 padding in the master branch (but do in a patch). Nevertheless I found RSA with PKCS1 in the M2Crypto package, but I'm not sure if I can choose ECB mode... ...

With RSA encryption, should I use the same certificate to sign and encrypt a message?

If I want to sign and encrypt a message using an X509 certificate, is there any reason not to use the same certificate for encryption and signing? ...