using System;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;

namespace Key_Generator
{
    public partial class Main : Form
    {
        public Main() { InitializeComponent(); }

        private void MacAddress_TextChanged(Object Sender, EventArgs Args)
        {
            String Hash = CreateSHA512(String.Format("{0}:efe5ee8e888c468596c2d98ed65b2bf7:5425d322a2dd4e898e625e7601302092", MacAddressHash.Text));

            Output.Text = Hash;
        }

        private String CreateSHA512(String Input)
        {
            Byte[] InputArray = Encoding.UTF8.GetBytes(Input);

            using (SHA512 SHA512Creator = SHA512.Create())
            {
                Byte[] HashedInputArray = SHA512Creator.ComputeHash(InputArray);

                StringBuilder SHA512Builder = new StringBuilder(128);

                foreach (Byte HashByte in HashedInputArray) { SHA512Builder.Append(HashByte.ToString("X2")); }

                return SHA512Builder.ToString();
            }
        }
    }
}
