Tell me how to decrypt text on php collected in C # with a post request sent to the site. Text crypt code

private static byte[] HexToBytes(string hex) { if (hex != null) { hex = hex.Replace("-", ""); if (hex.Length > 1 && hex.Length % 2 == 0) { byte[] result = new byte[hex.Length / 2]; for (int i = 0; i < result.Length; i++) { result[i] = Convert.ToByte(hex.Substring(i * 2, 2), 16); } return result; } } return new byte[0]; } private static string Encrypt(string text) { Byte[] buffer = Encoding.UTF8.GetBytes(text); for (int i = buffer.Length - 2; i >= 0; i--) { buffer[i] ^= buffer[i + 1]; } buffer[buffer.Length - 1] ^= buffer[0]; return BitConverter.ToString(buffer).Replace("-", ""); } 
  • Why not ready to use something, why invent your own strange algorithm? The same System.Security.Cryptography.DES . - Suvitruf
  • @Suvitruf because the finished will immediately disassemble and receive the text - Sector32
  • habr.com/post/181372 - Suvitruf

0