@@ -17,38 +17,38 @@ public class Password : IPassword
1717 private const bool DefaultIncludeUppercase = true ;
1818 private const bool DefaultIncludeNumeric = true ;
1919 private const bool DefaultIncludeSpecial = true ;
20- private static RNGCryptoServiceProvider _rng ;
20+ private static RandomNumberGenerator _rng ;
2121
2222 public Password ( )
2323 {
2424 Settings = new PasswordSettings ( DefaultIncludeLowercase , DefaultIncludeUppercase ,
2525 DefaultIncludeNumeric , DefaultIncludeSpecial , DefaultPasswordLength , DefaultMaxPasswordAttempts ,
2626 true ) ;
2727
28- _rng = new RNGCryptoServiceProvider ( ) ;
28+ _rng = RandomNumberGenerator . Create ( ) ;
2929 }
3030
3131 public Password ( IPasswordSettings settings )
3232 {
3333 Settings = settings ;
3434
35- _rng = new RNGCryptoServiceProvider ( ) ;
35+ _rng = RandomNumberGenerator . Create ( ) ;
3636 }
3737
3838 public Password ( int passwordLength )
3939 {
4040 Settings = new PasswordSettings ( DefaultIncludeLowercase , DefaultIncludeUppercase ,
4141 DefaultIncludeNumeric , DefaultIncludeSpecial , passwordLength , DefaultMaxPasswordAttempts , true ) ;
42-
43- _rng = new RNGCryptoServiceProvider ( ) ;
42+
43+ _rng = RandomNumberGenerator . Create ( ) ;
4444 }
4545
4646 public Password ( bool includeLowercase , bool includeUppercase , bool includeNumeric , bool includeSpecial )
4747 {
4848 Settings = new PasswordSettings ( includeLowercase , includeUppercase , includeNumeric ,
4949 includeSpecial , DefaultPasswordLength , DefaultMaxPasswordAttempts , false ) ;
5050
51- _rng = new RNGCryptoServiceProvider ( ) ;
51+ _rng = RandomNumberGenerator . Create ( ) ;
5252 }
5353
5454 public Password ( bool includeLowercase , bool includeUppercase , bool includeNumeric , bool includeSpecial ,
@@ -57,7 +57,7 @@ public Password(bool includeLowercase, bool includeUppercase, bool includeNumeri
5757 Settings = new PasswordSettings ( includeLowercase , includeUppercase , includeNumeric ,
5858 includeSpecial , passwordLength , DefaultMaxPasswordAttempts , false ) ;
5959
60- _rng = new RNGCryptoServiceProvider ( ) ;
60+ _rng = RandomNumberGenerator . Create ( ) ;
6161 }
6262
6363 public Password ( bool includeLowercase , bool includeUppercase , bool includeNumeric , bool includeSpecial ,
@@ -66,7 +66,7 @@ public Password(bool includeLowercase, bool includeUppercase, bool includeNumeri
6666 Settings = new PasswordSettings ( includeLowercase , includeUppercase , includeNumeric ,
6767 includeSpecial , passwordLength , maximumAttempts , false ) ;
6868
69- _rng = new RNGCryptoServiceProvider ( ) ;
69+ _rng = RandomNumberGenerator . Create ( ) ;
7070 }
7171
7272 public IPasswordSettings Settings { get ; set ; }
0 commit comments