public string CalcHash() { string data = ""; data += Date0.Ticks + PreviousHash + (int)Type; data += SenderHash + RecieverHash + VotingNumber + Info; return(CommonHelpers.CalcHash(data)); }
static public bool Login(string password) { if (PublicKey != null && PrivateKeyCrypted != null && PasswordHash != null) { if (PasswordHash == CommonHelpers.CalcHash(password)) { PrivateKey = CryptoHelper.Decrypt(PrivateKeyCrypted, password); return(true); } } return(false); }
public string CalcHash() { string data = ""; data += Date0.Ticks + PreviousHash + Number; foreach (var tr in Transactions) { data += tr; } return(CommonHelpers.CalcHash(data)); }
static public void Register(string publicKey, string privateKey, string password) { string privateKeyCrypted = Convert.ToBase64String(CryptoHelper.Encrypt(Encoding.UTF8.GetBytes(privateKey), password)); string passwordHash = CommonHelpers.CalcHash(password); prefEditor.PutString("publicKey", publicKey); prefEditor.PutString("privateKeyCrypted", privateKeyCrypted); prefEditor.PutString("passwordHash", passwordHash); prefEditor.PutString("createOwnBlocks", true.ToString()); prefEditor.PutString("theme", 0.ToString()); prefEditor.PutString("trackers", Trackers); prefEditor.PutString("peerDiscovery", true.ToString()); prefEditor.PutString("useLanLocalIP", true.ToString()); prefEditor.Commit(); }