Sign in to follow this  
Followers 0
PcExpert

change Hardcoded password

6 posts in this topic

Hi all,

Is there a way to change a hardcoded password?

Example:

Original:

$pw = InputBox("Password Test", "Please enter your password")

If $pw = "MyPassword" then

Msgbox(64, "Password Test", "Access Granted")

Else

Msgbox(16, "Password Test", "Access Denied")

Endif

User changed password:

$pw = InputBox("Password Test", "Please enter your password")

If $pw = "MyChangedPassword" then

Msgbox(64, "Password Test", "Access Granted")

Else

Msgbox(16, "Password Test", "Access Denied")

Endif

Or is there any other way to safely store a password?

Thanks!

Share this post


Link to post
Share on other sites



No, you can't change a hardcoded password, but you could encrypt it and store in registry/.ini

Share this post


Link to post
Share on other sites

Can you explain me how to encrypt the ini?

Share this post


Link to post
Share on other sites

Look up the _StringEncrypt help file. You should find some help with encryption there.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

use hashes!

it's the safest thing i believe

let's suppose you have a function called MD5() that gives you an MD5 Hash of a string (you can find some of these scripts on the forum)

then what you do is this:

$pw = InputBox("Password Test", "Please enter your password")
If MD5($pw) = "847d78db803dd148cdcc22ee7c4a0205" then ;847d78db803dd148cdcc22ee7c4a0205 is an MD5 hash of MyChangedPassword
Msgbox(64, "Password Test", "Access Granted")
Else
Msgbox(16, "Password Test", "Access Denied")
Endif

the advantage in this is that you can't reverse the password (at least not in a short time... it usually takes days and loads of work)

this allows you to also store the new password (every time it's changed) as it is in an ini or a registry key. Just hash it.

cheers


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

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