Click here to Skip to main content
15,891,905 members
Articles / Security

Encrypting Communication between C# and PHP

Rate me:
Please Sign up or sign in to vote.
4.91/5 (34 votes)
11 Oct 2011GPL344 min read 201.5K   4.4K   65  
Set up encrypted secure communication between C# and PHP using the AES and RSA algorithms.
@echo off
echo Place this BAT file in the bin folder of OpenSSL and run it to generate 
echo an RSA key pair. Just give the information it needs when it asks for it.
pause
openssl genrsa -aes256 -out temp.key 2048
openssl rsa -in temp.key -out private.key 
openssl req -new -x509 -nodes -sha1 -key private.key -out public.crt -days 3650
del temp.key
cls
echo Your keys have been generated.
echo private.key contains the private key
echo public.crt contains the public key
pause

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer
United States United States
Scott enjoys working on proof-of-concept projects for the sake of learning new and interesting ways to solve problems.

Comments and Discussions