Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions quest-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"Semester": "Selenium",
"ParentNodeId": 286016
"ParentNodeId": 308199
},
{
"Label": "user-feedback",
Expand All @@ -45,5 +45,5 @@
"ParentNodeId": 227485
}
],
"DefaultParentNode": 286016
"DefaultParentNode": 308199
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ array<Byte>^ CreateRandomSalt(int length)
randomBytes = gcnew array <Byte>(1);
}

// Create a new RNGCryptoServiceProvider.
RNGCryptoServiceProvider^ cryptoRNGProvider =
gcnew RNGCryptoServiceProvider();
// Create a new RandomNumberGenerator.
RandomNumberGenerator^ randomNumberGenerator =
RandomNumberGenerator::Create();

// Fill the buffer with random bytes.
cryptoRNGProvider->GetBytes(randomBytes);
randomNumberGenerator->GetBytes(randomBytes);

// return the bytes.
return randomBytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ int main()
// secret key shared by sender and receiver.
array<Byte>^secretkey = gcnew array<Byte>(64);

//RNGCryptoServiceProvider is an implementation of a random number generator.
RNGCryptoServiceProvider^ rng = gcnew RNGCryptoServiceProvider;
RandomNumberGenerator^ rng = RandomNumberGenerator::Create();

// The array is now filled with cryptographically strong random bytes.
rng->GetBytes( secretkey );
Expand Down
2 changes: 2 additions & 0 deletions snippets/cpp/VS_Snippets_CLR/HMACRIPEMD160/CPP/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
System.Security.Cryptography.HMACRIPEMD160.exe: hmacripemd160.cpp
cl /FeSystem.Security.Cryptography.HMACRIPEMD160.exe /clr:pure hmacripemd160.cpp
3 changes: 1 addition & 2 deletions snippets/cpp/VS_Snippets_CLR/HMACSHA256/CPP/hmacsha256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ int main()
// secret key shared by sender and receiver.
array<Byte>^secretkey = gcnew array<Byte>(64);

//RNGCryptoServiceProvider is an implementation of a random number generator.
RNGCryptoServiceProvider^ rng = gcnew RNGCryptoServiceProvider;
RandomNumberGenerator^ rng = RandomNumberGenerator::Create();

// The array is now filled with cryptographically strong random bytes.
rng->GetBytes( secretkey );
Expand Down
2 changes: 2 additions & 0 deletions snippets/cpp/VS_Snippets_CLR/HMACSHA256/CPP/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
System.Security.Cryptography.HMACSHA256.exe: hmacsha256.cpp
cl /FeSystem.Security.Cryptography.HMACSHA256.exe /clr:pure hmacsha256.cpp
3 changes: 1 addition & 2 deletions snippets/cpp/VS_Snippets_CLR/HMACSHA384/CPP/hmacsha384.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ int main()
// secret key shared by sender and receiver.
array<Byte>^secretkey = gcnew array<Byte>(64);

//RNGCryptoServiceProvider is an implementation of a random number generator.
RNGCryptoServiceProvider^ rng = gcnew RNGCryptoServiceProvider;
RandomNumberGenerator^ rng = RandomNumberGenerator::Create();

// The array is now filled with cryptographically strong random bytes.
rng->GetBytes( secretkey );
Expand Down
2 changes: 2 additions & 0 deletions snippets/cpp/VS_Snippets_CLR/HMACSHA384/CPP/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
System.Security.Cryptography.HMACSHA384.exe: hmacsha384.cpp
cl /FeSystem.Security.Cryptography.HMACSHA384.exe /clr:pure hmacsha384.cpp
5 changes: 2 additions & 3 deletions snippets/cpp/VS_Snippets_CLR/HMACSHA512/CPP/hmacsha512.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ int main()
// Create a random key using a random number generator. This would be the
// secret key shared by sender and receiver.
array<Byte>^secretkey = gcnew array<Byte>(64);

//RNGCryptoServiceProvider is an implementation of a random number generator.
RNGCryptoServiceProvider^ rng = gcnew RNGCryptoServiceProvider;

RandomNumberGenerator^ rng = RandomNumberGenerator::Create();

// The array is now filled with cryptographically strong random bytes.
rng->GetBytes( secretkey );
Expand Down
2 changes: 2 additions & 0 deletions snippets/cpp/VS_Snippets_CLR/HMACSHA512/CPP/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
System.Security.Cryptography.HMACSHA512.exe: hmacsha512.cpp
cl /FeSystem.Security.Cryptography.HMACSHA512.exe /clr:pure hmacsha512.cpp
4 changes: 2 additions & 2 deletions snippets/cpp/VS_Snippets_CLR/rfc28981/CPP/rfc28981.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ int main()
String^ pwd1 = passwordargs[ 1 ];

array<Byte>^salt1 = gcnew array<Byte>(8);
RNGCryptoServiceProvider ^ rngCsp = gcnew RNGCryptoServiceProvider();
rngCsp->GetBytes(salt1);
RandomNumberGenerator^ rng = RandomNumberGenerator::Create();
rng->GetBytes(salt1);
//data1 can be a string or contents of a file.
String^ data1 = "Some test data";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public ref class Form1: public Form
// <Snippet1>
array<Byte>^ random = gcnew array<Byte>(100);

//RNGCryptoServiceProvider is an implementation of a random number generator.
RNGCryptoServiceProvider^ rng = gcnew RNGCryptoServiceProvider;
RandomNumberGenerator^ rng = RandomNumberGenerator::Create();
rng->GetBytes( random ); // The array is now filled with cryptographically strong random bytes.
// </Snippet1>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public ref class Form1: public Form
{
// <Snippet1>
array<Byte>^ random = gcnew array<Byte>(100);
//RNGCryptoServiceProvider is an implementation of a random number generator.
RNGCryptoServiceProvider^ rng = gcnew RNGCryptoServiceProvider;
RandomNumberGenerator^ rng = RandomNumberGenerator::Create();
rng->GetNonZeroBytes( random ); // The array is now filled with cryptographically strong random bytes, and none are zero.
// </Snippet1>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ref class RSAEncoder

// Create a random number using the RNGCryptoServiceProvider provider.
//<Snippet6>
RNGCryptoServiceProvider^ ring = gcnew RNGCryptoServiceProvider;
RandomNumberGenerator^ ring = RandomNumberGenerator::Create();
rsaFormatter->Rng = ring;
//</Snippet6>

Expand Down Expand Up @@ -190,7 +190,7 @@ int main()
//
// Encoding the following message:
// A phrase to be encoded.
// Resulting message encoded: %?}T:v??xu?eD)YucItjwuALH HB,Uj??2xq?.?s45
// Resulting message encoded: %?}T:v??xu?eD)YucItjwu¦ALH HB,Uj??2xq?.?s45
// ?f?L2?=X?CPzWx???"q5?6&N"AE,Z+T?(]S?_7~,?G{?VV!:S?df?
// Resulting message decoded:
// A phrase to be encoded.
Expand Down
6 changes: 3 additions & 3 deletions snippets/csharp/System.Data/EntityKey/Overview/app.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="AdventureWorksEntities" connectionString="metadata=res://*/AdventureWorksModel.csdl|res://*/AdventureWorksModel.ssdl|res://*/AdventureWorksModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=juliakornich;Initial Catalog=AdventureWorks;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
<add name="SchoolEntities" connectionString="metadata=res://*/School.csdl|res://*/School.ssdl|res://*/School.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=juliakornich;Initial Catalog=School;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
<add name="AdventureWorksEntities" connectionString="metadata=res://*/AdventureWorksModel.csdl|res://*/AdventureWorksModel.ssdl|res://*/AdventureWorksModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=AdventureWorks;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
<add name="SchoolEntities" connectionString="metadata=res://*/School.csdl|res://*/School.ssdl|res://*/School.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=School;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>
</configuration>

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public static void Main(string[] Fileargs)
// Create a random key using a random number generator. This would be the
// secret key shared by sender and receiver.
byte[] secretkey = new Byte[64];
//RNGCryptoServiceProvider is an implementation of a random number generator.
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())

using (RandomNumberGenerator rng = RandomNumberGenerator.Create())
{
// The array is now filled with cryptographically strong random bytes.
rng.GetBytes(secretkey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public static void Main(string[] Fileargs)
// Create a random key using a random number generator. This would be the
// secret key shared by sender and receiver.
byte[] secretkey = new Byte[64];
//RNGCryptoServiceProvider is an implementation of a random number generator.
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())

using (RandomNumberGenerator rng = RandomNumberGenerator.Create())
{
// The array is now filled with cryptographically strong random bytes.
rng.GetBytes(secretkey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public static void Main(string[] Fileargs)
// Create a random key using a random number generator. This would be the
// secret key shared by sender and receiver.
byte[] secretkey = new Byte[64];
//RNGCryptoServiceProvider is an implementation of a random number generator.
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())

using (RandomNumberGenerator rng = RandomNumberGenerator.Create())
{
// The array is now filled with cryptographically strong random bytes.
rng.GetBytes(secretkey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public static void Main(string[] Fileargs)
// Create a random key using a random number generator. This would be the
// secret key shared by sender and receiver.
byte[] secretkey = new Byte[64];
//RNGCryptoServiceProvider is an implementation of a random number generator.
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())

using (RandomNumberGenerator rng = RandomNumberGenerator.Create())
{
// The array is now filled with cryptographically strong random bytes.
rng.GetBytes(secretkey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public static void Main(string[] Fileargs)
// Create a random key using a random number generator. This would be the
// secret key shared by sender and receiver.
byte[] secretkey = new Byte[24];
//RNGCryptoServiceProvider is an implementation of a random number generator.
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())

using (RandomNumberGenerator rng = RandomNumberGenerator.Create())
{
// The array is now filled with cryptographically strong random bytes.
rng.GetBytes(secretkey);
Expand Down
Loading