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. Visual Basic
  4. i need to make a sha512

i need to make a sha512

Scheduled Pinned Locked Moved Visual Basic
csharpvisual-studiohelp
9 Posts 6 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.
  • M Offline
    M Offline
    moonshaddow
    wrote on last edited by
    #1

    i would like to make a sha512 but i don't want to use the ones provided by visual studio. can some help

    J.Hardy

    D C L 3 Replies Last reply
    0
    • M moonshaddow

      i would like to make a sha512 but i don't want to use the ones provided by visual studio. can some help

      J.Hardy

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      So what do you want to use?? Google for "SHA512 library" and see what you come up with.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      M 1 Reply Last reply
      0
      • D Dave Kreskowiak

        So what do you want to use?? Google for "SHA512 library" and see what you come up with.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        M Offline
        M Offline
        moonshaddow
        wrote on last edited by
        #3

        searched Google and found this going to try to adapt it, do you think this will work?

        Option Explicit
        '****************************************************************************************
        'API CONSTANTS
        '****************************************************************************************
        Private Enum EditTypes
        WM_CUT = &H300
        WM_COPY = &H301
        WM_PASTE = &H302
        WM_CLEAR = &H303
        WM_UNDO = &H304
        End Enum

        Const EM_CANUNDO = &HC6
        Const EM_GETMODIFY = &HB8

        '****************************************************************************************
        'API FUNCTIONS
        '****************************************************************************************
        Private Declare Function SendMessage Lib "user32" _
        Alias "SendMessageA" ( _
        ByVal hWnd As Long, _
        ByVal wMsg As Long, _
        ByVal wParam As Long, _
        lParam As Any) _
        As Long

        '****************************************************************************************
        'CONSTANTS - PRIVATE
        '****************************************************************************************
        'filter for dialog
        Private Const mFILEMASK = "Text Files (*.txt)|*.txt|" & _
        "Encrypted Text Files (*.etf)|*.etf|" & _
        "All Files (*.*)|*.*"
        'Initial caption for form
        Private Const mCAPTION = "Text Encryption Utility"

        'edit menu item constants
        Const mUNDO = 0
        Const mCUT = 2
        Const mCOPY = 3
        Const mPASTE = 4
        Const mDELETE = 5
        'toolbar item constants
        Const mUNDOTOOL = 7
        Const mCUTTOOL = 8
        Const mCOPYTOOL = 9
        Const mPASTETOOL = 10
        Const mDELETETOOL = 11

        'encoder increment value - needs to be same for encryption and decryption
        Const mENCODE = 3

        '****************************************************************************************
        'VARIABLES - PRIVATE
        '****************************************************************************************
        'flag to track status of control key - True means control key is pressed
        Private mbControlKey As Boolean
        'flag to track changes in open document
        Private mbIsDirty As Boolean
        Private msFileTitle As String

        '****************************************************************************************
        'EVENTS - PRIVATE
        '****************************************************************************************
        Private Sub Form_Activate()
        ToggleEditMenu
        mbIsDirty = False
        End Sub

        Private Sub Form_Load()
        Call NewDocument
        End Sub

        Private Sub Form_QueryUnload(Cancel As In

        A D M 3 Replies Last reply
        0
        • M moonshaddow

          searched Google and found this going to try to adapt it, do you think this will work?

          Option Explicit
          '****************************************************************************************
          'API CONSTANTS
          '****************************************************************************************
          Private Enum EditTypes
          WM_CUT = &H300
          WM_COPY = &H301
          WM_PASTE = &H302
          WM_CLEAR = &H303
          WM_UNDO = &H304
          End Enum

          Const EM_CANUNDO = &HC6
          Const EM_GETMODIFY = &HB8

          '****************************************************************************************
          'API FUNCTIONS
          '****************************************************************************************
          Private Declare Function SendMessage Lib "user32" _
          Alias "SendMessageA" ( _
          ByVal hWnd As Long, _
          ByVal wMsg As Long, _
          ByVal wParam As Long, _
          lParam As Any) _
          As Long

          '****************************************************************************************
          'CONSTANTS - PRIVATE
          '****************************************************************************************
          'filter for dialog
          Private Const mFILEMASK = "Text Files (*.txt)|*.txt|" & _
          "Encrypted Text Files (*.etf)|*.etf|" & _
          "All Files (*.*)|*.*"
          'Initial caption for form
          Private Const mCAPTION = "Text Encryption Utility"

          'edit menu item constants
          Const mUNDO = 0
          Const mCUT = 2
          Const mCOPY = 3
          Const mPASTE = 4
          Const mDELETE = 5
          'toolbar item constants
          Const mUNDOTOOL = 7
          Const mCUTTOOL = 8
          Const mCOPYTOOL = 9
          Const mPASTETOOL = 10
          Const mDELETETOOL = 11

          'encoder increment value - needs to be same for encryption and decryption
          Const mENCODE = 3

          '****************************************************************************************
          'VARIABLES - PRIVATE
          '****************************************************************************************
          'flag to track status of control key - True means control key is pressed
          Private mbControlKey As Boolean
          'flag to track changes in open document
          Private mbIsDirty As Boolean
          Private msFileTitle As String

          '****************************************************************************************
          'EVENTS - PRIVATE
          '****************************************************************************************
          Private Sub Form_Activate()
          ToggleEditMenu
          mbIsDirty = False
          End Sub

          Private Sub Form_Load()
          Call NewDocument
          End Sub

          Private Sub Form_QueryUnload(Cancel As In

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          No idea. I have better things to do than read screens full of someone else's code. Try it and see?

          Bob Ashfield Consultants Ltd

          1 Reply Last reply
          0
          • M moonshaddow

            searched Google and found this going to try to adapt it, do you think this will work?

            Option Explicit
            '****************************************************************************************
            'API CONSTANTS
            '****************************************************************************************
            Private Enum EditTypes
            WM_CUT = &H300
            WM_COPY = &H301
            WM_PASTE = &H302
            WM_CLEAR = &H303
            WM_UNDO = &H304
            End Enum

            Const EM_CANUNDO = &HC6
            Const EM_GETMODIFY = &HB8

            '****************************************************************************************
            'API FUNCTIONS
            '****************************************************************************************
            Private Declare Function SendMessage Lib "user32" _
            Alias "SendMessageA" ( _
            ByVal hWnd As Long, _
            ByVal wMsg As Long, _
            ByVal wParam As Long, _
            lParam As Any) _
            As Long

            '****************************************************************************************
            'CONSTANTS - PRIVATE
            '****************************************************************************************
            'filter for dialog
            Private Const mFILEMASK = "Text Files (*.txt)|*.txt|" & _
            "Encrypted Text Files (*.etf)|*.etf|" & _
            "All Files (*.*)|*.*"
            'Initial caption for form
            Private Const mCAPTION = "Text Encryption Utility"

            'edit menu item constants
            Const mUNDO = 0
            Const mCUT = 2
            Const mCOPY = 3
            Const mPASTE = 4
            Const mDELETE = 5
            'toolbar item constants
            Const mUNDOTOOL = 7
            Const mCUTTOOL = 8
            Const mCOPYTOOL = 9
            Const mPASTETOOL = 10
            Const mDELETETOOL = 11

            'encoder increment value - needs to be same for encryption and decryption
            Const mENCODE = 3

            '****************************************************************************************
            'VARIABLES - PRIVATE
            '****************************************************************************************
            'flag to track status of control key - True means control key is pressed
            Private mbControlKey As Boolean
            'flag to track changes in open document
            Private mbIsDirty As Boolean
            Private msFileTitle As String

            '****************************************************************************************
            'EVENTS - PRIVATE
            '****************************************************************************************
            Private Sub Form_Activate()
            ToggleEditMenu
            mbIsDirty = False
            End Sub

            Private Sub Form_Load()
            Call NewDocument
            End Sub

            Private Sub Form_QueryUnload(Cancel As In

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            First of all, it's VB6 code, not VB.NET and most of which has nothing to do with SHA512 at all. Next, if this is your level of knowledge, you'd be MUCH better off usingthe built in library and not trying to do this yourself.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            1 Reply Last reply
            0
            • M moonshaddow

              i would like to make a sha512 but i don't want to use the ones provided by visual studio. can some help

              J.Hardy

              C Offline
              C Offline
              Colin Angus Mackay
              wrote on last edited by
              #6

              moonshaddow wrote:

              sha512 but i don't want to use the ones provided by visual studio

              Why not? Until people understand what your objection to the built in version is they are unlikely to help you. The reason is that the built in SHA512 encryption is already optimised and stable. This is something you are unlikely to have the time to do.

              Recent blog posts: *SQL Server / Visual Studio install order *Installing SQL Server 2005 on Vista *Crazy Extension Methods Redux * Mixins My Blog

              1 Reply Last reply
              0
              • M moonshaddow

                i would like to make a sha512 but i don't want to use the ones provided by visual studio. can some help

                J.Hardy

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

                There's no reason not to use those.

                M 1 Reply Last reply
                0
                • L Lost User

                  There's no reason not to use those.

                  M Offline
                  M Offline
                  moonshaddow
                  wrote on last edited by
                  #8

                  oh well, don't worry, i am going to learn about sha512 and i'm thinking of trying to adapt the one in wiki, but thanks anyway

                  J.Hardy

                  1 Reply Last reply
                  0
                  • M moonshaddow

                    searched Google and found this going to try to adapt it, do you think this will work?

                    Option Explicit
                    '****************************************************************************************
                    'API CONSTANTS
                    '****************************************************************************************
                    Private Enum EditTypes
                    WM_CUT = &H300
                    WM_COPY = &H301
                    WM_PASTE = &H302
                    WM_CLEAR = &H303
                    WM_UNDO = &H304
                    End Enum

                    Const EM_CANUNDO = &HC6
                    Const EM_GETMODIFY = &HB8

                    '****************************************************************************************
                    'API FUNCTIONS
                    '****************************************************************************************
                    Private Declare Function SendMessage Lib "user32" _
                    Alias "SendMessageA" ( _
                    ByVal hWnd As Long, _
                    ByVal wMsg As Long, _
                    ByVal wParam As Long, _
                    lParam As Any) _
                    As Long

                    '****************************************************************************************
                    'CONSTANTS - PRIVATE
                    '****************************************************************************************
                    'filter for dialog
                    Private Const mFILEMASK = "Text Files (*.txt)|*.txt|" & _
                    "Encrypted Text Files (*.etf)|*.etf|" & _
                    "All Files (*.*)|*.*"
                    'Initial caption for form
                    Private Const mCAPTION = "Text Encryption Utility"

                    'edit menu item constants
                    Const mUNDO = 0
                    Const mCUT = 2
                    Const mCOPY = 3
                    Const mPASTE = 4
                    Const mDELETE = 5
                    'toolbar item constants
                    Const mUNDOTOOL = 7
                    Const mCUTTOOL = 8
                    Const mCOPYTOOL = 9
                    Const mPASTETOOL = 10
                    Const mDELETETOOL = 11

                    'encoder increment value - needs to be same for encryption and decryption
                    Const mENCODE = 3

                    '****************************************************************************************
                    'VARIABLES - PRIVATE
                    '****************************************************************************************
                    'flag to track status of control key - True means control key is pressed
                    Private mbControlKey As Boolean
                    'flag to track changes in open document
                    Private mbIsDirty As Boolean
                    Private msFileTitle As String

                    '****************************************************************************************
                    'EVENTS - PRIVATE
                    '****************************************************************************************
                    Private Sub Form_Activate()
                    ToggleEditMenu
                    mbIsDirty = False
                    End Sub

                    Private Sub Form_Load()
                    Call NewDocument
                    End Sub

                    Private Sub Form_QueryUnload(Cancel As In

                    M Offline
                    M Offline
                    Mark Churchill
                    wrote on last edited by
                    #9

                    That isn't SHA512. Its not even SHA. Its not even a hash. It barely even counts as encryption. Its an extremely weak obfuscation using a key of "3". Its about as secure as ROT13. This is why you ALWAYS use the built in functions. You SHOULD NOT try to make your own implementation, because at best you are wasting your time, and more likely you will screw something up. You should NEVER, EVER, EVER try to design your own encryption algorithm, because when people try to do this they end up with something which is trivially vulnerable because they don't understand the maths behind it. Use the built in API.

                    Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
                    Alpha release: Entanglar: Transparant multiplayer framework for .Net games.

                    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