Sign in to follow this  
Followers 0
themax90

Hex Conversion Tool

5 posts in this topic

#1 ·  Posted (edited)

Well, I have been using Hex to encrypt passwords but not too lightly that way they don't show up in plain text. I needed an automated converter so that I can find it out for administration purposes. Here it is:

; ----------------------------------------------------------------------------
; AutoIt Version: 3.1.1.91 BETA (Will Work With AutoIt v3 Non-Beta)
; Author:       Max Gardner(AutoIt Smith;king.of.all@comcast.net)
; Script Function:
;   Small Hex Utility
; ----------------------------------------------------------------------------
Local $GUI_EVENT_CLOSE = -3
Local $WS_VSCROLL = 0x00200000
$GUI = GUICreate("Hex Converter", 340, 140, (@DesktopWidth - 340) / 2, (@DesktopHeight - 140) / 2)
$String = GUICtrlCreateEdit("", 10, 10, 320, 90, $WS_VSCROLL)
$StringToHex = GUICtrlCreateButton("StringToHex", 10, 110, 90, 20)
$HexToString = GUICtrlCreateButton("HexToString", 110, 110, 90, 20)
$CopyToClipboard = GUICtrlCreateButton("CopyToClipboard", 210, 110, 120, 20)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $StringToHex
            GUICtrlSetData($String, _StringToHex(GUICtrlRead($String)))
        Case $msg = $HexToString
            GUICtrlSetData($String, _HexToString(GUICtrlRead($String)))
        Case $msg = $CopyToClipboard
            ClipPut(GUICtrlRead($String))
            MsgBox(0, "Copied", "Text copied to clipboard.")
        Case Else
       ;;;
    EndSelect
WEnd
Exit
Func _StringToHex($strChar)
    Local $aryChar, $i, $iDec, $hChar, $file, $strHex
    $aryChar = StringSplit($strChar, "")
    For $i = 1 To $aryChar[0]
        $iDec = Asc($aryChar[$i])
        $hChar = Hex($iDec, 2)
        $strHex = $strHex & $hChar
    Next
    Return $strHex
EndFunc ;==>_StringToHex
Func _HexToString($strHex)
    Local $strChar, $aryHex, $i, $iDec, $Char, $file, $iOne, $iTwo
    $aryHex = StringSplit($strHex, "")
    If Mod($aryHex[0], 2) <> 0 Then
        SetError(1)
        Return -1
    EndIf
    For $i = 1 To $aryHex[0]
        $iOne = $aryHex[$i]
        $i = $i + 1
        $iTwo = $aryHex[$i]
        $iDec = Dec($iOne & $iTwo)
        If @error <> 0 Then
            SetError(1)
            Return -1
        EndIf
        $Char = Chr($iDec)
        $strChar = $strChar & $Char
    Next
    Return $strChar
EndFunc ;==>_HexToString

Hope you like, I know it's small and easy but whatever B)

AutoIt Smith

Edited by AutoIt Smith

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Well the average person will not know about it, and first they have to decrypt the packet, then figure out WHAT it is encrypted in(hex) then decrypt that. This is just for the time being until I can write a more secure encryption engine. Plus it's not like someone will have access to the Master database file except the person who is running the server.

Edited by AutoIt Smith

Share this post


Link to post
Share on other sites

Storing the password in a file defeats the purpose of encrypting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0