From ec725c6e0b9350346f4488be1e22aab3f56b64c3 Mon Sep 17 00:00:00 2001 From: mm-psy <147830298+mm-psy@users.noreply.github.com> Date: Thu, 6 Nov 2025 13:39:47 +0100 Subject: [PATCH 1/3] Test er --- MyProj/Program.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MyProj/Program.cs b/MyProj/Program.cs index f0728ae..0faa0f8 100644 --- a/MyProj/Program.cs +++ b/MyProj/Program.cs @@ -2,8 +2,14 @@ using Newtonsoft.Json; // Add this using directive Console.WriteLine("Hello, World!"); +string user = "admin"; +string password = "admin123"; var myClassInstance = new MyClass { MyInt = 42, MyString = "Hello" }; +var admin = new { Username = user, Password = password }; + string myClassJson = JsonConvert.SerializeObject(myClassInstance); -Console.WriteLine("Serialized MyClass JSON: " + myClassJson); \ No newline at end of file +Console.WriteLine("Serialized MyClass JSON: " + myClassJson); + +System.Console.WriteLine("Admin Credentials: " + JsonConvert.SerializeObject(admin)); \ No newline at end of file From c072c41639048a6d452ed713d84189b7629b9fbc Mon Sep 17 00:00:00 2001 From: mm-psy <147830298+mm-psy@users.noreply.github.com> Date: Thu, 6 Nov 2025 13:55:35 +0100 Subject: [PATCH 2/3] Revert "Test er" This reverts commit ec725c6e0b9350346f4488be1e22aab3f56b64c3. --- MyProj/Program.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/MyProj/Program.cs b/MyProj/Program.cs index 0faa0f8..f0728ae 100644 --- a/MyProj/Program.cs +++ b/MyProj/Program.cs @@ -2,14 +2,8 @@ using Newtonsoft.Json; // Add this using directive Console.WriteLine("Hello, World!"); -string user = "admin"; -string password = "admin123"; var myClassInstance = new MyClass { MyInt = 42, MyString = "Hello" }; -var admin = new { Username = user, Password = password }; - string myClassJson = JsonConvert.SerializeObject(myClassInstance); -Console.WriteLine("Serialized MyClass JSON: " + myClassJson); - -System.Console.WriteLine("Admin Credentials: " + JsonConvert.SerializeObject(admin)); \ No newline at end of file +Console.WriteLine("Serialized MyClass JSON: " + myClassJson); \ No newline at end of file From 337196a850078d523483dad1a95fa48a1cb957cd Mon Sep 17 00:00:00 2001 From: mm-psy <147830298+mm-psy@users.noreply.github.com> Date: Thu, 6 Nov 2025 15:41:57 +0100 Subject: [PATCH 3/3] Test er2 --- MyProj/Program.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/MyProj/Program.cs b/MyProj/Program.cs index f0728ae..408544a 100644 --- a/MyProj/Program.cs +++ b/MyProj/Program.cs @@ -6,4 +6,16 @@ var myClassInstance = new MyClass { MyInt = 42, MyString = "Hello" }; string myClassJson = JsonConvert.SerializeObject(myClassInstance); -Console.WriteLine("Serialized MyClass JSON: " + myClassJson); \ No newline at end of file +Console.WriteLine("Serialized MyClass JSON: " + myClassJson); + +string password = GeneratePassword(); +Console.WriteLine("Generated Password: " + password); + +string GeneratePassword() +{ + // BAD: Password is generated using a cryptographically insecure RNG + Random gen = new Random(); + string password = "mypassword" + gen.Next(); + + return password; +} \ No newline at end of file