Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Getting Bytes from Class

Getting Bytes from Class

Scheduled Pinned Locked Moved .NET (Core and Framework)
helptutorialquestion
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    blackchaosv2
    wrote on last edited by
    #1

    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?

    L 1 Reply Last reply
    0
    • B blackchaosv2

      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?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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[^]

      B 1 Reply Last reply
      0
      • L Lost User

        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[^]

        B Offline
        B Offline
        blackchaosv2
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • B blackchaosv2

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          blackchaosv2 wrote:

          I want the application to detect this

          Like I said, generate a hash. You can Google for info how it works, or wait until somebody posts a relevant link or code.

          Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

          B 1 Reply Last reply
          0
          • L Lost User

            blackchaosv2 wrote:

            I want the application to detect this

            Like I said, generate a hash. You can Google for info how it works, or wait until somebody posts a relevant link or code.

            Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]

            B Offline
            B Offline
            blackchaosv2
            wrote on last edited by
            #5

            I am on my phone as for right now. I hope someone could link me once I am back.

            L 1 Reply Last reply
            0
            • B blackchaosv2

              I am on my phone as for right now. I hope someone could link me once I am back.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups