rsa

Grant access to SYSTEM account for RSA container on Windows Server 2003

I have a need to access an RSA private key from a Windows service running under the NT AUTHORITY\SYSTEM account. I'm able to install the private key on the server, and then make use of that key when running as the user that installed the key. However, the key does not seem to be available from the Windows service. Do I need a machine-...

Generate RSA key pair and encode private as string

Ello guys, i am supposed to generate 512 RSA keypair and then encode my public key as a string. I cant find any good tutorial for someone who just begins with encryption....please advices, sample codes,help urgent!! ...

How to import PKCS#8 RSA privateKey (created by OpenSSL) in C#

I'm trying to find a way to read a privateKey created using OpenSSL PKCS#8 RSA in C# without use external library. Someone know how can i do this? ...

Small RSA or DSA lib without dependencies

Is there a small library for RSA or DSA without any dependencies like GMP or OpenSSL? (Written in C or Asm) ...

OpenSSL "Seal" in C (or via shell)

I'm working on porting some PHP code to C, that contacts a web API. The issue I've come across is that the PHP code uses the function openssl_seal(), but I can't seem to find any way to do the same thing in C or even via openssl in a call to system(). From the PHP manual on openssl_seal(): int openssl_seal ( string $data , str...

Window CryptoAPI: Can I choose the public exponent when generating an RSA key pair?

Using the Windows CryptoAPI, is there any way to specify which public exponent to use when generating a new key-pair (ie. 3 instead of 65537)? As a bonus question: how would I access this functionality using .NET RSACryptoServiceProvider? EDIT: My guess is that the answer is "No", but I would like to get confirmation. ...

How do I do distributed UML development (à la FOSS)?

I have a UML project (built in IBM's Rational System Architect/Modeler, so stored in their XML format) that has grown quite large. Additionally, it now contains several pieces that other groups would like to re-use. I come from a software development (especially FOSS) background, and am trying to understand how to use that as an analogy ...

Load RSA keys from files

Hello, I used openSSL command to create 2 files: 1 for RSA public key & 1 for RSA private key. How do I recover RSA keys using C? Specifically, I have these functions: RSA_public_encrypt(read_num, in_buf, out_buf, public_key, RSA_PKCS1_PADDING); RSA_private_decrypt(read_num, in_buf, out_buf, private_key, RSA_PKCS1_PADDING); The 4th ...

storing credit card info

So I would like to modify a PHP / MySQL application in order to store credit card but not cvv and bank account info securely. PCI DSS require 1024 RSA/DSA. A small number of users will be given private key in order to decrypt the batch file of account info for submission to payment processors monthly. I'm unclear if it is possible to hav...

Protecting RSACryptoServiceProvider private key with password or otherwise

I want to encrypt some server data using .NET's RSACryptoServiceProvider and decrypt it when someone enters a key/password via a web page. What are my options for protecting, or ideally not even storing, the private key on the server, whilst avoiding having the user supply it all each time? Encrypt the private key using a symmetric sys...

How does the RSA private key passphrase work under the hood?

RSA private keys may be assigned a "passphrase" which - as I understand it - is intended to provide some secondary security in case someone makes off with the private key file. How is the passphrase layer of security implemented? ...

Java to Python RSA

I'm trying to encrypt a string from Java to Python, using the library Bouncy Castle J2ME on the client side and Python M2Crypto on the other. Everything is pretty good, I can decrypt it properly, but the padding is the issue. The M2Crypto lib gives me (as far as I can tell) only these Padding schemes: no_padding = 3 pkcs1_padding = 1 s...

How to sign an XML file with a RSA key in .NET?

I am trying to sign an XML file in C# .NET 3.5 with a private RSA Key generated by OpenSSL. Here is how I proceeded: I converted the RSA key from PEM format to XML format using the chilkat framework (www.example-code.com/csharp/cert_usePrivateKeyFromPEM.asp) With my XML key, I am now able to use native .NET Functions, which I prefer. S...

Access violation writing location

I have the following code: #include <openssl/bn.h> #include <openssl/rsa.h> unsigned char* key; RSA* rsa = RSA_new(); rsa = RSA_generate_key(1024,65537,NULL,NULL); //init pubkey key[BN_num_bytes(rsa->n)] = '\0'; BN_bn2bin(rsa->n, key); printf("RSA Pub: %s\n", key); RSA_free( rsa ); rsa = NULL; The debugger is telling me that I have a...

Sign with RSA-1024 an SHA-256 digest: what is the size?

Hi, I was wondering: 1) if I compute the digest of some datas with SHA-512 => resulting in a hash of 64 bytes 2) and then I sign this hash with RSA-1024 => so a block of 128 bytes, which is bigger than the 64 bytes of the digest => does it mean in the end my signed hash will be exactly 128 bytes? Thanks a lot for any info. ...

Can I use the assemblies PublicKey to decrypt a string encrypted with the corresponding PrivateKey?

Signing an assembly in .NET involves a public/private key pair. As far as I can tell from what I've read .NET uses the RSA algorithm and the private key to sign the assembly, checking it with the embedded public key. I know how to retrieve the public key (Assembly.PublicKey). I was wondering, if that key could be used to decrypt a short...

Gen public key from xml data file using M2Crypto for signature verification.

I have pub key in xml format: <RSAKeyValue><Modulus>xF9y25EXh8n99sXtU/JAsYTwML6PB7gSCE8tWw8Www2KBfDqohQBL8FMs8jzsDQa7WwoEmiVJ1resEC9YXJGbwQyWgb9qgooC9oSnCB/TkRdBybwby0DKuZOzq+609OBGkwWpgnS4QVCBc6eW+10l3qE3/2hKdcSV+08iRYp7zs=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue> So i try thms like this: from M2Crypto import RSA from xml.do...

LicenseProvider in .NET using RSA encryption to protect product license

Hi there I'm trying to find a solid licensing scheme using Microsoft's LicenseProvider. My thought is to use asynchronous encryption by ways of RSA (RSACryptoServiceProvider with 2048bit keys). I found this to be pretty easy, but I am unsure how secure the mechanism really is. This isn't for fun and needs to copy-protect a number of pro...

is 1024 bit rsa secure

Is 1024 bit rsa secure, or is it crackable now? Is it safe for my program to use 1024 bit rsa? I read at http://pcworld.about.com/od/privacysecurity1/Researcher-RSA-1024-bit-encry.htm that 1024 bit encryption is unsecure, but I find 2048 bit slower, and also I see that various https sites (even paypal) use 1024 bit encryption. Is 1024 bi...

Simple use of RSACryptoServiceProvider KeyPassword fails

I want to protect my RSA private key with a password (who wouldn't) but the following C# fails: SecureString pw = new SecureString(); pw.AppendChar('x'); CspParameters prms = new CspParameters(); prms.KeyPassword = pw; RSACryptoServiceProvider crypto = new RSACryptoServiceProvider(prms); byte[] encrypted = crypto.Encrypt(Encoding.ASCII...