public void MakeKeyFromPasswordBase64() { var service = new BouncyCastleKeyDerivationService(); var key = service.DeriveKey(Encoding.UTF8.GetBytes("123456"), Encoding.UTF8.GetBytes("salt"), 5000); Assert.True(key.SequenceEqual(GetKey())); }
public void HashPasswordBase64() { var service = new BouncyCastleKeyDerivationService(); var hash = service.DeriveKey(GetKey(), Encoding.UTF8.GetBytes("123456"), 1); var hashBytes = Convert.FromBase64String("7Bsl4ponrsFu0jGl4yMeLZp5tKqx6g4tLrXhMszIsjQ="); Assert.True(hash.SequenceEqual(hashBytes)); }