Jump to content
Sign in to follow this  
Berend Jan

a ini file for storage password and usernames

Recommended Posts

hi guys,

I'm making a script in which i need to do 1 action for about 60 times. and for every single time i need the corresponding username and password. I want to put this into a ini file so that the script can IniRead it. But how do i put the info into the ini file?

this is what i have:

global $NumberOfUsers = IniRead ( '.\bankusers.ini', 'Header', 'NumberOfUsers', 1 )
global $MobUser = IniRead ( '.\bankusers.ini', 'User' & $UserNumber, 'MobUser', "Unknown User" )
global $MobPass = IniRead ( '.\bankusers.ini', 'User' & $UserNumber, 'MobPass', "" )

Func GetNextUser ( )
$UserNumber = $UserNumber + 1
if $UserNumber > $NumberOfUsers then
$UserNumber = 1
EndFunc ; GetNextUser

How do I insert the info into the ini file so that it's readable :) .

hope you guys can help me.

Berend Jan

Share this post


Link to post
Share on other sites

So the ini file would look something like this:?

Name of ini file: bankusers.ini

[Header]
NumberOfUsers = 21

[User1]
MobUser=???
MobPass=mypass

[User2]
MobUser=???
MobPass=mypass

[User3]
MobUse =???
MobPass=mypass

EDIT: Created like this, it would be easy to read and get the users info under the different sections

If it's importans and personal password, you could easyly encrypt them, before writing it in the ini file..

Edited by Wb-FreeKill

Share this post


Link to post
Share on other sites

So the ini file would look something like this:?

Name of ini file: bankusers.ini

[Header]
NumberOfUsers = 21

[User1]
MobUser=???
MobPass=mypass

[User2]
MobUser=???
MobPass=mypass

[User3]
MobUse =???
MobPass=mypass

EDIT: Created like this, it would be easy to read and get the users info under the different sections

If it's importans and personal password, you could easyly encrypt them, before writing it in the ini file..

<{POST_SNAPBACK}>

Great. that was what i was looking for:) thx

Share this post


Link to post
Share on other sites

If it's importans and personal password, you could easyly encrypt them, before writing it in the ini file..

<{POST_SNAPBACK}>

Which encryption are you reffering to?

In my case , i use a file crypted with EFS in wich i generate dummies ascii caracters before and after the password but i feel like it is not secure enough.

Xavier

Share this post


Link to post
Share on other sites

Again, MD5 does not allow for "decryption". It gives you a value of it.

For Example, say you showed me a bottle of water, I tell you that it is worth $1.29. You go and ask someone for $1.29, they will not be able to figure out what the $1.29 is for, unless you show them the bottle of water that you just showed me.

It's a one way thing, its practically impossible with today's computing resources to "decrypt" (or in other words find the original string by hashing each potential one and comparing) an MD5 string.

The _StringEncrypt() will work for the most part, unless its very private, in which you might want to look for another algorithm, or a series of algorithms.

If a username is specific to a computer or user, you may want to look into using the @ComputerName or @UserName macro. I use that a lot for basic licensing programs...


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

Off topic, but man do I get scared when I see "bank" and store usernames and passwords in an ini file. Makes me think it would be safer and more successful to walk into a bank with a laptop then a gun... Corse I tend to be paranoid when it comes to passwords and encryption. Don't mind me just bableing :(


Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites

Off topic, but man do I get scared when I see "bank" and store usernames and passwords in an ini file.  Makes me think it would be safer and more successful to walk into a bank with a laptop then a gun...  Corse I tend to be paranoid when it comes to passwords and encryption.  Don't mind me just bableing :(

<{POST_SNAPBACK}>

hi,

Have you got a secure way to do it?

a+

Xavier

PS: inow use _StringEncrypt (works fine)

Share this post


Link to post
Share on other sites

hi,

Have you got a secure way to do it?

a+

Xavier

PS: inow use _StringEncrypt (works fine)

<{POST_SNAPBACK}>

The 100% most secure way is, dont store passwords. I worked at a company as part of its Network Intrusion team, and I basiclly was paid to try to break into it's own systems to find out how to secure them better so real hackers couldn't get it. If someone finds a way into your system, even if its READ_ONLY, they could gain 60 user accounts and passwords, and chances are those accounts could have more access. Then you are in a world of hurt. Any method you use that would Automate sending a "plain-text" password could be compromised and the passwords retrieved.

If you encrypt the password and have the script supply a key to decrypt it back into plain text, the key used can be seen, and then you can decrypt the password.

That's why I don't store passwords, I bite the bullet and manually enter them.

Edited by Ejoc

Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...