Sign in to follow this  
Followers 0
2Radon

Searching an excel and reading adjacent

4 posts in this topic

#1 ·  Posted (edited)

My goal is to acquire usernames and passwords from an excel file.

 

The table may look different for each person who has an excel file with usernames and passwords, it may be filtered in excel also (if that matters when reading from an excel file).

But the thing that they all must have in common is this fact (lets say it's for websites):

  • For each website in a column (could be the firs, the second...), there is an adjacent username, and then next to that, password, in the corresponding row.

Now I need to find and read these usernames and passwords by searching the websites column for the website that my program will need those credentials for.

The required website may be written (in the websites column) in different names, for example, YouTube as YT, Facebook as FB and so on (These can be like tags that are related, a group of these tags meaning one website, just like YT means YouTube).

 

************************************

Further on,

I'd like it to do so that the excel file is never (at least not more than once) opened, as possible.

Also, a plan ahead is to store this acquired table (array) of credentials and websites in a different file, one that is not excel or related to another program/application.

Because then I want to make this information as secure as possible, so this AutoIt program will have to be able to encrypt and decrypt this information and protect it as deeply as possible.

Later on I plan to design a unique security system for accessing this information, which will, after all, perform the above described search in the excel file (or better the created file from that).

Edited by 2Radon

Share this post


Link to post
Share on other sites



That sounds like a great project, but I fail to see a question. Understand that this is a forum for helping folks with their scripts, not one where you list requirements and we barf up code for you ;)

What have you tried on your own already?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

 

Because then I want to make this information as secure as possible

Then Excel is out of the game ;)

Please have a look at Keepass on the web - a secure, encrpyted password store. Keyform on this forum allows to automatically iinsert userid/password from the keepass data base into the website.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Then Excel is out of the game ;)

Please have a look at Keepass on the web - a secure, encrpyted password store. Keyform on this forum allows to automatically iinsert userid/password from the keepass data base into the website.

 

I bet KeePass won't secure your passwords if somebody simply comes up to you and beats you up when you have just logged into it. ;DD

If there is a way to draw credentials from the KeePass encrypted database with AutoIt, then that would be better than thinking up a new, inferior encryption.

But before I talk about KeePass, my first goal is to get all the credentials from an Excel file, as many people whom this program will be made for might have their credentials simply in an Excel file.

And yes I know its security is not even discussable. :)

 

Now about what code I have come up with so far, I can't bust out a large gargantuan yet, but I am thinking by steps.

#include <Excel.au3>
#include <Array.au3>

$xlsx = @ScriptDir & "\credtest.xlsx"
_WinWaitActivate("credtest.xlsx - Excel", "")
$oExcel = _ExcelBookAttach($xlsx)


; Somewhere I need a way for this script to find out which column has users (contains "usr") and which'
; column has passwords. For websites that would be some website specificalities like http, www, com, net, etc., etc.


;Dim $aCreds[100][100]
;$aCreds = _ExcelReadSheetToArray($oExcel, 2, 2) ; Was trying something here, don't remember what :O
$aCreds = _ExcelReadArray($oExcel, 2, 2, 20, 1, 1)

; Before this I had problems with creating an array from excel like I wanted, and used this to check if it is correct

;If IsArray($aCreds) Then
;   MsgBox(0, "Array", "It is." & $aCreds[3])
;Else
;   MsgBox(0, "Fail", "It is NOT.")
;EndIf



; This tells me the index is 10. It is the 11th row in the excel table, but it is the 10th user, since the index
; base for the array was set to start from 1
$search = _ArraySearch($aCreds, "usr10")

MsgBox(0, "Found User", $search)


; Next I need to try taking the password adjacent to the user once it is found.




Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    ;      :)      a random smiley
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc

This isn't much at all, but I am slowly working on this aside my other projects. I will accept any teachings, suggestions and idea tomatoes. :)

credtest.xlsx

Edited by 2Radon

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