How to encrypt variable length text in PHP and C#? -


For a game I am currently making am I need to encrypt a variable length string (this is 10 characters form Or a full XML document) in C # and then send it to PHP script which decrypts and processes the information. I am unfortunately completely in the dark when it comes to cryptography and I have a problem in fulfilling my needs in this matter. Is there a library that can do this kind of variable length encryption on multiple platforms like this?

, sometimes called resendell, you can have an option. This is the standard created by the National Institute of Standards and Technology, an agency of the US Government.

This extension is available in PHP using, and it seems that the net framework is built in. . I know something about C # and Net, but there are 23 votes in the answer, so there is a possibility of something. (Edit: @Fun Moon is included in reference to AES in the answer to Ping, and which may be more useful or otherwise useful than link linked posts.)

AES One The block is the cipher, which means that it works best on the length of the text of a specific set of lengths. There are many and you have to read and choose. If you use the same operation mode and padding on both sides, then you should have the correct difference.

Keep in mind that AES is a symmetric cipher, it means that the same key is used for both encrypt and decrypt. This may not be the best option for you if you have access to your user key , The encryption becomes useless.

May be a better option for you. It uses two keys instead of one. Encrypted data can be decrypted only by using the public key, which means that you need to worry a lot about the public key in the wrong hands. Not really because the data about it can not be decrypted. It can allow annoying users to still create messages that are legally visible.

This is the best choice of PHP for public key cryptography, which uses industry standard RSA system. A quick look at Google Like AES, you may need to worry about the operation or padding methods, but then you should get a full interval using the same method on both sides. A potential annoyance will be the initial key creation, and how each party wants to store the private and public key.

Comments