Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

RSA is causing me headaches

0

67 views

Situation

I want to encrypt/decrypt byte[] data using RSA in my C# porject. I use OpenSSL.Crypto

this is my code

byte[] msg = System.Text.Encoding.ASCII.GetBytes("text to encrypt");

OpenSSL.Crypto.RSA rsa = new OpenSSL.Crypto.RSA();


byte[]result = rsa.PrivateEncrypt(msg, OpenSSL.Crypto.RSA.Padding.None);

Console.WriteLine(Convert.ToBase64String(result));

Question

1/ does my code look fine ? because i got an AccessViolationException. Here is the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

2/ how can i set/get public/private keys ?

asked March 1, 2011 1:04 pm CST
posted via StackOverflow

0 Answers

Be the first to answer this question

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions