08-03-2014, 01:07 PM (This post was last modified: 08-04-2014 01:20 PM by Dave Britten.)
Post: #1
 Dave Britten Senior Member Posts: 1,182 Joined: Dec 2013
EDIT (Aug 4): Fixed a really stupid bug. Thanks Joe.

I needed to generate a WEP key to set up an access point for legacy gear, but didn't have a tool handy that would allow me to restrict the output to a 13-digit hexadecimal number. But I've got a 48, so that problem didn't last long!

Input:
2: Length of password
1: Allowable characters (enter as a single string, e.g. "0123456789ABCDEF")

Output:

Code:
\<< DUP SIZE \-> L C S   \<< "" 1 L     START C RAND S * CEIL DUP SUB +     NEXT   \>> \>>

Disclaimer: This is only as cryptographically secure as the quality of the random number generator built in to the 48. Don't use it for securing warheads or anything like that.
08-04-2014, 03:35 AM (This post was last modified: 08-04-2014 03:41 AM by Joe Horn.)
Post: #2
 Joe Horn Senior Member Posts: 1,505 Joined: Dec 2013
RE: (48) Password Generator
(08-03-2014 01:07 PM)Dave Britten Wrote:
Code:
\<< DUP SIZE \-> L C S   \<< "" 1 L     START C RAND S * 1 + DUP SUB +     NEXT   \>> \>>

Please note that the first character in the input string will have a greater probability of getting picked than any other, and the final one will have less probability, and sometimes the output will be shorter than L, since SUB rounds to the nearest integer. I therefore suggest replacing 1 + with CEIL. This evens out the probabilities, fixes the length bug, and is a tad shorter and faster too.

<0|ɸ|0>
-Joe-
08-04-2014, 11:28 AM
Post: #3
 Dave Britten Senior Member Posts: 1,182 Joined: Dec 2013
RE: (48) Password Generator
(08-04-2014 03:35 AM)Joe Horn Wrote:
(08-03-2014 01:07 PM)Dave Britten Wrote:
Code:
\<< DUP SIZE \-> L C S   \<< "" 1 L     START C RAND S * 1 + DUP SUB +     NEXT   \>> \>>

Please note that the first character in the input string will have a greater probability of getting picked than any other, and the final one will have less probability, and sometimes the output will be shorter than L, since SUB rounds to the nearest integer. I therefore suggest replacing 1 + with CEIL. This evens out the probabilities, fixes the length bug, and is a tad shorter and faster too.

Thanks Joe, can't believe I missed that. I blame the fact that I'm in the hospital for a couple days, and was on pain medication when I wrote that.
03-22-2017, 04:38 PM
Post: #4
 pier4r Senior Member Posts: 2,016 Joined: Nov 2014
RE: (48) Password Generator
This is a nice idea!

I will try to expand it in phonetic passwords, since a crude random password may be too difficult to type.

PS: a thing is that all the programs are according to a calculator but actually many calculators are compatible to each other, so I discard the non-50g threads while actually I miss many useful threads.

Wikis are great, Contribute :)
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)