LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-31-2012, 02:35 PM   #1
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Rep: Reputation: 23
How to username password and sort by weakest password


I am trying to figure out without changing the order of the data - to sort by the weakest password.

I have formatted the data from the database like so:

adam,acme1
billy,boxer1
carver,acme2
jim,boxer2

I am trying to sort it by the weakest password first, without disrupting the username,password match?

From what I have tried it makes the data useless because the username,password does not match after I sort the password field.

Any help/advice would be great.

thanks
 
Old 10-31-2012, 02:53 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,541
Blog Entries: 54

Rep: Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924Reputation: 2924
Do show us what you actually tried ('man sort': "-k").
How will you sort data if all shown passwords are equally weak?
 
1 members found this post helpful.
Old 11-01-2012, 05:15 PM   #3
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 13.1
Posts: 1,320

Rep: Reputation: 252Reputation: 252Reputation: 252
How do you define, that password A is weaker than password B – length, number of different characters, used sets and amount used (alpha [with or without vowel]), numeric, punctuation marks, upper-/lowercase)?
 
Old 11-05-2012, 09:42 AM   #4
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by unSpawn View Post
Do show us what you actually tried ('man sort': "-k").
How will you sort data if all shown passwords are equally weak?
Sorry for delay, I am not sure on how to tell if a password is weak from sorting the data?

I have it dumped into a file like the format listed above.

---------- Post added 11-05-12 at 08:43 AM ----------

Quote:
Originally Posted by Reuti View Post
How do you define, that password A is weaker than password B length, number of different characters, used sets and amount used (alpha [with or without vowel]), numeric, punctuation marks, upper-/lowercase)?
all lowercase without any numbers, symbols, captials

I am at a loss on how to do this.
 
Old 11-05-2012, 09:52 AM   #5
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,003

Rep: Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320
You need to measure the passwords somehow, for example 1 means weak, 10 means strong. You need to define an algorithm to measure those passwords and generate a new column:
Code:
adam,acme1,7
billy,boxer1,3
carver,acme2,6
jim,boxer2,2
Finally you can sort the list by that column.
 
Old 11-05-2012, 10:59 PM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,423

Rep: Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158Reputation: 1158
You will need to come up with some function for gaging the "weakness" of a particular password-value; a function that will return some kind of numeric value. It is possible, in whatever language you're using, to specify that the data should be sorted by the result of that function when applied to a particular field.

Be aware that the function in question might be called literally millions of times during the sort.
 
Old 11-06-2012, 09:08 AM   #7
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Original Poster
Rep: Reputation: 23
Let me do some research and see if I can find some sort of function to check this.

thank you all for the quick responses and help

 
Old 11-06-2012, 09:18 AM   #8
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,003

Rep: Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320Reputation: 1320
http://www.passwordmeter.com/
 
Old 11-07-2012, 09:39 AM   #9
rhbegin
Member
 
Registered: Oct 2003
Location: Arkansas, NWA
Distribution: Fedora/CentOS/SL6
Posts: 381

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by pan64 View Post
thanks I will check this out

 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Username and Password? smitz327 Linux - Newbie 4 07-28-2012 12:11 PM
Username/Password Help FindingWaldo763 Linux - Newbie 7 12-18-2005 08:15 PM
UserName and Password luis8460 Red Hat 0 07-08-2004 05:45 AM
Username and Password dance2die Arch 3 09-01-2003 04:32 PM
No username and password Tec1 Linux - Software 1 08-10-2003 10:38 AM


All times are GMT -5. The time now is 09:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration