Translate C# to PHP

Đang Thực Hiện Đã đăng vào 6 năm trước Thanh toán khi bàn giao
Đang Thực Hiện Thanh toán khi bàn giao

I got a license program that creates a license key.

I want the process to be automatic and will use PayPal IPN

I got the automatic flow working

The project is to create a PHP translation of the C# code.

Licensekeys created in C# program should be compatible with PHP created license-keys

The project is to create the same licensekey in PHP as it was in C#

I attach the Licensetool as a VS2015 solution

The part of the code that do the licensekey is: (C# [url removed, login to view])

private static byte[] key = new byte[8] { 1, 2, 3, 4, 5, 6, 7, 8 };

private static byte[] iv = new byte[8] { 1, 2, 3, 4, 5, 6, 7, 8 };

public static string Crypt(string text)

{

SymmetricAlgorithm algorithm = new DESCryptoServiceProvider();

ICryptoTransform transform = [url removed, login to view](key, iv);

byte[] inputbuffer = [url removed, login to view](text);

byte[] outputBuffer = [url removed, login to view](inputbuffer, 0, [url removed, login to view]);

return [url removed, login to view](outputBuffer);

}

public static string Decrypt(string text)

{

SymmetricAlgorithm algorithm = [url removed, login to view]();

ICryptoTransform transform = [url removed, login to view](key, iv);

byte[] inputbuffer = [url removed, login to view](text);

byte[] outputBuffer = [url removed, login to view](inputbuffer, 0, [url removed, login to view]);

return [url removed, login to view](outputBuffer);

}

private void btnCrypt_Click(object sender, EventArgs e)

{

CreateKey();

}

private void CreateKey()

{

// email(a)[url removed, login to view];First_name LastName;License created:2017-04-02 13:18

string license =

[url removed, login to view] + ";" +

[url removed, login to view] + ";" +

"License created:" + [url removed, login to view]() + " " + [url removed, login to view]();

[url removed, login to view] = Crypt(license);

}

================================================================

I have tried to do a PHP translation and this is how far I got: ([url removed, login to view])

// How do I get a 8 byte data from C# to PHP??

// private static byte[] key = new byte[8] { 1, 2, 3, 4, 5, 6, 7, 8 };

// private static byte[] iv = new byte[8] { 1, 2, 3, 4, 5, 6, 7, 8 };

$ky = '8byte data'; // 64 bit key

$iv = '8byte data'; // 64 bit iv

//Remove spaces in mail.. Freelancer is not allowing mail in descriptions

$text = "c a b b a g e c r e e k (a) g m a i l . c o m " .";"."Johnny Lindén" .";"."License created:2017-04-01 21:48";

// This is crypt-key that is created in C#.. Should be decrypted to almost the same as $text

$from_csharp = "efXInRhvedmyuc+y3holjgQ6sgP1gZvnv1HfZq2bk3mrf/ofMVLfdwSCrjzSaFd74D5ZtztpFxQt8XtlaqUMJfrYwUx8sSUsNX5jZlZirFASDPSVvYz8RTyFqGIwffFxjmlb89bdXPGVU9fTl0VeBCSxI6oL1aCq/yqv6tQ3aFG+8kT4zXZbiBwiv/krAgw/";

// enter value from vb.net app here to test

$etext = encryptRJ256($ky, $iv, $text);

$dtext = decryptRJ256($ky, $iv, $etext);

$vtext = decryptRJ256($ky, $iv, $from_csharp);

echo "<HR>orignal string: $text";

echo "<HR>encrypted in php: $etext";

echo "<HR>decrypted in php: $dtext";

echo "<HR>encrypted in vb: $from_csharp";

echo "<HR>from vb decrypted in php: $vtext";

exit;

function decryptRJ256($key,$iv,$string_to_decrypt)

{

$string_to_decrypt = base64_decode($string_to_decrypt);

$rtn = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $string_to_decrypt, MCRYPT_MODE_CBC, $iv);

$rtn = rtrim($rtn, "\0\4");

return($rtn);

}

The project is to create a PHP translation of the C# code.

Licensekeys created in C# progranm should be compatible with PHP created license-keys

Lập trình C# PHP

ID dự án: #13593843

Về dự án

6 đề xuất Dự án từ xa 6 năm trước đang mở

6 freelancer chào giá trung bình$53 cho công việc này

kostiapl

Hi. I realized PHP code that encrypt code in the same way as C#. Description: There are 3 - problems with php code. 1. padding in PHP and .NET by default are different. By default .NET uses PKCS7 2. Also i Thêm

$66 USD trong 1 ngày
(28 Nhận xét)
4.7
lalitatmt

Hello Sir/Madam, I am having around 13 years of experience in mobile & .NET technologies. I am expert in CSS, HTML, asp.net MVC, Web API, asp.net, WPF, AngularJs, TypeScript, ExtJS, YUI, JQuery, Bootstrapper framewo Thêm

$111 USD trong 1 ngày
(5 Nhận xét)
4.1
DaTranslationLtd

Da-Translation Ltd. is a group of professional translators who provide high quality and error-free translations. We have a Team of Native Translator for your task. Please have a look at our reviews to make sure we Thêm

$30 USD trong 1 ngày
(0 Nhận xét)
0.0
Softwcreative

over 18 years of programming,having programmed extensively in C++C#,MT4,cAlgo,cTrader,Java, C,VB, AI,ASP,NET,Python,PHP,Socket and Networking,Payment systems Excel programming etc and web development. Ability to con Thêm

$30 USD trong 1 ngày
(0 Nhận xét)
0.0
AlbTechTeam

We have leading developers in c# and php because we deal with websites and desktop applications, We also use java, and I would like you to trust us in this application and we will take the responsibility to finish th Thêm

$55 USD trong 1 ngày
(0 Nhận xét)
0.0