FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Encrypt with C#, Decrypt with PHP





Ironz
hey,

My objective is to send an encrypted string from my application to the web.

I want to encrypt the string in the application(written in C#) send it over to a php script where i want to decrypt it and add it to a database.

The problem is that i can't find a way to encrypt the string in C# and Decrypt it in php so that it returns to it's normal state.

I have never used encryptions before so i don't know much about it. I'm just looking for a method (like md5) that is supported by the 2 languages and that fills the objective or a very simple encryption script that i can use.

If anyone has any other idea that is easier or that works then it'll be great.

Thank You.
polarBear
what about rot13? perhaps some other simple character permutations would work, and don't require much programming to be achieved.
Ironz
as i said it's my first time using encryptions.

i forgot to mention that i'm also transfering numbers so numbers should also be encrypted.
Character permutations will only work on characters (duh, not a smart conclusion) but i'm looking for a simple encoder that works for characters and numbers also.

EDIT: found the ROT47 which also treats numbers but i'll try to convert the encryption to C# since it's in php
Thx polarBear.
Stubru Freak
The problem with that is that a premade function is known, and can be used by a hacker too. You can try and find something yourself however. For example, send a number from the server (php) to C. Then let C store the number. Then change all your alphanumerical characters as defined by the number.
Like:
if(number==1){
a = "d";
b = "m"; // Just really random
...
} else if(number==2){
//Something else
}

Don't know C but in php you could use str_replace for that.

Then you could move every 5th letter 4 characters backwards, for example.
You could also, when str_replacing the numbers, use a different way for each character.

It's quite hard to hack something like that. Of course best thing to do would be using https. But if you can't try something like this.
Ironz
yeah i used that method. it come out to be a lot easier then what i had immagined.
Get the ascii number of the character, add a random number to it then convert it back to a character, loop through the whole string and that's it.
thx for the help.
Related topics
Php, mime_content_type() problem
PHP ve PHPNUKE kaynaklar
Ksiazki o PHP i mySQL, Helion
MD5...
[man]Instalacion de PHP-Nuke en local
form mail problems (quality help=frih$)
PHP mailing script
Learning Java
PHP email varification saying invalid email
md5() Password Protection
show items posted for today only, php and mysql
Here are some Great PHP Tutorial Sites !!!
php/mysql for pc use
html login system
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.