Wow this gives a new definition to the internet term: “Long time no see”.
But I haven’t forgotten my lovely readers out there. I just took a break (I should have informed you I guess) so I could get back coding.
Lot’s have happened in this time. I’ve written quite a few applications, some which I finished, others just “bases” for later coding.
I’ve extended some of my own private libraries and even sent my home automation project out into V5 (more on that later).
But one of the few “gems” I managed to make was my little project: RSA File.
Why that stupid name? Because RSA is really refering to the public key encryption RSA.

The whole idea to short it down is that fx. you are on a forum. And you need to have someone send over some information to you without others reading it. On this forum identity isn’t a problem so you know who are who, but everone can read everone elses messages. Or maybe a public chat where you need to exchange some secret file. What do you do?
The classic approach would be with a preshared encryptionkey. That could work if the chat or forum has private messages enabled.
But what if you can’t trust the admins in there and it’s the only way you have to communicate? Or you just want it to go fast?
How would you encrypt your files without ever disclosing a password in public?
It’s quite simple, using public key cryptography we can do just that! Using RSA (a common method of public key encryption) we can make a private and a public key. The public key can be sent to everyone and they can encrypt some data. But ONLY the private key can read it. If you encrypt something with the public key, the public key can’t decrypt it.
So everyone can send their public keys out into the public but only the private key (the original receiver) can decrypt the content. Public key encryption has however one major drawback. It only supports (at least in .NET) up to 1024 bytes of data and it’s really slow compared to classic encryption with pre shared keys.
To read more about public key encryption you can visit http://en.wikipedia.org/wiki/Public-key_cryptography otherwise, move along :)
But how are we going to pull this into a program then? No file now a days is only 1024 bytes?
Well… We will just combine both classic (also called symmetric) encryption with public key encryption (called asymmetric encryption).
We will ask the user for a file, generate a completely random password, unknown to the user, and then encrypt the file with that password using symmetric encryption.
After that we will encrypt the password with the public key given by the user and then put it at the beginning of the file!
Then the receiver receives the file he will have the private key, and be able to decrypt the random password and then decrypt the whole file.
Everyone can know the public key but only the original receiver which holds the private key will be able to read the files.

It’s all cool and that but I just want to see the source / use the program.
Fine with me, I’m also going to continue programming on my home control system now.
Here are the download links for the source code. You will find the program itself inside the folder as follows:
RSA File > Bin > Release
Download:
RSA File - Public file sending (42)
Final note:
If you see this release elsewhere it’s because I’ve released it a few days earlier over at HackForums. The same thing is if some of you from there sees this. I have the user HSPSoftware over there so this is my source. While I’m at the thing with sources, my source code includes a custom theme from a guy called “Aeonhack”. Credits to you Aeon! :)
Final final note:
It just hit me that some of you are going to put me down like a cracker or something for saying that I’m over at HackForums too.
But let me put it like this: I’m active many places on the internet. Some more “dark” than others but I always hold myself on the right side of the law. The reason I’m over at HF is that they have some really clever people there. And I also like to consider my self as a “self declared spare time white hat hacker“. So for me it’s just another way of learning. And I also think it’s healthy for every programmer to understand the “dark side” of computers.