Getting Bytes from Class
-
Hello, I am currently making a Login System. But I wanted this option to be there that it checks for the bytes to be the same on runtime. (For potential crackers) I tried a lot but I don't seem to find the problem. This is just a small example code:
Public Shared Function ByteEqual
Dim first1 As Byte() = System.Text.Encoding.Default.GetBytes(My.Resources.LoginSystem)
Dim second1 As Byte() = System.Text.Encoding.Default.GetBytes(My.Resources.LoginSystem)If first1.Length = second1.Length Then MessageBox.Show("True") Else MessageBox.Show("False") End If End Function
This is working but I want the "My.Resources.Loginsystem" to be a certain class in my project. Is this possible without injecting?
-
Hello, I am currently making a Login System. But I wanted this option to be there that it checks for the bytes to be the same on runtime. (For potential crackers) I tried a lot but I don't seem to find the problem. This is just a small example code:
Public Shared Function ByteEqual
Dim first1 As Byte() = System.Text.Encoding.Default.GetBytes(My.Resources.LoginSystem)
Dim second1 As Byte() = System.Text.Encoding.Default.GetBytes(My.Resources.LoginSystem)If first1.Length = second1.Length Then MessageBox.Show("True") Else MessageBox.Show("False") End If End Function
This is working but I want the "My.Resources.Loginsystem" to be a certain class in my project. Is this possible without injecting?
blackchaosv2 wrote:
But I wanted this option to be there that it checks for the bytes to be the same on runtime. (For potential crackers)
..my first vector of attack would be using ILSpy or reflector, identifying the method that returns "true" on a successful login. What does "the same runtime" mean? Calculate a hash over your bytes. When distributing, distribute the hash along. Calculate a new hash when you "fetch" your bytes - it should return the same value as the hash you already calculated and distributed. If there's no match, the bytes have been modified.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
blackchaosv2 wrote:
But I wanted this option to be there that it checks for the bytes to be the same on runtime. (For potential crackers)
..my first vector of attack would be using ILSpy or reflector, identifying the method that returns "true" on a successful login. What does "the same runtime" mean? Calculate a hash over your bytes. When distributing, distribute the hash along. Calculate a new hash when you "fetch" your bytes - it should return the same value as the hash you already calculated and distributed. If there's no match, the bytes have been modified.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
Sorry, I meant to say whenever someone executes the application and I hard-coded my login system into a class. Let's say they reflected it and adjusted some property's with Reflector. I want the application to detect this, whenever the user made any adjustments in the ASSEMBLY. The function I posted works but I don't want to grab my class out of My.Resources. I want it to be in the project files itself.
-
Sorry, I meant to say whenever someone executes the application and I hard-coded my login system into a class. Let's say they reflected it and adjusted some property's with Reflector. I want the application to detect this, whenever the user made any adjustments in the ASSEMBLY. The function I posted works but I don't want to grab my class out of My.Resources. I want it to be in the project files itself.
-
I am on my phone as for right now. I hope someone could link me once I am back.
-
I am on my phone as for right now. I hope someone could link me once I am back.
blackchaosv2 wrote:
I hope someone could link me once I am back.
..I suggest you take the time to research the topic and understand what you're doing. You can access the documentation[^] on your phone, and it includes a sample.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]