Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Public key encryption.

I've been wondering if there's a way to encrypt files using a public key then decrypt with private key(not password), something like PGP, I know that I can install PGP and use c# to send commands but I want it done completely in c# code, with options to create new keys and such.
Anyone knows if there's a free library/class that implements that? and maybe some documentation on using it??
Thanks in advance.
Have a cool signature? hit me up and I might use it.
https://msdn.microsoft.com/en-us/library....110).aspx

https://msdn.microsoft.com/en-us/library....110).aspx

http://www.codeproject.com/Articles/1087...n-in-C-NET

http://stackoverflow.com/questions/18485...in-c-sharp

http://stackoverflow.com/questions/15702...ceprovider

https://gist.github.com/zachbonham/3692542


Literally just Google'd your thread title and "C#"
From what I remember, public/private key encryption can only encrypt data shorter than the length of the key, so its not suitable for files.
Lotta blood to let, peace to make, give a fuk about a check
(Oct 25, 2015 11:07 AM)+Haze Wrote:  https://msdn.microsoft.com/en-us/library....110).aspx

https://msdn.microsoft.com/en-us/library....110).aspx

http://www.codeproject.com/Articles/1087...n-in-C-NET

http://stackoverflow.com/questions/18485...in-c-sharp

http://stackoverflow.com/questions/15702...ceprovider

https://gist.github.com/zachbonham/3692542


Literally just Google'd your thread title and "C#"

I've read most of them already.
First 2 links don't provide examples which is why I didn't understood a thing of them (still not good enough to understand from documentation).
Link #3 doesn't provide explaining for the code, I understand parts of it, but stuff like dwKeySize I have no idea what this is, also it doesn't show how to import/export/generate private/public keys.
Link #4,6 didn't show up in my google search, thanks for providing them :D
And one of the reasons I asked is what BahNahNah said, I had doubts that there's some hidden stuff that I don't know since I'm not that good with encrypting stuff yet.

(Oct 25, 2015 04:37 PM)BahNahNah Wrote:  From what I remember, public/private key encryption can only encrypt data shorter than the length of the key, so its not suitable for files.

hmmm. are you sure? do you know other ways of encrypting files using same concept??
Have a cool signature? hit me up and I might use it.
(Oct 25, 2015 04:37 PM)BahNahNah Wrote:  From what I remember, public/private key encryption can only encrypt data shorter than the length of the key, so its not suitable for files.

That's does not seem to be accurate based on the implementations I've seen and dealt with. OpenSSL provides a library for all of this stuff; it's what I initially used for C.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
You wouldn't encrypt data using the private/public key pair. You'd use a symmetric algorithm like AES. The symmetric key is then encrypted with the public key or signed with the private key. Mathematically it works both ways.
(Oct 26, 2015 02:57 AM)NTTITONV244 Wrote:  You wouldn't encrypt data using the private/public key pair. You'd use a symmetric algorithm like AES. The symmetric key is then encrypted with the public key or signed with the private key. Mathematically it works both ways.

but encrypting/decrypting the data with AES will require a password right? I don't want to use passwords in my application, I want something like multiple points to send data to a single server, data will be encrypted with the public key and server will decrypt using private key.
Have a cool signature? hit me up and I might use it.
(Oct 26, 2015 07:52 AM)severos Wrote:  but encrypting/decrypting the data with AES will require a password right? I don't want to use passwords in my application, I want something like multiple points to send data to a single server, data will be encrypted with the public key and server will decrypt using private key.

Use asymetric encryption to encrypt AES key and exchange it. Then use the AES to encrypt the actual data being sent.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by putnik1313Jun 21, 2025 08:59 PM 12 438 Jun 21, 2025 08:59 PM
Last Post: Goods
[Java] by georgeziozasMar 3, 2018 11:10 PM 1 106 Mar 3, 2018 11:10 PM
Last Post: m0noxide
[.NET] by x factor fanAug 7, 2016 11:53 PM 6 258 Aug 7, 2016 11:53 PM
Last Post: x factor fan