public Password CreatePasswordData(string password) { byte[] saltBytes = new byte[hashBytesCount]; new CryptoRandom().NextBytes(saltBytes); string nextSalt = saltBytes.ToB64(); byte[] hashBytes = new PBKDF2(sha384Func, password, saltBytes, iterationCount) .GetBytes(hashBytesCount); var passwordData = new Password { NextLoginSalt = nextSalt, NextPasswordHash = hashBytes.ToB64() }; return(passwordData); }