Encryption and decryption

I want to encrypt a string in java and decrypt the same string in C # and vice versa. How to do it. And the best way to encrypt

thanks

Aswan

+4
source share
3 answers

You need to go with the standard encryption method. The algorithm used will be safe, the result will be portable, and there are libraries on many platforms. 3-DES or AES would be a good choice.

+1
source

The word "best" is different things for different people and greatly affects the options available to you.

If speed is extremely important to you, just add it to each character value, send it and subtract again. In other words, send “ABC” as “BCD”.

+1
source

AES is supported in the .NET platform in the Rijndael class, you can find the documentation on MSDN http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndael.aspx . When encrypting a string, you will want to make sure that the way you select your key is a safe method, and make sure that it is also stored in a safe place. In any encryption scheme, the weakest link is the key.

0
source

Source: https://habr.com/ru/post/1303313/


All Articles