pastebin

BitConverter.GetBytes
  1. using system;  
  2. using system.Net.Sockets;  
  3. using system.Threading;  
  4. using system.IO;  
  5. using system.Net;  
  6. using system.Security.Cryptography;
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11.        
  12.         int pw=880614;
  13.         byte[] bytes = BitConverter.GetBytes(pw);
  14.             Console.WriteLine(Convert.ToBase64String(bytes));
  15.         //رمز اصلی
  16.         string st1="0E D4 4F CB 0F 2B 57 F0 41 89 19 B3 21 DA 14 4B D7 D0 0B BB";
  17.         //0ED44FCB0F2B57F0418919B321DA144BD7D00BBB
  18.         //b1b1324e1f516d8b6953a0bc197a9166e3a38bf8
  19.         //آرایه رمز اصلی
  20.         byte[] b={174,232,91,246,16,10,162,143,185,211,87,181,12,29,160,48,192,202,156,52};
  21.         byte[] arr={14,212,79,203,15,43,87,240,65,137,25,179,33,218,20,75,215,208,11,187};
  22.         //پسورد هش شده
  23.         Console.WriteLine("Original Hash Password");
  24.             Console.WriteLine(BitConverter.ToInt32(b, 0));
  25.             Console.WriteLine(Convert.ToBase64String(b));
  26.         ///string st4="BB";
  27.         //پسورد رشته شده
  28.         Console.WriteLine("Original Array Password");
  29.         Console.WriteLine(BitConverter.ToString(arr));
  30.         ///byte byte2 = Byte.Parse(st4,System.Globalization.NumberStyles.HexNumber);
  31.         ///Console.WriteLine(byte2);
  32.         //byte[] byte2 = st2.GetBytes();
  33.         ////Console.WriteLine("RAMZ TO RESHTEH");
  34.         ////Console.WriteLine(FormatBytes(bytes));
  35.         ////Console.WriteLine("RESHTEH TO RAMZ");
  36.             ////Console.WriteLine(BitConverter.ToInt32(bytes, 0));
  37.  
  38.         HashAlgorithm algorithm = new SHA1Managed();
  39.         //0E-D4-4F-CB-0F-2B-57-F0-41-89-19-B3-21-DA-14-4B-D7-D0-0B-BB
  40.         //944.../D70CFF3A0150E806114EE5F4FE8ECFA1339DBC4D
  41.         if (BitConverter.ToString(algorithm.ComputeHash(bytes)) != "0E-D4-4F-CB-0F-2B-57-F0-41-89-19-B3-21-DA-14-4B-D7-D0-0B-BB")
  42.         {
  43.         Console.WriteLine("HASH PASSWORD_944769");
  44.         Console.WriteLine( BitConverter.ToString(algorithm.ComputeHash(bytes)) );
  45.         Console.WriteLine( BitConverter.ToInt32(algorithm.ComputeHash(bytes),0) );
  46.         Console.WriteLine(Convert.ToBase64String(algorithm.ComputeHash(bytes)));
  47.         Console.WriteLine("HASH TO RESHTEH");
  48.         }
  49.                 else
  50.                 Console.WriteLine("مقدار اشتباه می باشد.");
  51. }
  52.         public static string FormatBytes(byte[] bytes)
  53.            {
  54.                string value = "";
  55.                foreach (var byt in bytes)
  56.                value += string.Format("{0:X2} ", byt);
  57.                return value;
  58.            }
  59. }
  60.  
  61.  
Parsed in 0.016 seconds