Jump to content
Sign in to follow this  

Hex Conversion Tool

Recommended Posts


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: BETA (Will Work With AutoIt v3 Non-Beta)
; Author:       Max Gardner(AutoIt Smith;king.of.all@comcast.net)
; Script Function:
;   Small Hex Utility
; ----------------------------------------------------------------------------
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)
While 1
    $msg = GUIGetMsg()
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $StringToHex
            GUICtrlSetData($String, _StringToHex(GUICtrlRead($String)))
        Case $msg = $HexToString
            GUICtrlSetData($String, _HexToString(GUICtrlRead($String)))
        Case $msg = $CopyToClipboard
            MsgBox(0, "Copied", "Text copied to clipboard.")
        Case Else
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
    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
        Return -1
    For $i = 1 To $aryHex[0]
        $iOne = $aryHex[$i]
        $i = $i + 1
        $iTwo = $aryHex[$i]
        $iDec = Dec($iOne & $iTwo)
        If @error <> 0 Then
            Return -1
        $Char = Chr($iDec)
        $strChar = $strChar & $Char
    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

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.