views:

54

answers:

1

Hello Guys,

I have given a task in which I need to encrypt an user's ID using AES encryption, what they want is I need to pass in a parameter in a website just like this.

URL : http://www.site.com/event/sample.jce Parameter : ?param= encrypted text

aside from that there was an attched php sample that they want me to follow to encrypt but I don't have an idea on how to convert this one in .NET

function getEncrypt($sStr, $sKey, $sIV){ $sCipher = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $sKey, $sStr, MCRYPT_MODE_CFB, $sIV); return bin2hex($sCipher); }

$sStr = "13410##13";
$sKey = "mediaservice1234"; $sKey = "kjcemsdev3jangho"; // Do not change

$sIV = "fs0tjwkdgh0akstp"; // Do not change

$tmp= getEncrypt($sStr, $sKey, $sIV);

Could somebody help me to understand this codes? or better if they could help me to convert this one on .NEt code? Thanks. :)

A: 

Here you can find some more information about using the AES encryption in .net:

http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged%28VS.80%29.aspx

The code is pretty straight forward.

Pbirkoff