public void VerifyInputs()
    {
        if (clawmailField.text.Contains("@ggc.edu"))
        {
            clawmailField.text.Remove((clawmailField.text.IndexOf('@') + 7));
        }

        SHA512 sha = new SHA512Managed();

        sha.ComputeHash(ASCIIEncoding.ASCII.GetBytes("ourlordandsaviorkirby" + clawmailField.text));

        byte[]        saltByte   = sha.Hash /*SHA512.Create("ourlordandsaviorkirby" + clawmailField.text).Hash*/;
        StringBuilder strBuilder = new StringBuilder();

        for (int i = 0; i < saltByte.Length; i++)
        {
            strBuilder.Append(saltByte[i].ToString("x2"));
        }
        salt = strBuilder.ToString();
        hash = UnixCrypt.Crypt(salt, passwordField.text); //HashAlgorithm.Create();

        registerBtn.interactable = (clawmailField.text.Contains("@ggc.edu") && passwordField.text.Length >= 8);
    }
Ejemplo n.º 2
0
 /// Encodes the specified string.
 /// @param text The string to encode.
 /// @returns The encoded string.
 public string Encode(string text)
 {
     return(UnixCrypt.Crypt(text));
 }