Mkpass v 0.2

By macs-rock on Jan 04, 2011

hello i decided to make my old mkpass thing with no alias and you really can't beat this
same command !mkpass
but select the number of digits
!mkpass 1
!nkpass 2
!mkpass 3
!mkpass 4
!mkpass 5
!mkpass 6
!mkpass 7
!mkpass 8
!mkpass 9
!mkpass 10
!mkpass 11
see simple

on 1:TEXT:!mkpass 1:#:{
msg $chan your generated password is... $r(A,Z)
}
on 1:TEXT:!mkpass 2:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z)
}
on 1:TEXT:!mkpass 3:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9)
}
on 1:TEXT:!mkpass 4:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z)
}
on 1:TEXT:!mkpass 5:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z)
}
on 1:TEXT:!mkpass 6:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9)
}
on 1:TEXT:!mkpass 7:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9) $+ $r(A,Z)
}
on 1:TEXT:!mkpass 8:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z)
}
on 1:TEXT:!mkpass 9:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9)
}
on 1:TEXT:!mkpass 10:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9) $+ $r(A,Z)
}
on 1:TEXT:!mkpass 11:#:{
msg $chan your generated password is... $r(A,Z) $+$r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z) $+ $r(0,9) $+ $r(A,Z) $+ $r(a,z)
}

Comments

Sign in to comment.
IllogicTC   -  Jan 08, 2011

I personally would suggest other examples, that exhibit a more random function than this particular snippet. Not only is it limited (and a large snippet for the simple function it provides), but notice there is a pattern to it. Usually random passwords rely on the fact that in using alphanumeric characters, a password of given length (say 3 characters for simplicity) will have 62^3, or 238328 possible combinations. Compare that to !mkpass 3 here, where you get 26 26 10, or 6760 combinations (only 2.8% of the total of true random). It guarantees to someone looking to break your password that your first letter will ALWAYS be an uppercase letter, your second a lowercase letter, and your third a number, and in repeating order.

 Respond  
Jethro   -  Jan 08, 2011

Nice one, Typo.

 Respond  
Typo   -  Jan 08, 2011

Dont know what made me comment when I haven't in so long but anyhow....

Here is the makepass alias I came up with some time ago on a whim.

It defaults to a random pass between 12 and 18 characters but you can select the ammount of characters like '$makepass(10)' or '/makepass 10'.

It randomizes using numbers and upper and lower case letters.

It's also set to output differently depending on how it is used. If you use it like $makepass() it will simply return it, and if u use it like /makepass it will echo it.

alias makepass {
  var %go $iif($1 isnum,$v1,$r(12,18))
  while (%go) {
    var %pass %pass $+ $iif($r(1,3) == 1,$r(a,z),$iif($v1 == 2,$r(A,Z),$iif($v1 == 3,$r(0,9))))
    dec %go
  }
  $iif($isid,return,echo -a) %pass
}
 Respond  
Jethro   -  Jan 06, 2011

To refer to marcs-rock's original code here, napa, 5 means a five-character pass. :P Of course, it's a different topic as per your example.

 Respond  
napa182   -  Jan 06, 2011

I know that Jethro_ and a 5 chr pass is int good to me so I like to use a 15 chr pass.

what gave you the idea it was a 5 chr pass? just cuz i used a 5 in it?

 Respond  
Jethro   -  Jan 06, 2011

Well napa182, that results more than 5 characters long for a pass.

 Respond  
napa182   -  Jan 06, 2011

this should be good enough to gen a random pass
eh bored...

//echo -a $regsubex($str(.,5),/./g,$+($r(a,z),$r(1,9),$r(A,Z)))
 Respond  
Jonesy44   -  Jan 06, 2011

I've no idea which order $r or $str exectues in. Else you could just use regsubex of a str of .'s then randomize each character.

Furthermore, you could randomize between upper, lower case, numbers symbols.. If you have spare time.

 Respond  
macs-rock   -  Jan 06, 2011

oh yeh xD

 Respond  
Jethro   -  Jan 06, 2011

I think macs-rock was putting all the code together through the copying and pasting in a hurry that he forgot to leave a space between:> $+$r(a,z) there is a space between $+ and $r(a,z) without the space, that identifier will be negated.

One thing about using $str() is that all the generated password will appear the same. Take jonesy's example, and we make it 5, it'll generate a set of 5 random letters like so, > mmmmmLastly, the approach macs-rock's gone for is rather repetitive and inefficient, making the code bigger than it should.

 Respond  
Known   -  Jan 05, 2011

You could of just set a var and made it add a specfic pattern of different rands of chrs per the $2 number, as this would be not only very limited but also not completly random at all, since it will also be letter - letter - number ...etc which was showed in the previous version of this script, where you should have posted the updated one instead of creating a new post.

 Respond  
Jonesy44   -  Jan 05, 2011
alias mkpass {
  return $str($r(a,z),$1)
}
 Respond  
macs-rock   -  Jan 05, 2011

well i will go ahead and edit this one so i can show you what it eould have to be like with just scripts per line and easy for other people to add numbers to it. also with $r

 Respond  
sunslayer   -  Jan 04, 2011

$r is the same thing as $rand so it should have worked and you should have updated your old code instead of posting a new snippet

you also have a bracket mismatch, line 3 needs a { at the end

this could also be shortened alot by using $str

 Respond  
macs-rock   -  Jan 04, 2011

also i did try and use $r but it failed so sorry if this is like the most biggest problem in my code

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.