rsa

How can I create a RSA public key in PEM format from an RSA modulus?

Hi all, I have the modulus of an RSA public key. I want to use this public key with the Python library "M2Crypto", but it requires a public key in PEM format. Thus, I have to convert the RSA modulus to a PEM file. The modulus can be found here. Any ideas? Thanks a lot, hevalbaranov ...

rsa data decryption error.the system cannot find the file specified.

I am doing encryption descryption with rsa provider and it is giving following errors. rsa data decryption error.the system cannot find the file specified. Any one have any idea I am also using identity in web.cofig. I have also given all rights to rsa folder where the key generating but still it is there. Another strange thing is th...

How do I encrypt a java.util.Properties object (can be any size) using an RSA Public Key?

This is the code I'm currently using. It uses the BouncyCastle Provider. static { Security.addProvider(new BouncyCastleProvider()); } protected String encrypt(byte[] keyData, byte[] data) throws Exception { X509EncodedKeySpec keyspec = new X509EncodedKeySpec(keyData); KeyFactory kf = KeyFactory.getInstance("RSA", "BC"); Pub...

How to generate key code containing encrypted data?

Situation: I want to provide a website service where users can enter some data e.g. 15 bytes long name "namedata" and get a key code. That code can then be used to unlock some feature in a game (provided by me), also utilizing the namedata (think of a custom Lazgun named "Lazgun of Peter", where "Peter" is the namedata). My plan is to ...

C# RSA encryption using modulus and public exponent

I have to implement a digital envelope using AES and RSA, but I am having problems with the .NET implementation of the RSA algorithm. I have managed to encrypt the data (AES) with the random symetric key, but now I have to encrypt the key with RSA. The key is an array of bytes (byte[]) and the public key I have tells me only the modulu...

BouncyCastle RSAPrivateKey to .NET RSAPrivateKey

I'm creating a certificate distribution system to keep track of clients and stuff. What happens is: Client send CSR to Server Server checks and signs certificate Server sends Signed certificate to Client Client puts Signed certificate plus Private key in Windows store. So on the client this happens: //Pseudo Server Object: Server s...

Error occurred while decoding OAEP padding

in continuation of the http://stackoverflow.com/questions/949907/error-occurred-while-decoding-oaep-padding question I have modified my code and now i am trying this code CspParameters cspParam = new CspParameters(); cspParam = new CspParameters(); cspParam.Flags = CspProviderFlags.UseMachineKeyStore; clsCertificates cc = new clsCer...

How to create private RSA key using modulus, D, exponent in C#?

I have 3 byte arrays of 128, 128, 3 bytes respectively. I don't know what it is, but I expect them to be Modulus, D, Exponent. Now how to use these arrays in C# to decrypt a byte array using RSA? When I create RSA param and assign the 3 byte arrays to Modulus, D, Exponent and try to use that RSAParameters in RSACryptoServiceProvider.Impo...

How to decrypt a data using rsa privatekey

I am using JAVA My friend uses SYMBIAN I and my friend have same rsa modulus. If I encrypt the data using public key then my friend is able to decrypt the same. But if my friend encrypt the data with public key then I am not able to decrypt the data. I got an error as "Data must start with zero " public static byte[] encrypt(byte[] enc...

RSA Encryption Failed with Error Code = -2146893819

I'm working on some code that dropped on me when another developer (and the only person who knew anything about this system) left. I'm trying to figure out why my client and server are not connecting. I'm getting the following error: "Genuine channels operation exception: The connection has been forcibly closed. Specified reason: RSA en...

RSA pubkey file type detection

Hi all! I got a RSA pubkey.dat (almost obvious what it is) that has the following structure on contents: ASN1 Integer of around 1024 bits (Modulus) ASN1 Integer (Exponent) Blob of 256 bytes (Signature) No tags like "----begin---" or so. pure hex values in it. There's any way to identify its format like if it's DER/PEM/etc , so i ca...

RSA_sign or DSA_sign in PHP!

Hello developers, I'm going to implement license key generator on my website but I've very few knowledges of php! In my (Cocoa) application I've integrate a system verification that use the RSA_sign function (in C#) ... I would like to use the paypal IPN notification system to automatically generate and send to my users their license ke...

PHP License generator protection conflict with paypal IPN?

Hi world, I'm going to integrate a license key generator in my web site, in the way that It can automatically generate license keys when occurs a paypal notification (IPN)... but my question is: what is the best way to protect the php file (that contains the method used to generate the key) and the private (a .pem file)? Thanks in adva...

Having trouble decrypting in C# something encrypted on iPhone using RSA

I've spent two days on this so far and combed through every source at my disposal, so this is the last resort. I have an X509 certificate whose public key I have stored in the iPhone's keychain (simulator only at this point). On the ASP.NET side, I've got the certificate in the cert store with a private key. When I encrypt a string on t...

Python RSA Decryption Using OpenSSL Generated Keys

Does anyone know the simplest way to import an OpenSSL RSA private/public key (using a passphrase) with a Python library and use it to decrypt a message. I've taken a look at ezPyCrypto, but can't seem to get it to recognise an OpenSSL RSA key, I've tried importing a key with importKey as follows: key.importKey(myKey, passphrase='PASS...

encryption with python

If I want to use: recip = M2Crypto.RSA.load_pub_key(open('recipient_public_key.pem','rb').read()) Then how will it retrieve the key? What will recip will print? I need to get the public key of the recipient from the server(open key server) and for that first I need to store the key on server. ...

Generating REALLY big primes

I'm playing around and trying to write an implementation of RSA. The problem is that I'm stuck on generating the massive prime numbers that are involved in generating a key pair. Could someone point me to a fast way to generate huge primes/probable primes? ...

using RSACryptoServiceProvider or RSA in hosted environment

I would like to use Public/Private encryption where my web app would sign an xml document or a piece of data using a private key and it will be verified in the application using the public key, Is it possible to use RSACryptoServiceProvider in .net 2.0 hosted environment if not what are other possible workarounds? ...

Is possible to encrypt with private key using .net RSACryptoServiceProvider?

I kown RSACryptoServiceProvider can encrypted with the public key,then it can be decrypted with the private key. Is possible to encrypt with private key and decrypted with the public key using RSACryptoServiceProvider ? ...

ProtectSection with RsaProtectedConfigurationProvider where does the Key go?

I am using System.Configuration to encrypt and protect some passwords in a custom configuration section vis:-. static public void SetPassAndProtectSection(string newPassword) { // Get the current configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( Configura...