LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Generate specific wordlist (https://www.linuxquestions.org/questions/programming-9/generate-specific-wordlist-4175456623/)

psionl0 04-05-2013 11:42 AM

Quote:

Originally Posted by danielbmartin (Post 4925738)
I tested the improved ruby solution 20 times and found no instances of any character appearing twice in succession.

You have interpreted "consecutive" differently to the way I have. To me, it means that no character is followed by the next character in the 0-F sequence.

In your first example, 5A2C74CD74, there are the consecutive characters 'C' and 'D'.

danielbmartin 04-05-2013 12:40 PM

Quote:

Originally Posted by psionl0 (Post 4925767)
You have interpreted "consecutive" differently to the way I have. To me, it means that no character is followed by the next character in the 0-F sequence.

In your first example, 5A2C74CD74, there are the consecutive characters 'C' and 'D'.

We'll have to hear from the OP to decide this question.

Security experts discourage repeat characters because such passwords are insecure. A person whose "lucky number" is 7 might be tempted to establish a password such as 7777777777. For that matter, the easy-to-remember password 1234567890 is also insecure.

If your interpretation is correct, that makes this programming task more challenging.

Should we also prohibit downward increments such as 9876543210? How about "flip-flop" passwords such as 6969696969?

Daniel B. Martin

psionl0 04-05-2013 08:31 PM

Quote:

Originally Posted by danielbmartin (Post 4925792)
We'll have to hear from the OP to decide this question.

I suspect we will be waiting a long time. ;)

It's interesting how often that happens with noobs when they only get hints instead of a complete program as an answer to their query. However, I still prefer to offer some hints instead of accusing them of looking for answers to their "homework" (they might be genuine).

Quote:

Originally Posted by danielbmartin (Post 4925792)
If your interpretation is correct, that makes this programming task more challenging.

Actually, my psuedo-code handled it quite readily. I tested it using "blassic" (the quickest way) and none of the passwords it generated have 2 consecutive characters. Here are 10 outputs it generated:
Code:

48EED0D330
E9FC287F54
52E0BA28A3
D2B04D92F5
BE4E6C8111
13DB65B29F
E92C7BE426
488B46A7DD
C952FBD170
DFC5A77930


grail 04-05-2013 09:04 PM

Quote:

none of the passwords it generated have 2 consecutive characters
Well not going left to right :)

psionl0 04-05-2013 09:42 PM

I might have had an overly narrow interpretation of "never have 2 consecutive characters side by side" but it is easy enough to modify the non_consecutive() function to incorporate ascending order, descending order and even equal characters if that is what the user wants. In a proper consultation process, you would go around loops like this several times until you have a specification that is just what the user wanted.

ETA it took me 10 minutes to modify non_consecutive() as above. The results look a lot more random now:
Code:

C508C1AD35
C63B6030AF
681B941AEA
42D1814BDF
B7C815C38E
64A06F24AD
6EB51C6C58
81FD26A59A
4B74DA4B36
27306C1CEA


grail 04-06-2013 04:04 AM

Well I can admit it took me longer than 10 minutes, but I am still learning this language (and I made some silly mistakes along the way :( )
Code:

24F96AEB70
C73E861B0A
E39DA85C26
9ECF753B06
A1E0D2F847
D136FC94A0
9EA683BF27
F5164D8EA0
AE95B6C370
8D3FAE5190
A1B52E48D3


psionl0 04-07-2013 12:18 AM

Quote:

Originally Posted by grail (Post 4926165)
Well I can admit it took me longer than 10 minutes, but I am still learning this language (and I made some silly mistakes along the way :( )

I'm not surprised. I've found with these OOP languages that by the time I have found a suitable class library, learned how to use it and how to extend it to do what I want, I could have coded the whole thing from scratch in assembly language several times over. ;)


All times are GMT -5. The time now is 10:56 PM.